css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              - var h = 2000, w = 2*h;
- var x = -.5*w, y = -.5*h;
- var d = .25*h, r = .5*d, r0 = Math.round(.03*r);
- var bw = 4*d, bh = .65*d;
- var bx = .5*(bw + .5*d);
- var bf = .4;
- var by = .5*bh - bf*y;
- var sw = .004*h;
- var fs = Math.round(.075*h);
- var na = Math.round(.05*fs);

svg(viewBox=[x, y, w, h].join(' ') 
		xmlns='http://www.w3.org/2000/svg')
	style
		| * { font: #{fs}px segoe script, comic sans ms, cursive }
		| [x] ~ * {
		| 	stroke-width: #{sw};
		| 	font: #{fs}px consolas, monaco, monospace
		| }
		| [x] + [d] { stroke: #ccc; fill: none }
		| [d] + [d] {
		| 	stroke: #333;
		| 	marker-start: url(#s);
		| 	marker-end: url(#e)
		| }
		| rect, [r] { fill: none; stroke: #f90 }
		| [r='#{r}'] { stroke: #b5a }
		| rect ~ [r] { stroke: #b53 }
	marker#s(markerWidth=na markerHeight=na 
						viewBox='-8 -4 8 8' orient='auto' refX='-7')
		path(d='M-8 0 0-4V4')
	marker#e(markerWidth=na markerHeight=na 
					 viewBox='0 -4 8 8' orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	text(x=-.5*(bx + 2*r) y=y + fs) assembly always
		tspan(dx=-8.5*fs dy=fs) middle aligned
	text(x=bx - r - .3*fs y=bf*y - 1.5*r) r
	text(x=bx - .3*fs y=bf*y - 1.5*r) r
	text(x=bx - 1.5*r - .3*fs y=-(bf*y + 1.5*r)) r
	text(x=bx - r - .3*fs y=.7*fs - (bf*y - 1.5*r)) d
	text(x=x + .5*fs y=Math.round(fs - by)) initial
	text(x=x + .5*fs y=Math.round(2*fs - by)) state
	text(x=x + .5*fs y=Math.round(by - bh + fs)) overlap
	text(x=x + .5*fs y=Math.round(by - bh + 2*fs)) state
	path(d=`M${bx + .5*r} ${bf*y - 1.5*r}v${2*r}
					M${bx - .5*r} ${bf*y - 1.5*r}v${2*r}
					M${bx - 1.5*r} ${bf*y - 1.5*r}v${2*r}
					M${bx - r} ${-bf*y}v${-1.5*r}
					M${bx} ${-bf*y}v${1.5*r}
					M${bx - d} ${-bf*y- 1.5*r}v${3*r}
					M0 ${.65*y}v${-1.3*y}`)
	path(d=`M${bx - 1.5*r} ${Math.round(bf*y - 1.25*r)}h${r}`)
	path(d=`M${bx - .5*r} ${Math.round(bf*y - 1.25*r)}h${r}`)
	path(d=`M${bx - d} ${-Math.round(bf*y + 1.25*r)}h${r}`)
	path(d=`M${bx - d} ${-Math.round(bf*y - 1.25*r)}h${d}`)
	circle(cx=bx - .5*r cy=bf*y r=r)
	circle(cx=bx - r cy=-bf*y r=r)
	rect(x=-bx - .5*r y=Math.round(-by) width=bw height=bh)
	rect(x=-bx y=Math.round(by - bh) width=bw height=bh)
	circle(cx=bx - .5*r cy=bf*y r=r0)
	circle(cx=bx - r cy=-bf*y r=r0)
	circle(cx=bx + .5*r cy=bf*y r=r0)
	circle(cx=bx cy=-bf*y r=r0)
	circle(cx=bx - 1.5*r cy=bf*y r=r0)
	circle(cx=bx - 2*r cy=-bf*y r=r0)

<svg viewBox='-2000 -1000 4000 2000' xmlns='http://www.w3.org/2000/svg'><style>*{font:150px segoe script,comic sans ms,cursive}[x]~*{stroke-width:8;font:150px consolas,monaco,monospace}[x]+[d]{stroke:#ccc;fill:none}[d]+[d]{stroke:#333;marker-start:url(#s);marker-end:url(#e)}rect,[r]{fill:none;stroke:#f90}[r='250']{stroke:#b5a}rect~[r]{stroke:#b53}</style><marker id='s' markerWidth='8' markerHeight='8' viewBox='-8 -4 8 8' orient='auto' refX='-7'><path d='M-8 0 0-4V4'/></marker><marker id='e' markerWidth='8' markerHeight='8' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><text x='-812.5' y='-850'>assembly always<tspan dx='-1275' dy='150'>middle aligned</tspan></text><text x='830' y='-775'>r</text><text x='1080' y='-775'>r</text><text x='705' y='25'>r</text><text x='830' y='880'>d</text><path d='M1250-775v500M1000-775v500M750-775v500M875 400v-375M1125 400v375M625 25v750M0-650v1300'/><path d='M750-712.5h250'/><path d='M1000-712.5h250'/><path d='M625 87.5h250'/><path d='M625 712.5h500'/><circle cx='1000' cy='-400' r='250'/><circle cx='875' cy='400' r='250'/><rect x='-1250' y='-562.5' width='2000' height='325'/><rect x='-1125' y='237.5' width='2000' height='325'/><circle cx='1000' cy='-400' r='7.5'/><circle cx='875' cy='400' r='7.5'/><circle cx='1250' cy='-400' r='7.5'/><circle cx='1125' cy='400' r='7.5'/><circle cx='750' cy='-400' r='7.5'/><circle cx='625' cy='400' r='7.5'/></svg>
            
          
!
            
              body {
	display: flex;
	flex-direction: column;
	margin: 0;
	height: 100vh;
}
            
          
!
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