Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                - var vb_u = 1000, na = .05*vb_u, k = .05, fs = .12*vb_u;
- var vb_h = Math.round((2*Math.cos(0) + 1)*vb_u);
- var vb_w = Math.round(vb_h/.6);
- var vb_x = -(.5*vb_w - vb_u), vb_y = -.5*vb_h;
- var ax_x0 = vb_x + k*vb_w, ax_x1 = (.5 - k)*vb_w + vb_u;
- var ax_y = (1 - k)*vb_y;
- var ng = 6, ix = .5*ng + 1, gux = vb_u/ix, guy = .5*vb_u;
- var px = Math.round(ix*gux), a = ix*Math.PI/ng;
- var py = Math.round(Math.sin(a)*vb_u), mx = .5*ng*gux;
- var cp1 = Math.round(.17*mx), cp2 = Math.round(.55*mx);
- var cp3 = 2*mx - cp2, cp4 = 2*mx - cp1/a;
- var pr = .021*vb_u, ps = 2*pr, pr1 = Math.round(.65*pr);

svg(viewBox=[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 }
		| [r] + [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='#b53' offset=(ix/ng).toFixed(2))
		stop(stop-color='#ccc' offset=0)
	
	- var gd = [];
	- for(var i = 0; i < ng; i++) {
		- gd.push(`M${Math.round((i + 1)*gux)}${-vb_u}V${vb_u}`);
		- if(i < 4) gd.push(`M0 ${(~~(.5*i) + 1)*Math.pow(-1, i%2)*guy}H${2*vb_u}`);
	- }
	path(d=gd.join(''))
	
	text(x=.5*fs y=(.5*fs + ax_y)) sin(<tspan>k·e</tspan>)
	path(d=`M0 ${-ax_y}V${ax_y}`)
	text(x=(ax_x1 - .5*fs) y=-.5*fs): tspan k
	path(d=`M${ax_x0} 0H${ax_x1}`)
	
	circle(r=pr1 cy=-vb_u)
	text(x=-.8*fs y=Math.round(.9*fs)) 0
	circle(r=pr1 cy=vb_u)
	
	path(d=`M${px}${-py}H0V0H${px}z`)
	path(d=`M0 0C${Math.round(cp1/a)} ${-cp1} ${cp2} ${-vb_u} ${mx} ${-vb_u}C${cp3} ${-vb_u} ${Math.round(cp4)} ${-cp1} ${2*mx} 0`)
	
	circle(r=pr1 cx=vb_u)
	circle(r=pr1 cx=mx cy=-vb_u)
	circle(r=pr1 cx=mx)
	circle(r=pr1 cx=px)
	circle(r=pr1 cy=-py)
	circle(r=pr1 cx=2*mx)
	circle(r=pr)
	circle(r=pr cx=px cy=-py)
	
	text(x=-3.5*fs y=Math.round(.25*fs - py)) sin(<tspan>e</tspan>)
	text(x=-1.3*fs y=Math.round(.25*fs + vb_u)) -1
	text(x=-.8*fs y=Math.round(.25*fs - vb_u)) 1
	text(x=Math.round(vb_u - .3*fs) y=Math.round(.9*fs)) 1

// minimal SVG
<svg viewBox='-1500 -1500 5000 3000' xmlns='http://www.w3.org/2000/svg'><style>*{vector-effect:non-scaling-stroke;font:120px consolas,monaco,monospace;letter-spacing:-24}#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}[r]+[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='50' markerHeight='50' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><pattern id='p' width='42' height='42' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='42' height='8'/></pattern><linearGradient id='g'><stop stop-color='#b53' offset='.67'/><stop stop-color='#ccc' offset='0'/></linearGradient><path d='M250-1000V1000M0 500H2000M500-1000V1000M0-500H2000M750-1000V1000M0 1000H2000M1000-1000V1000M0-1000H2000M1250-1000V1000M1500-1000V1000'/><text x='60' y='-1365'>sin(<tspan>k·e</tspan>)</text><path d='M0 1425V-1425'/><text x='3190' y='-60'><tspan>k</tspan></text><path d='M-1250 0H3250'/><circle r='14' cy='-1000'/><text x='-96' y='108'>0</text><circle r='14' cy='1000'/><path d='M1000-866H0V0H1000z'/><path d='M0 0C61-128 413-1000 750-1000C1087-1000 1439-128 1500 0'/><circle r='14' cx='1000'/><circle r='14' cx='750' cy='-1000'/><circle r='14' cx='750'/><circle r='14' cx='1000'/><circle r='14' cy='-866'/><circle r='14' cx='1500'/><circle r='21'/><circle r='21' cx='1000' cy='-866'/><text x='-420' y='-836'>sin(<tspan>e</tspan>)</text><text x='-156' y='1030'>-1</text><text x='-96' y='-970'>1</text><text x='964' y='108'>1</text></svg>
              
            
!

CSS

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

JS

              
                // minimal SVG https://codepen.io/thebabydino/pen/JyzOxq?editors=1000
              
            
!
999px

Console