cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              [[[https://codepen.io/thebabydino/pen/zEbVPO]]]

svg(viewBox=[-d, -.5*d, 2*d, d].join(' ') 
		xmlns='http://www.w3.org/2000/svg')
	style
		| svg { fill: #{darken}; font: #{fs}px consolas, monaco, monospace }
		| svg > [d], [r], line { fill: none; stroke: #{llight}; stroke-width: #{2*sw} }
		| #e *, [d] + [x] { fill: #{llight} }
		| [x] +  [d] { marker-end: url(#e) }
		| [d] + [x] { font: 1em times new roman, serif }
		| [d] ~ [x] { font-style: italic }
		| [r] + * + [d] { fill: hsla(0, 0%, 83%, .7) }
		| line, [y2] ~ [d] { stroke: #{purple}; stroke-width: #{3*sw} }
		| [d] + line { stroke-width: #{4*sw} }
		| [r] + [d] { stroke: #999 }
		| line ~ [r], [y2] ~ [d] { stroke: #{darken} }
		| line ~ [r] { fill: #{orange} }
		| [d] + * + [d] { stroke: #cb0; fill: rgba(255,238,51,.7) }
		| [y2] { stroke: #b9c }
		| [d] + [d] { stroke: #d97 }
		| [y2] + * + [d] { stroke: #{tomato} }
		| [cx] + line { stroke: #{orange} }
		| tspan { font-size: .5em }
	- var ra = +(.75*sri).toFixed(e);
	- for(var i = 0; i < sp; i++) {
		- var ca = i*sbac;
		- pts.push([+(srco*Math.cos(ca)).toFixed(e), +(srco*Math.sin(ca)).toFixed(e)]);
	- }
	- var m = [.5*(pts[0][0] + pts[1][0]), .5*(pts[0][1] + pts[1][1])];
	- var sin = Math.sin(.5*sbac), cos = Math.cos(.5*sbac);
	- var s = [+(srco*cos).toFixed(e), +(srco*sin).toFixed(e)];
	- var ar = [[+(m[0] - ram*cos).toFixed(e), +(m[1] - ram*sin).toFixed(e)]];
	- ar[1] = [+(ar[0][0] + ram*sin).toFixed(e), +(ar[0][1] - ram*cos).toFixed(e)];
	- ar[2] = [+(m[0] + ram*sin).toFixed(e), +(m[1] - ram*cos).toFixed(e)];
	- mp = [.5*(m[0] + ar[1][0]), .5*(m[1] + ar[1][1])];
	marker#e(markerWidth=ad markerHeight=ad 
						viewBox='0 -4 8 8' 
						orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	//-angle val labels
	text(x=srco y=.8*fs) 0°
	text(x=+(s[0] + .125*fs).toFixed(e) y=+(s[1] + .75*fs).toFixed(e)) 36°
	text(x=(pts[1][0] - .5*fs) y=(pts[1][1] + fs)) 72°
	//-axes
	path(d=`M${-ax} 0H${ax}`)
	text(x=ax - .5*fs y=-.5*fs) x
	text(x=(-.75*fs) y=-.2*fs) O
	text(x=m[0] - fs y=m[1] + .5*fs) M
	path(d=`M0${-ax}V${ax}`)
	text(x=.4*fs y=(ax - .2*fs)) y
	//-pentagon circumradius
	circle(r=srco)
	//-polygon (well, except first edge)
	path(d=`M${pts.slice(1).join(' ')} ${pts[0]}M${m} ${s}`)
	//-triangle background
	path(d=`M${pts[0]} 0 0 ${m}`)
	//-arc
	path(d=`M0 0 ${ra} 0
					A${ra} ${ra} 0 0 1 ${+(ra*cosc).toFixed(e)} ${+(ra*sinc).toFixed(e)}`)
	//-circumradii
	line(x2=srco)
	line(x2=pts[1][0] y2=pts[1][1])
	//-perpendicularity
	//-perpendicularity
	path(d=`M${ar.join(' ')}`)
	//-edge
	path(d=`M${pts[0]} ${m}`)
	path(d=`M${m} ${pts[1]}`)
	//-poly points
	- for(var i = 0; i < sp; i++) {
		circle(cx=pts[i][0] cy=pts[i][1] r=i?pr1:pr)
	- }
	//-inradius
	line(x2=m[0].toFixed(e) y2=m[1])
	//-perpendicularity point
	circle(cx=mp[0].toFixed(e) cy=mp[1] r=.2*pr)
	//-inradius ends
	circle(r=pr)
	circle(cx=m[0].toFixed(e) cy=m[1] r=pr)
	circle(cx=s[0] cy=s[1] r=pr1)
	//-vertex name labels
	text(x=srco y=-.2*fs) V<tspan>0</tspan>
	text(x=pts[1][0] y=pts[1][1] + 2*fs) V<tspan>1</tspan>

// minimal SVG
<svg viewBox='-2500 -1250 5000 2500' xmlns='http://www.w3.org/2000/svg'><style>svg{fill:#333;font:150px consolas,monaco,monospace}svg>[d],[r],line{fill:none;stroke:#ccc;stroke-width:10}#e *,[d]+[x]{fill:#ccc}[x]+[d]{marker-end:url(#e)}[d]+[x]{font:1em times new roman,serif}[d]~[x]{font-style:italic}[r]+*+[d]{fill:hsla(0,0%,83%,.7)}line,[y2]~[d]{stroke:#95a;stroke-width:15}[d]+line{stroke-width:20}[r]+[d]{stroke:#999}line~[r],[y2]~[d]{stroke:#333}line~[r]{fill:#f90}[d]+*+[d]{stroke:#cb0;fill:rgba(255,238,51,.7)}[y2]{stroke:#b9c}[d]+[d]{stroke:#d97}[y2]+*+[d]{stroke:#b53}[cx]+line{stroke:#f90}tspan{font-size:.5em}</style><marker id='e' markerWidth='10' markerHeight='10' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><text x='988' y='120'>0°</text><text x='818' y='694'>36°</text><text x='230' y='1090'>72°</text><path d='M-1230 0H1230'/><text x='1155' y='-75'>x</text><text x='-113' y='-30'>O</text><text x='497' y='545'>M</text><path d='M0-1230V1230'/><text x='60' y='1200'>y</text><circle r='988'/><path d='M305 940-799 581-799-581 305-940 988 0M647 470 799 581'/><path d='M988 0 0 0 647 470'/><path d='M0 0 229 0A229 229 0 0 1 71 218'/><line x2='988'/><line x2='305' y2='940'/><path d='M582 423 629 358 694 405'/><path d='M988 0 647 470'/><path d='M647 470 305 940'/><circle cx='988' cy='0' r='25'/><circle cx='305' cy='940' r='18'/><circle cx='-799' cy='581' r='18'/><circle cx='-799' cy='-581' r='18'/><circle cx='305' cy='-940' r='18'/><line x2='647' y2='470'/><circle cx='638' cy='414' r='5'/><circle r='25'/><circle cx='647' cy='470' r='25'/><circle cx='799' cy='581' r='18'/><text x='988' y='-30'>V<tspan>0</tspan></text><text x='305' y='1240'>V<tspan>1</tspan></text></svg>
            
          
!
            
              body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 0;
	height: 100vh;
}

svg { display: block }
            
          
!
            
              // minimal SVG: https://codepen.io/thebabydino/pen/qPJqQX?editors=1000
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console