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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.


- var o = -.5*d, f = .1;
- var vb_y = -2*f*d, vb_x = o + vb_y;
- var r = Math.round(.75*(1 - 2*f)*d), rd = Math.round(r/Math.sqrt(2));

svg(viewBox=[vb_x, vb_y, 2*d, d].join(' ') 
		| * { fill: #{darken}; stroke-linecap: round; font: #{fs}px consolas, monaco, monospace }
		| [d], [r] { fill: none; stroke: #{darken}; stroke-width: #{3*sw} }
		| [d] + [d] { fill: #{golden}; stroke: #{purple} }
		| [x] + [d] { stroke: #{tomato}; stroke-width: #{4*sw} }
		| [r] { fill: #{orange} }
	//-axes + helper lines
	path(d=`M${r} 0V${r}H0M${r - 2*ram} ${r}v${-2*ram}h${2*ram}M${r - ram} ${r - ram}h1`)
	path(d=`M${r} 0 H0V${r}`)
	//-edge lengths
	text(x=.5*(r - fs) y=(-.2*fs)) l
	text(x=.5*(r - fs) y=(r + .8*fs)) l
	text(x=-.8*fs y=.5*(r + .8*fs)) l
	text(x=(r + .2*fs) y=.5*(r + .8*fs)) l
	text(x=.5*(r + .8*fs) y=.5*(r + .8*fs)) d
	//-last edge
	path(d=`M${r} 0 0 ${r}`)
	//-perpendicularity sign for highlighted triangle
	path(d=`M${2*ram} 0V${2*ram}H0M${ram} ${ram}h1`)
	//-vertex points
	circle(cx=r r=pr)
	circle(cy=r r=pr)

// minimal SVG
<svg viewBox='-1750 -500 5000 2500' xmlns='http://www.w3.org/2000/svg'><style>*{fill:#333;stroke-linecap:round;font:150px consolas,monaco,monospace}[d],[r]{fill:none;stroke:#333;stroke-width:15}[d]+[d]{fill:#fe9;stroke:#95a}[x]+[d]{stroke:#b53;stroke-width:20}[r]{fill:#f90}</style><path d='M1500 0V1500H0M1340 1500v-160h160M1420 1420h1'/><path d='M1500 0 H0V1500'/><text x='675' y='-30'>l</text><text x='675' y='1620'>l</text><text x='-120' y='810'>l</text><text x='1530' y='810'>l</text><text x='810' y='810'>d</text><path d='M1500 0 0 1500'/><path d='M160 0V160H0M80 80h1'/><circle r='25'/><circle cx='1500' r='25'/><circle cy='1500' r='25'/></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/yzZxro?editors=1000
Loading ..................