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.

` ````
<canvas id=a width=600 height=600>
```

` ````
canvas { margin: 100px 0 0;}
```

` ````
c = a.getContext("2d");
camx = 0;
camy = 0;
camz = -10;
camYaw = 10;
camPitch = 15;
camRoll = 25;
w=a.width/2;
h=a.height/2;
perspective = 500;
rotate = (a, b, angle) => [
Math.cos(angle) * a - Math.sin(angle) * b,
Math.sin(angle) * a + Math.cos(angle) * b
];
setInterval(
()=>{
a.width = a.width;
camPitch += .01;
camYaw += .01;
camRoll += .01;
points = [];
for(i=0;i<3;i+=1){
for(j=0;j<3;j+=1){
for(k=0;k<3;k+=1){
x = (i - 1)*2;
y = (j - 1)*2;
z = (k - 1)*2;
[x,z] = rotate(x,z,camYaw);
[y,z] = rotate(y,z,camPitch);
[x,y] = rotate(x,y,camRoll);
x -= camx;
y -= camy;
z -= camz;
color = "hsl(" + i+(j*10)+(k*100) + ",50%,50%)";
points.push({x, y, z, color});
}
}
}
points.sort((a,b) => b.z - a.z);
for(i in points){
x = points[i].x;
y = points[i].y;
z = points[i].z;
color = points[i].color;
realSize = 0.5;
size = realSize / z * perspective;
if(z > 0){
X = w + x / z * perspective;
Y = h + y / z * perspective;
c.beginPath();
c.arc(X,Y,size,0,2*Math.PI);
c.fillStyle = color;
c.fill();
}
}
}
,16
)
```

999px

Shift F
Opt F
Find & Replace

Also see: Tab Triggers