Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                - var d = 2000, o = -.5*d;
- var r = .2*d, n = 6;
- var ba = 2*Math.PI/6;
- var sw = ~~(.008*r), rs = 3*sw;
- var fs = .035*d, a = [];
- var na = ~~(.15*fs), f = 2.25, k = .8;
- var ha = .5*ba, qa = .25*ba;
- var y0 = -Math.round(r*Math.cos(ha));
- var rp = Math.round(.5*r/Math.sqrt(2))

svg(viewBox=[o, .9*o, d, .5*d].join(' ') xmlns='http://www.w3.org/2000/svg')
	style
		| * { fill: none }
		| text, #e * {
		| 	fill: #ccc;
		| 	font: 700 #{fs}px courier new, monospace
		| }
		| svg > [d], [r] {
		| 	stroke: #ccc;
		| 	stroke-width: #{Math.round(1.4*sw)}
		| }
		| [r='#{r}'] { stroke-dasharray: #{+(Math.PI*r/100).toFixed(2)} }
		| [cy='#{y0}'] { stroke: #f90 }
		| [d] + [x] {
		| 	font: italic #{fs}px times new roman, serif
		| }
		| #e ~ * { marker-end: url(#e) }
		| [d] ~ [r] { fill: #95a }
		| #r + *, [r='#{rs}'] + text { filter: url(#r) }
		| #p + *, text + text { filter: url(#p) }
	text(x=o + fs y=o + 3*fs) ha = ba/2
	- for(var i = 0; i < n; i++) {
		- var ca = (i - 1)*ba;
		- var x = Math.round(r*Math.cos(ca));
		- var y = Math.round(r*Math.sin(ca));
		- a.push([Math.round(f*x), Math.round(f*y)]);
		circle(r=r cx=x cy=((y != 0) ? y : null))
	- }
	- var cx = Math.round(a[0][0]/f), cy = Math.round(a[0][1]/f);
	- var r1 = k*r;
	- var x = Math.round(k*cx), y = Math.round(k*cy);
	text(x=-1.2*fs y=-2*r) -90°
	path(d=`M${a[0]}L0,0L${a[n - 1]}`)
	marker#e(markerWidth=na markerHeight=na 
					 viewBox='0 -4 8 8' orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	text(x=2*r + .2*fs y=fs) 0°
	filter#r
		feColorMatrix(type='matrix'
									values=`.6 0 0 0 0 
													.1 0 0 0 0 
													0 0 0 0 0 
													0  0 0 1 0`)
	path(d=`M${.5*r} 0A${.5*r} ${.5*r} 0 0 0 0${-.5*r}`)
	filter#p
		feColorMatrix(type='matrix'
									values=`.4 0 0 0 0 
													.1 0 0 0 0 
													.5 0 0 0 0 
													0  0 0 1 0`)
	path(d=`M0${-r}A${r} ${r} 0 0 1 ${cx} ${cy}`)
	text(x=2.25*r y=-.5*fs) x
	path(d=`M0${-2*r}V${2*r}M0 0H${2.25*r}`)
	circle(r=rs cx=cx cy=cy)
	circle(r=rs cx=-cx cy=cy)
	circle(r=rs)
	text(transform=`rotate(45 ${2.6*fs} ${-.4*fs})`) -90°
	text(transform=`rotate(15 ${19*fs} 0)`) ha

// minimal SVG
<svg viewBox='-1000 -900 2000 1000' xmlns='http://www.w3.org/2000/svg'><style>*{fill:none}text,#e *{fill:#ccc;font:700 70px courier new,monospace}svg>[d],[r]{stroke:#ccc;stroke-width:4}[r='400']{stroke-dasharray:12.57}[cy='-346']{stroke:#f90}[d]+[x]{font:italic 70px times new roman,serif}#e~*{marker-end:url(#e)}[d]~[r]{fill:#95a}#r+*,[r='9']+text{filter:url(#r)}#p+*,text+text{filter:url(#p)}</style><text x='-930' y='-790'>ha = ba/2</text><circle r='400' cx='200' cy='-346'/><circle r='400' cx='400'/><circle r='400' cx='200' cy='346'/><circle r='400' cx='-200' cy='346'/><circle r='400' cx='-400'/><circle r='400' cx='-200' cy='-346'/><text x='-84' y='-800'>-90°</text><path d='M450-778L0 0L-450-778'/><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='814' y='70'>0°</text><filter id='r'><feColorMatrix type='matrix' values='.6 0 0 0 0 .1 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/></filter><path d='M200 0A200 200 0 0 0 0-200'/><filter id='p'><feColorMatrix type='matrix' values='.4 0 0 0 0 .1 0 0 0 0 .5 0 0 0 0 0 0 0 1 0'/></filter><path d='M0-400A400 400 0 0 1 200-346'/><text x='900' y='-35'>x</text><path d='M0-800V800M0 0H900'/><circle r='9' cx='200' cy='-346'/><circle r='9' cx='-200' cy='-346'/><circle r='9'/><text transform='rotate(45 182 -28)'>-90°</text><text transform='rotate(15 1330 0)'>ha</text></svg>
              
            
!

CSS

              
                body {
	display: flex;
	flex-direction: column;
	margin: 0;
	height: 100vh;
}
              
            
!

JS

              
                
              
            
!
999px

Console