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

              
                - let h = 2000, w = 2*h;
- let x = -.3*w, y = -.5*h;
- let sw = .0025*w, fs = Math.round(.0375*w);
- let bh = .375*w, bw = .5*bh;
- let bx = -.5*bw, by = -.5*bh;
- let ta = Math.round(.65*fs);
- let dm = 1.25*fs, dt = Math.round(.1*ta);
- let gx = bx - dm, tx = gx + dt, mx = gx + .75*ta;
- let gy = by - dm, ty = gy + dt, my = gy + .75*ta;
- let r = Math.round(2*fs);
- let ah = 2*Math.round(.2*fs), aw = Math.round(.5*fs);
- let a = Math.atan(bh/bw), b = .5*Math.PI - a;
- let da = +(a*180/Math.PI).toFixed(3);
- let db = +(b*180/Math.PI).toFixed(3);
- let q3 = +(1.5*Math.PI*r).toFixed(2);
- let aa = +(a*r).toFixed(2), ba = +(b*r).toFixed(2);

svg(viewBox=[x, y, w, h].join(' ') xmlns='http://www.w3.org/2000/svg')
	style
		| svg { color: #333; fill: currentcolor; font: #{fs}px  consolas, monaco, ubuntu mono, monospace; text-anchor: middle; dominant-baseline: middle; word-spacing: #{Math.round(-.25*fs)}px }
		| [r] ~ [d], [r] { fill: none; stroke: currentcolor; stroke-width: #{sw} }
		| [x] + [d] + [d] { fill: #ffc }
		| [r] + * { color: #aaa; stroke-dasharray: #{.125*ah} }
		| [d] ~ [x], [d] ~ [r] { color: #f80; stroke-dasharray: 0 #{q3} #{ba} #{aa}; text-anchor: start }
		| [r] ~ [x], [r] ~ [r] { color: #a0f; stroke-dasharray: 0 #{.5*(q3 + ba)} #{.5*aa} }
		| [r] + * + [d] { color: #d37; stroke-width: #{2*sw} }
	text(x=-.5*bx y=ty) w/2
	text(x=.5*fs - tx y=.5*by) h/2
	text(y=-ty) w
	text(x=tx) h
	path(d=`M${mx}${by}l${-.5*ah} ${aw}h${ah}M${-mx}${by}l${-.5*ah} ${aw}h${ah}M${mx} ${-by}l${-.5*ah}${-aw}h${ah}M${-mx} 0l${-.5*ah}${-aw}h${ah}M${-bx} ${-my}l${-aw}${-.5*ah}v${ah}M${bx} ${-my}l${aw}${-.5*ah}v${ah}M${-bx}${my}l${-aw}${-.5*ah}v${ah}M0${my}l${aw}${-.5*ah}v${ah}`)
	path(d=`M0 0h${-bx}v${by}`)
	text(x=.3*w y=-4*fs) β = 90° - α
	text(x=.0375*fs y=ta - 2*fs) β
	circle(r=r)
	text(x=.3*w y=-2*fs) tan(α) = h/w
	text(x=.3*w) α = atan(h/w)
	text(x=.25*fs y=-.5*ta) α
	circle(r=.5*r)
	path(d=`M${gx}${by}H${-gx}M${gx} ${-by}h${dm}v${dm}M${-bx}${gy}V${-gy}M0${gy}V0H${-gx}M${bx}${by} ${-bx} ${-by}M${-bx}${by}${bx} ${-by}`)
	path(d=`M${bx}${by}H${-bx}V${-by}H${bx}z`)
	path(d=`M${mx}${by}V${-by}M${bx} ${-my}H${-bx}M${-mx}${by}V0M${-bx}${my}H0M${-bx}${-aw}h${-aw}v${aw}M${-(bx + .5*aw)}${-.5*(sw + aw)}a${.5*sw} ${.5*sw} 0 0 1 0 ${sw}a${.5*sw} ${.5*sw} 0 0 1 0${-sw}`)

// minimal SVG
<svg viewBox='-1200 -1000 4000 2000' xmlns='http://www.w3.org/2000/svg'><style>svg{color:#333;fill:currentcolor;font:150px  consolas,monaco,ubuntu mono,monospace;text-anchor:middle;dominant-baseline:middle;word-spacing:-37px}[r]~[d],[r]{fill:none;stroke:currentcolor;stroke-width:10}[x]+[d]+[d]{fill:#ffc}[r]+*{color:#aaa;stroke-dasharray:8}[d]~[x],[d]~[r]{color:#f80;stroke-dasharray:0 1414 139 333;text-anchor:start}[r]~[x],[r]~[r]{color:#a0f;stroke-dasharray:0 776 166}[r]+*+[d]{color:#d37;stroke-width:20}</style><text x='188' y='-928'>w/2</text><text x='628' y='-375'>h/2</text><text y='928'>w</text><text x='-553'>h</text><path d='M-489-750l-30 75h60M489-750l-30 75h60M-489 750l-30-75h60M489 0l-30-75h60M375 864l-75-30v60M-375 864l75-30v60M375-864l-75-30v60M0-864l75-30v60'/><path d='M0 0h375v-750'/><text x='1200' y='-600'>β = 90° - α</text><text x='6' y='-202'>β</text><circle r='300'/><text x='1200' y='-300'>tan(α) = h/w</text><text x='1200'>α = atan(h/w)</text><text x='38' y='-49'>α</text><circle r='150'/><path d='M-563-750H563M-563 750h183v188M375-938V938M0-938V0H563M-375-750 375 750M375-750-375 750'/><path d='M-375-750H375V750H-375z'/><path d='M-489-750V750M-375 864H375M489-750V0M375-864H0M375-75h-75v75M338-43a5 5 0 0 1 0 10a5 5 0 0 1 0-10'/></svg>
              
            
!

CSS

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

JS

              
                
              
            
!
999px

Console