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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

              <canvas id="canvas" width="1500" height="800">
              body {
canvas {
  border:1px solid black;
              const cdims = {height:800, width:1500};
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');

ctx.fillRect(0,0, cdims.width, cdims.height);

function drawCircle(x, y, r) {
  ctx.arc(x, y, r, 0, 2*Math.PI);
function random_range(min, max) {
  return Math.random()*(max-min)+min;

function makeSplat(startx, starty) {

  let image_scale = Math.random()*0.66+0.33;

  let moveDir = Math.random()*360;
  let moveSpd = random_range(3, 12);
  //let fric = random_range(moveSpd/8, moveSpd/2);

  let sizeChange = random_range(image_scale/10, image_scale/3);

  let destroyed = false;
  let x = startx; 
  let y = starty;
  ctx.globalAlpha = 0.6;
  let startRadius = random_range(10, 20);
  while(!destroyed) {
    drawCircle(x, y, startRadius*image_scale);


    if(moveSpd>0) {
      ctx.globalAlpha -= random_range(0.05, 0.1);



    if(image_scale<0) {
      destroyed = true;

function makeSplatter(x, y) {
  ctx.fillStyle = `hsl(${Math.random()*360}, 70%, 50%)`;
  let bound = random_range(4, 12);
  for(let i=0; i<bound; i++) {
    makeSplat(x+Math.random()*16, y+Math.random()*16);

$('canvas').click(function(e) {
  var ex = event.pageX-$(this).offset().left;
  var ey = event.pageY-$(this).offset().top;
  makeSplatter(ex, ey);

for(var i=0; i<10; i++) {
  makeSplatter(Math.random()*cdims.width, Math.random()*cdims.height);
Loading ..................