JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.

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

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 d = 2000, o = -.5*d;
- var r = .2*d, n = 6;
- var ba = 2*Math.PI/6;
- var sw = ~~(.008*r), rs = 4*sw;
- var fs = .035*d, a = [];
- var na = ~~(.15*fs), f = 2.25, k = .8;
- var ha = .5*ba, qa = .25*ba;
- var y0 = -Math.round(r*Math.cos(ha));
- var y1 = -Math.round(r*Math.sin(ha));
- var x2 = Math.round(r*Math.cos(qa));
- var y2 = -Math.round(r*Math.sin(qa));
svg(viewBox=[o, .9*o, d, .5*d].join(' ') xmlns='http://www.w3.org/2000/svg')
style
| * { fill: none }
| [x] {
| fill: #95a;
| font: 700 #{fs}px courier new, monospace
| }
| svg > [d], [r] {
| stroke: #ccc;
| stroke-width: #{Math.round(1.4*sw)}
| }
| #e + * { fill: rgba(255, 238, 68, .5) }
| [d*=A] + [d] { stroke: #95a }
| [r='#{r}'] { stroke-dasharray: #{+(Math.PI*r/100).toFixed(2)} }
| [cy='#{y0}'] { stroke: #f90 }
| #e *, [d] + [x] {
| fill: #ccc;
| font: italic #{fs}px times new roman, serif
| }
| [x] + [d] { marker-end: url(#e) }
| [x] ~ [r] { fill: #95a }
- for(var i = 0; i < n; i++) {
- var ca = (i + 1)*ba;
- var x = Math.round(r*Math.cos(ca));
- var y = Math.round(r*Math.sin(ca));
- a.push([Math.round(f*x), Math.round(f*y)]);
circle(r=r cx=x cy=((y != 0) ? y : null))
- }
- var cx = Math.round(a[n-2][0]/f), cy = Math.round(a[n-2][1]/f);
- var r1 = k*r;
- var x = Math.round(k*cx), y = Math.round(k*cy);
marker#e(markerWidth=na markerHeight=na
viewBox='0 -4 8 8' orient='auto' refX='7')
path(d='M8 0 0-4V4')
path(d=`M${x} ${y}A${r1} ${r1} 0 0 0 0 ${-r1}V0
M${-k*x} ${Math.round(k*y)}A${k*r1} ${k*r1} 0 0 1 0 ${-k*r1}V0
M${k*x} ${Math.round(k*y)}A${k*r1} ${k*r1} 0 0 1 ${k*r1} 0H0`)
path(d=`M${x} ${y}A${r1} ${r1} 0 0 0 0 ${-r1}
M${-k*x} ${Math.round(k*y)}A${k*r1} ${k*r1} 0 0 1 0 ${-k*r1}
M${k*x} ${Math.round(k*y)}A${k*r1} ${k*r1} 0 0 1 ${k*r1} 0`)
text(x=2.25*r y=-.5*fs) x
path(d=`M0${-2*r}V${2*r}M0 0H${2.25*r}`)
path(d=`M${a[n - 2]}L0,0L${a[n - 3]}`)
circle(r=rs cx=cx cy=cy)
circle(r=rs cx=-cx cy=cy)
circle(r=.75*rs)
text(x=Math.round(.25*fs - k*k*y0) y=Math.round(k*k*y1)) ba
text(x=-Math.round(k*y2 + .375*fs) y=-Math.round(k*x2 + .25*fs)) ha
text(x=Math.round(k*k*y2 - .75*fs) y=-Math.round(k*k*x2 + .25*fs)) ha
text(x=o + fs y=o + 3*fs) ha = ba/2
// minimal SVG:
<svg viewBox='-1000 -900 2000 1000' xmlns='http://www.w3.org/2000/svg'><style>*{fill:none}[x]{fill:#95a;font:700 70px courier new,monospace}svg>[d],[r]{stroke:#ccc;stroke-width:4}#e+*{fill:rgba(255,238,68,.5)}[d*=A]+[d]{stroke:#95a}[r='400']{stroke-dasharray:12.57}[cy='-346']{stroke:#f90}#e *,[d]+[x]{fill:#ccc;font:italic 70px times new roman,serif}[x]+[d]{marker-end:url(#e)}[x]~[r]{fill:#95a}</style><circle r='400' cx='200' cy='346'/><circle r='400' cx='-200' cy='346'/><circle r='400' cx='-400'/><circle r='400' cx='-200' cy='-346'/><circle r='400' cx='200' cy='-346'/><circle r='400' cx='400'/><marker id='e' markerWidth='10' markerHeight='10' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><path d='M160-277A320 320 0 0 0 0-320V0M-128-222A256 256 0 0 1 0-256V0M128-222A256 256 0 0 1 256 0H0'/><path d='M160-277A320 320 0 0 0 0-320M-128-222A256 256 0 0 1 0-256M128-222A256 256 0 0 1 256 0'/><text x='900' y='-35'>x</text><path d='M0-800V800M0 0H900'/><path d='M450-778L0 0L-450-778'/><circle r='12' cx='200' cy='-346'/><circle r='12' cx='-200' cy='-346'/><circle r='9'/><text x='239' y='-128'>ba</text><text x='57' y='-326'>ha</text><text x='-119' y='-265'>ha</text><text x='-930' y='-790'>ha = ba/2</text></svg>
```

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

999px

Shift F
Opt F
Find & Replace

Also see: Tab Triggers