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 d = 2000;
- var w = .5*d, h = .1*w;
- var o = .5*w, b = .1*d;
- var m = 1.5*b, q = .7*b;
- var sw = .005*d, fs = .07*d;
- var na = Math.round(.0625*fs);
- var pa = .25*h;
- var r = .5*d - o;

svg(viewBox=[-.93*d, -.5*d, 2*d, d].join(' ')
		xmlns='http://www.w3.org/2000/svg' 
		xmlns:xlink='http://www.w3.org/1999/xlink')
	path(d=`M${-(.5*d + o)}${-o}H${-r}V${o}h${-w}
					M${r}${-o}h${w}V${o}H${r}`)
	path(d=`M${-(.5*d + o)}${-o}H${-r}v${h}h${-w}
					M${.5*d + o - h}${-o}h${h}V${o}h${-h}`)
	text(x=-(.5*d + o + 2.5*fs) y=-(o - .8*fs)) MIN
	text(x=(.5*d + o - 1.7*fs) y=(o + fs)) MIN
	text(x=(o - .5*d + .2*fs) y=-(o - .8*fs)) MAX
	text(x=(.5*d + o - 1.7*fs) y=-(o + .2*fs)) MAX
	text(x=-(.5*d + 1.3*fs) y=-(o + 1.75*h)) slider
	text(x=(.5*d + o + 1.75*h) y=.25*fs) slider
	pattern#p(width=pa height=pa 
						patternUnits='userSpaceOnUse')
		path(d=`M0 0l${pa} ${pa}`)
	path(d=`M${-.5*d}${-(o + 1.5*h)}v${1.25*h}
					M${-(.5*d + .3*h)}${-(o + .5*h)}
					q${.3*h} ${.8*h} ${.6*h} 0
					M${.5*d + o + .25*h} 0h${1.5*h}
					M${.5*d + o + .5*h} ${(-.3*h)}
					q${-.8*h} ${.3*h} 0 ${.6*h}`)
	style
		| [d] { fill: #ccc }
		| [d] ~ * { fill: #95a }
		| [d] + [d] { fill: url(#p) }
		| [x] ~ [d], #p * {
		| 	fill: none; 
		| 	stroke: #333;
		| 	stroke-width: #{sw}
		| }
		| #p *, #p + * { stroke: #95a }
		| * { font: #{fs}px comic sans ms, noteworthy, dancing script ot, ubuntu, cursive }
		| style ~ [x] { fill: #333 }
		| [x] + [d] ~ [x] { fill: #aaa; font-family: trebuchet ms, verdana, arial, sans-serif }
		| #a { stroke: #b53 }
		| #a + * { fill: #b53; letter-spacing: #{.1*fs}px }
	text(x=-(.5*d + o + .8*fs) y=(2*fs - .5*d)) left
	text(x=(-r - fs) y=(2*fs - .5*d)) right
	text(x=(.5*d + o + 1.75*h) y=(.3*fs - o)) top
	text(x=(.5*d + o + 1.75*h) y=(o + .3*fs)) bottom
	path(d=`M${-(.5*d + o)}${-(o + 1.75*h)}v${1.5*h}
					M${-(.5*d + o + .3*h)}${-(o + .5*h)}
					q${.3*h} ${.8*h} ${.6*h} 0
					M${-(r)}${-(o + 1.75*h)}v${1.5*h}
					M${-(r + .3*h)}${-(o + .5*h)}
					q${.3*h} ${.8*h} ${.6*h} 0
					M${.5*d + o + .25*h}${-o}h${1.5*h}
					M${.5*d + o + .5*h}${-(o + .3*h)}
					q${-.8*h} ${.3*h} 0 ${.6*h}
					M${.5*d + o + .25*h} ${o}h${1.5*h}
					M${.5*d + o + .5*h} ${(o - .3*h)}
					q${-.8*h} ${.3*h} 0 ${.6*h}`)
	path#a(d=`M${-.5*r} ${-.5*r}
					a${r} ${r} 0 0 0 ${r} ${r}
					M${.5*r - .5*h} ${.5*r - .3*h}
					q${1.5*h} ${.3*h} 0 ${.6*h}`)
	text(x=.2*fs dy=-.4*fs)
		textPath(xlink:href='#a') rotate(-)
	text(x=-(.5*d + 2*fs) y=(.5*d - .2*fs)) INITIAL
	text(x=(.5*d - 2*fs) y=(.5*d - .2*fs)) FINAL

// minimal SVG
<svg viewBox='-1860 -1000 4000 2000' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><path d='M-1500-500H-500V500h-1000M500-500h1000V500H500'/><path d='M-1500-500H-500v100h-1000M1400-500h100V500h-100'/><text x='-1850' y='-388'>MIN</text><text x='1262' y='640'>MIN</text><text x='-472' y='-388'>MAX</text><text x='1262' y='-528'>MAX</text><text x='-1182' y='-675'>slider</text><text x='1675' y='35'>slider</text><pattern id='p' width='25' height='25' patternUnits='userSpaceOnUse'><path d='M0 0l25 25'/></pattern><path d='M-1000-650v125M-1030-550q30 80 60 0M1525 0h150M1550-30q-80 30 0 60'/><style>[d]{fill:#ccc}[d]~*{fill:#95a}[d]+[d]{fill:url(#p)}[x]~[d],#p *{fill:none;stroke:#333;stroke-width:10}#p *,#p+*{stroke:#95a}*{font:140px comic sans ms,noteworthy,dancing script ot,ubuntu,cursive}style~[x]{fill:#333}[x]+[d]~[x]{fill:#aaa;font-family:trebuchet ms,verdana,arial,sans-serif}#a{stroke:#b53}#a+*{fill:#b53;letter-spacing:14px}</style><text x='-1612' y='-720'>left</text><text x='-640' y='-720'>right</text><text x='1675' y='-458'>top</text><text x='1675' y='542'>bottom</text><path d='M-1500-675v150M-1530-550q30 80 60 0M-500-675v150M-530-550q30 80 60 0M1525-500h150M1550-530q-80 30 0 60M1525 500h150M1550 470q-80 30 0 60'/><path id='a' d='M-250-250a500 500 0 0 0 500 500M200 220q150 30 0 60'/><text x='28' dy='-56'><textPath xlink:href='#a'>rotate(-)</textPath></text><text x='-1280' y='972'>INITIAL</text><text x='720' y='972'>FINAL</text></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