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.


- var f = .7, ay = f*ax;
- d *= f , fs *= f, ad *=f, sw *=f, pr *= f, pr1 *= f, pr2 *= f;

svg(viewBox=[-d, -.4*d, 2*d, hf*d].join(' ') 
		| svg {	fill: #{darken}; font: #{fs}px consolas, monaco, monospace }
		| svg > [d], [r] { fill: none; stroke: #{darken}; stroke-width: #{2*sw} }
		| [y] + [d]:not([d*=Z]) { marker-end: url(#e) }
		| [d] + [y] { font: #{fs}px times new roman, serif }
		| [d] ~ [y] { font-style: italic }
		| [d] + [d] ~ [y] { fill: #{tomato} }
		| tspan { font-size: .5em }
		| [r='#{hr}'] { stroke: #{llight} }
		| [d][d*=Z] { stroke: #{purple}; stroke-width: #{4*sw} }
		| [d] + [d] { stroke: #{orange}; stroke-width: #{3*sw} }
		| [r]:not([r='#{hr}']) { fill: #{orange} }
	marker#e(markerWidth=ad markerHeight=ad 
						viewBox='0 -4 8 8' 
						orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	//-helper circles
	circle(cx=-hrd r=hr)
	circle(cx=hrd r=hr)
	//-radius text
	text(x=(-.5*(hrd + fs)).toFixed(e) y=(-(.5*hrd + .2*fs)).toFixed(e)) R
	text(x=(.5*(hrd - .2*fs)).toFixed(e) y=(-(.5*hrd + .2*fs)).toFixed(e)) R
	text(x=(.5*(-3*hrd - fs)).toFixed(e) y=(.5*hrd - .2*fs).toFixed(e)) R
	text(x=(.5*(3*hrd - .2*fs)).toFixed(e) y=(.5*hrd - .2*fs).toFixed(e)) R
	text(x=(-(hrd + 1.6*fs)).toFixed(e) y=(2*hrd + .8*fs).toFixed(e)) 2·R
	text(x=(.5*(2*hrd - .2*fs)).toFixed(e) y=(2*hrd + .8*fs).toFixed(e)) 2·R
	text(y=-(hrd + .4*fs)) (0,-R/√2)
	text(x=(2*hrd + .6*fs) y=(hrd + fs)) (R·√2,R/√2)
	text(x=-(2*hrd + 6.2*fs) y=(hrd + fs)) (-R·√2,R/√2)
	text(y=-.2*fs) (0,0)
	text(y=(3*hrd + .8*fs)) (0,3·R/√2)
	path(d=`M${-ax} 0H${ax}`)
	text(x=(ax - .5*fs).toFixed(e) y=(-.5*fs).toFixed(e)) x
	path(d=`M0${(-.75*ay).toFixed(e)}V${Math.round((hf + .5)*ay)}`)
	text(x=.4*fs y=Math.round((hf + .5)*ay - .2*fs)) y
	path(d=`M0${-hrd} ${2*hrd} ${hrd} 0 ${3*hrd}${-2*hrd} ${hrd}Z`)
	path(d=`M0${-hrd}V${3*hrd}M${-2*hrd} ${hrd}H${2*hrd}`)
	circle(cx=-hrd r=pr2.toFixed(e))
	circle(cx=hrd r=pr2.toFixed(e))
	circle(cy=-hrd r=pr.toFixed(e))
	circle(cy=3*hrd r=pr1.toFixed(e))
	circle(cy=hrd r=pr2.toFixed(e))
	circle(cx=-2*hrd cy=hrd r=pr.toFixed(e))
	circle(cx=2*hrd cy=hrd r=pr.toFixed(e))
	//-point names
	text(x=(-.7*fs).toFixed(e) y=-(hrd + .4*fs)) T
	text(x=(-.7*fs).toFixed(e) y=(-.2*fs)) O
	text(x=hrd - .4*fs y=fs) O<tspan>0</tspan>
	text(x=-(hrd + .4*fs) y=fs) O<tspan>1</tspan>
	text(x=2*hrd - .2*fs y=(hrd + fs)) B<tspan>0</tspan>
	text(x=-(2*hrd + 7*fs) y=(hrd + fs)) B<tspan>1</tspan>
	text(x=(-.7*fs).toFixed(e) y=(3*hrd + .8*fs)) C

// minimal SVG
<svg viewBox='-1750 -700 3500 2363' xmlns='http://www.w3.org/2000/svg'><style>svg{fill:#333;font:105px consolas,monaco,monospace}svg>[d],[r]{fill:none;stroke:#333;stroke-width:7}[y]+[d]:not([d*=Z]){marker-end:url(#e)}[d]+[y]{font:105px times new roman,serif}[d]~[y]{font-style:italic}[d]+[d]~[y]{fill:#b53}tspan{font-size:.5em}[r='625']{stroke:#ccc}[d][d*=Z]{stroke:#95a;stroke-width:14}[d]+[d]{stroke:#f90;stroke-width:10}[r]:not([r='625']){fill:#f90}</style><marker id='e' markerWidth='7' markerHeight='7' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><circle cx='-442' r='625'/><circle cx='442' r='625'/><text x='-274' y='-242'>R</text><text x='211' y='-242'>R</text><text x='-716' y='200'>R</text><text x='653' y='200'>R</text><text x='-610' y='968'>2·R</text><text x='432' y='968'>2·R</text><text y='-484'>(0,-R/√2)</text><text x='947' y='547'>(R·√2,R/√2)</text><text x='-1535' y='547'>(-R·√2,R/√2)</text><text y='-21'>(0,0)</text><text y='1410'>(0,3·R/√2)</text><path d='M-1230 0H1230'/><text x='1178' y='-53'>x</text><path d='M0-646V1593'/><text x='42' y='1572'>y</text><path d='M0-442 884 442 0 1326-884 442Z'/><path d='M0-442V1326M-884 442H884'/><circle r='9'/><circle cx='-442' r='9'/><circle cx='442' r='9'/><circle cy='-442' r='18'/><circle cy='1326' r='13'/><circle cy='442' r='9'/><circle cx='-884' cy='442' r='18'/><circle cx='884' cy='442' r='18'/><text x='-74' y='-484'>T</text><text x='-74' y='-21'>O</text><text x='400' y='105'>O<tspan>0</tspan></text><text x='-484' y='105'>O<tspan>1</tspan></text><text x='863' y='547'>B<tspan>0</tspan></text><text x='-1619' y='547'>B<tspan>1</tspan></text><text x='-74' y='1410'>C</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/LzazXP?editors=1000
🕑 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 ..................