Etch-a-Sketch style sketch

In this example below you will see how to do a Etch-a-Sketch style sketch with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by AyeAyeHayden, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright AyeAyeHayden ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Etch-a-Sketch style sketch</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <canvas id="display"></canvas>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/AyeAyeHayden/etch-a-sketch-style-sketch-dGyzpa */
body {
  margin: 0;
  padding: 0;
}

canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/183082/black-texture.png);
  background-size: 100%;
}

/*Downloaded from https://www.codeseek.co/AyeAyeHayden/etch-a-sketch-style-sketch-dGyzpa */
(function() {
  //############### Globals ######################
  //##############################################
  var addOrbs, animate, canvas, color, colorScanner, ctx, erase, h, moveFrame, orb, orbCount, orbSize, orbs, resizeCanvas, sizeFactor, w;

  canvas = document.getElementById("display");

  ctx = canvas.getContext("2d");

  w = canvas.width;

  h = canvas.height;

  orbCount = 100;

  orbSize = 10;

  sizeFactor = 200;

  orbs = [];

  color = {};

  moveFrame = parseInt(Math.random() * 300) + 50;

  //############### Classes ######################
  //##############################################
  orb = class orb {
    constructor(w, h) {
      this.x = Math.random() * (w - orbSize) + orbSize / 2;
      this.y = Math.random() * (h - orbSize) + orbSize / 2;
      this.x2 = this.x;
      this.y2 = this.y;
      this.moveFrame = parseInt(Math.random() * 300) + 50;
      this.currentFrame = 0;
      this.isMoving = parseInt(Math.random() * 2);
    }

    update() {
      var dx, dy;
      if (!this.isMoving) {
        this.currentFrame++;
        if (this.currentFrame === this.moveFrame) {
          this.x2 = Math.random() * (w - orbSize) + orbSize / 2;
          this.y2 = Math.random() * (h - orbSize) + orbSize / 2;
          this.moveFrame = parseInt(Math.random() * 300) + 50;
          this.currentFrame = 0;
          return this.isMoving = true;
        }
      } else {
        dx = this.x2 - this.x;
        dy = this.y2 - this.y;
        console.log(`${this.isMoving}\t${this.x},${this.y}\t${this.x2},${this.y2}\t${dx}, ${dy}`);
        if (Math.abs(dx) >= 1) {
          return this.x += Math.sign(dx);
        } else if (Math.abs(dy) >= 1) {
          return this.y += Math.sign(dy);
        } else {
          return this.isMoving = false;
        }
      }
    }

    render() {
      if (this.isMoving) {
        ctx.beginPath();
        ctx.arc(this.x, this.y, orbSize / 2, 0, Math.PI * 2, false);
        ctx.fill();
        //ctx.stroke()
        return ctx.closePath();
      }
    }

  };

  colorScanner = class colorScanner {
    constructor() {
      this.r = parseInt(Math.random() * 255);
      this.g = parseInt(Math.random() * 255);
      this.b = parseInt(Math.random() * 255);
      this.dr = this.r < 125;
      this.dg = this.g < 125;
      this.db = this.b < 125;
      this.a = .1;
      ctx.fillStyle = `rgba(${this.r},${this.g},${this.g},${this.a})`;
      ctx.strokeStyle = `rgba(${this.r},${this.g},${this.g},${this.a})`;
    }

    updateColors() {
      var ref, ref1, ref2;
      this.r += this.dr;
      if (!((0 < (ref = this.r) && ref < 255))) {
        this.dr *= -1;
      }
      this.g += this.dg;
      if (!((0 < (ref1 = this.g) && ref1 < 255))) {
        this.dg *= -1;
      }
      this.b += this.db;
      if (!((0 < (ref2 = this.b) && ref2 < 255))) {
        this.db *= -1;
      }
      ctx.fillStyle = `rgba(${this.r},${this.g},${this.g},${this.a})`;
      return ctx.strokeStyle = `rgba(${this.r},${this.g},${this.g},${this.a})`;
    }

  };

  
  //################### Helpers #################
  //#############################################
  resizeCanvas = function() {
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;
    w = canvas.width;
    h = canvas.height;
    orbSize = parseInt(Math.min(w, h) / sizeFactor);
    return addOrbs();
  };

  addOrbs = function() {
    var i, o, ref, results;
    orbs = [];
    results = [];
    for (o = i = 0, ref = orbCount; (0 <= ref ? i < ref : i > ref); o = 0 <= ref ? ++i : --i) {
      o = new orb(w, h);
      results.push(orbs.push(o));
    }
    return results;
  };

  erase = function() {
    ctx.fillStyle = "rgba(0, 0, 0, .05)";
    return ctx.fillRect(0, 0, w, h);
  };

  //################### Main ####################
  //#############################################
  window.onload = function() {
    addEventListener('resize', resizeCanvas, true);
    resizeCanvas(); // also adds initial orbs
    color = new colorScanner;
    return animate();
  };

  animate = function() {
    var i, len, o;
    //erase()
    color.updateColors();
    for (i = 0, len = orbs.length; i < len; i++) {
      o = orbs[i];
      o.update();
      o.render();
    }
    return window.requestAnimationFrame(animate);
  };

}).call(this);

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiPGFub255bW91cz4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFBQTs7QUFBQSxNQUFBLE9BQUEsRUFBQSxPQUFBLEVBQUEsTUFBQSxFQUFBLEtBQUEsRUFBQSxZQUFBLEVBQUEsR0FBQSxFQUFBLEtBQUEsRUFBQSxDQUFBLEVBQUEsU0FBQSxFQUFBLEdBQUEsRUFBQSxRQUFBLEVBQUEsT0FBQSxFQUFBLElBQUEsRUFBQSxZQUFBLEVBQUEsVUFBQSxFQUFBOztFQUdBLE1BQUEsR0FBUyxRQUFRLENBQUMsY0FBVCxDQUF3QixTQUF4Qjs7RUFDVCxHQUFBLEdBQU0sTUFBTSxDQUFDLFVBQVAsQ0FBa0IsSUFBbEI7O0VBQ04sQ0FBQSxHQUFJLE1BQU0sQ0FBQzs7RUFDWCxDQUFBLEdBQUksTUFBTSxDQUFDOztFQUNYLFFBQUEsR0FBVzs7RUFDWCxPQUFBLEdBQVU7O0VBQ1YsVUFBQSxHQUFhOztFQUNiLElBQUEsR0FBTzs7RUFDUCxLQUFBLEdBQVEsQ0FBQTs7RUFDUixTQUFBLEdBQVksUUFBQSxDQUFTLElBQUksQ0FBQyxN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