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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              - var vb_u = 1000;
- var na = .056*vb_u*4/7, k = .025;
- var vb_w = Math.ceil(Math.PI)*vb_u;
- var vb_h = (2*Math.cos(0) + 1)*vb_u;
- var sa = -2*Math.PI/3, ea = 5*Math.PI/6;
- var da = ea - sa, un = 12, ua = 2*Math.PI/un;
- var vb_x = -.5*vb_w - sa/da*vb_u;
- var vb_y = -.5*vb_h, fs = .056*4/7*vb_h;
- var ax_x0 = Math.round(vb_x + k*vb_w);
- var ax_y = Math.round(vb_y + 2*k*vb_h);
- var ax_x1 = Math.round(.5*vb_w - sa/da*vb_u - k*vb_w);
- var pr = Math.round(.03*4/7*vb_u);
- var pr1 = Math.round(.65*pr), ps = 2*pr;
- var ex = Math.round(da*vb_u/da);
- var ey = -Math.round(Math.sin(ea)*vb_u);
- var sy = -Math.round(Math.sin(sa)*vb_u);
- var qx0 = (Math.PI - ea)*vb_u/da;
- var qx1 = (2*Math.PI - ea)*vb_u/da;
- var mx0 = (.5*Math.PI - ea)*vb_u/da;
- var mx1 = (1.5*Math.PI - ea)*vb_u/da;
- var mx2 = (2.5*Math.PI - ea)*vb_u/da;
- var cp1 = .07*.5*Math.PI*vb_u/da;
- var cp2 = .45*.5*Math.PI*vb_u/da;
- var ss = +((Math.PI + sa)/2/Math.PI).toFixed(2);
- var se = +((Math.PI + ea)/2/Math.PI).toFixed(2);

svg(viewBox=[Math.round(vb_x), vb_y, vb_w, vb_h].join(' ')
		 xmlns='http://www.w3.org/2000/svg')
	style
		| * {
		|   vector-effect: non-scaling-stroke;
		|   font: #{fs}px consolas, monaco, monospace;
		|   letter-spacing: #{-fs/5}
		| }
		| #e [d] { fill: #333 }
		| #g + * { stroke: #ccc }
		| [x] + [d], [r] {
		|   stroke: #333;
		|   marker-end: url(#e)
		| }
		| tspan { font-style: italic }
		| [x] + [d], [r] + [d], [r] { stroke-width: 2 }
		| [d] + [d] {
		| 	fill: url(#p);
		| 	stroke: #e83;
		| 	stroke-dasharray: 8
		| }
		| #p *, [r] { fill: #e83 }
		| [r] + [d] {
		|   fill: none;
		| 	stroke-width: 4;
		| 	stroke: url(#g)
		| }
		| @supports not (vector-effect: non-scaling-stroke) {
		| 	[d][d] { stroke-width: 14; marker: none }
		| }
	marker#e(markerWidth=na markerHeight=na 
						viewBox='0 -4 8 8' 
						orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	pattern#p(width=ps height=ps patternUnits='userSpaceOnUse' patternTransform='rotate(45)')
		rect(width=ps height=Math.round(.2*ps))
	linearGradient#g
		stop(stop-color='#ccc' offset=ss)
		stop(stop-color='#a57' offset=0)
		stop(stop-color='#a57' offset=se)
		stop(stop-color='#ccc' offset=0)
	
	- var gd = [], p = [];
	- for(var i = 0; i <= un; i++) {
		- var ca = i*ua - sa - Math.PI;
		- var x = Math.round(ca/da*vb_u);
		- if(x) gd.push(`M${x}${-vb_u}V${vb_u}`);
		- if(i <= .5*un) {
			- var y = Math.round(Math.cos(i*ua)*vb_u);
			- if(y) gd.push(`M${ax_x0} ${y}H${ax_x1}`)
		- }
		- var y = Math.round(Math.sin(i*ua)*vb_u);
		- var fa = Math.round(i*ua - ea - Math.PI);
		- var ma = Math.round(i*ua - Math.PI);
		- var c = !Math.round(ca) || !fa || !ma;
		- p.push({r: c ? pr : pr1, cx: x, cy: y})
	- }
	path(d=gd.join(''))
	
	text(x=.5*fs y=(.5*fs + ax_y)) sin(<tspan>k</tspan>·(<tspan>e</tspan>-<tspan>s</tspan>)+<tspan>s</tspan>)
	path(d=`M${ax_x0} 0H${ax_x1}`)
	text(x=(ax_x1 - .5*fs) y=-.5*fs): tspan k
	path(d=`M0 ${-ax_y}V${ax_y}`)
	
	path(d=`M0${ey}H${ex}V${sy}H0z`)
	
	circle(r=pr1)
	circle(r=pr1 cy=ey)
	circle(r=pr1 cx=ex)
	circle(r=pr1 cx=Math.round(qx1))
	circle(r=pr1 cx=Math.round(qx0))
	circle(r=pr1 cy=-vb_u)
	circle(r=pr1 cy=vb_u)
	
	path(d=`M${Math.round(mx0)} 0
					C${Math.round(mx0 + cp1)} ${Math.round(cp1)}${Math.round(qx0 - cp2)} ${vb_u} ${Math.round(qx0)} ${vb_u}
					C${Math.round(qx0 + cp2)} ${vb_u} ${Math.round(mx1 - cp1)} ${Math.round(cp1)} ${Math.round(mx1)} 0
					C${Math.round(mx1 + cp1)} ${Math.round(-cp1)} ${Math.round(qx1 - cp2)} ${-vb_u} ${Math.round(qx1)} ${-vb_u}
					C${Math.round(qx1 + cp2)} ${-vb_u} ${Math.round(mx2 - cp1)} ${Math.round(-cp1)} ${Math.round(mx2)} 0`)
	
	circle(r=pr1 cx=Math.round(mx2))
	circle(r=pr1 cx=Math.round(mx0))
	circle(r=pr1 cx=Math.round(qx1) cy=-vb_u)
	circle(r=pr cx=Math.round(mx1))
	circle(r=pr1 cx=Math.round(qx0) cy=vb_u)
	circle(r=pr cy=sy)
	circle(r=pr cx=ex cy=ey)
	
	text(x=-Math.round(.7*fs) y=-Math.round(.2*fs)) 0
	text(x=-3.5*fs y=(sy + .3*fs)) sin(<tspan>s</tspan>)
	text(x=-3.5*fs y=(ey + .3*fs)) sin(<tspan>e</tspan>)
	text(x=-Math.round(1.3*fs) y=(vb_u + .9*fs)) -1
	text(x=-Math.round(.7*fs) y=(-vb_u - .2*fs)) 1
	text(x=(ex - .3*fs) y=Math.round(.9*fs)) 1

// minimal SVG
<svg viewBox='-1556 -1500 4000 3000' xmlns='http://www.w3.org/2000/svg'><style>*{vector-effect:non-scaling-stroke;font:96px consolas,monaco,monospace;letter-spacing:-19.2}#e [d]{fill:#333}#g+*{stroke:#ccc}[x]+[d],[r]{stroke:#333;marker-end:url(#e)}tspan{font-style:italic}[x]+[d],[r]+[d],[r]{stroke-width:2}[d]+[d]{fill:url(#p);stroke:#e83;stroke-dasharray:8}#p *,[r]{fill:#e83}[r]+[d]{fill:none;stroke-width:4;stroke:url(#g)}@supports not (vector-effect:non-scaling-stroke){[d][d]{stroke-width:14;marker:none}}</style><marker id='e' markerWidth='32' markerHeight='32' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><pattern id='p' width='34' height='34' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='34' height='7'/></pattern><linearGradient id='g'><stop stop-color='#ccc' offset='.17'/><stop stop-color='#a57' offset='0'/><stop stop-color='#a57' offset='.92'/><stop stop-color='#ccc' offset='0'/></linearGradient><path d='M-222-1000V1000M-1456 1000H2344M-111-1000V1000M-1456 866H2344M-1456 500H2344M111-1000V1000M222-1000V1000M-1456-500H2344M333-1000V1000M-1456-866H2344M444-1000V1000M-1456-1000H2344M556-1000V1000M667-1000V1000M778-1000V1000M889-1000V1000M1000-1000V1000M1111-1000V1000'/><text x='48' y='-1302'>sin(<tspan>k</tspan>·(<tspan>e</tspan>-<tspan>s</tspan>)+<tspan>s</tspan>)</text><path d='M-1456 0H2344'/><text x='2296' y='-48'><tspan>k</tspan></text><path d='M0 1350V-1350'/><path d='M0-500H1000V866H0z'/><circle r='11'/><circle r='11' cy='-500'/><circle r='11' cx='1000'/><circle r='11' cx='778'/><circle r='11' cx='111'/><circle r='11' cy='-1000'/><circle r='11' cy='1000'/><path d='M-222 0C-199 23-39 1000 111 1000C261 1000 421 23 444 0C468-23 628-1000 778-1000C928-1000 1088-23 1111 0'/><circle r='11' cx='1111'/><circle r='11' cx='-222'/><circle r='11' cx='778' cy='-1000'/><circle r='17' cx='444'/><circle r='11' cx='111' cy='1000'/><circle r='17' cy='866'/><circle r='17' cx='1000' cy='-500'/><text x='-67' y='-19'>0</text><text x='-336' y='894.8'>sin(<tspan>s</tspan>)</text><text x='-336' y='-471.2'>sin(<tspan>e</tspan>)</text><text x='-125' y='1086.4'>-1</text><text x='-67' y='-1019.2'>1</text><text x='971.2' y='86'>1</text></svg>
            
          
!

CSS

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

JS

            
              // minimal SVG https://codepen.io/thebabydino/pen/pWpjaJ
            
          
!
999px

Console