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="eyes" width="500" height="500">
</canvas>
<div id="googly">
  <div id="googly2"></div>
</div>
<div id="googly3">
  <div id="googly2"></div>
</div>
            
          
!
            
              canvas {
  position: absolute;
  left: 50%;
  margin-left: -250px;
  top: 50%;
  margin-top: -100px;
}
#googly {
  position: absolute;
  top: 300px;
  left: 300px;
  width: 20px;
  height: 20px;
  border-radius: 50px;
  border: thin solid black;
  background: white;
  -webkit-animation: jello 20s infinite;
  animation: jello 9s infinite;
}
#googly3 {
  position: absolute;
  top: 300px;
  left: 275px;
  width: 20px;
  height: 20px;
  border-radius: 50px;
  border: thin solid black;
  background: white;
  -webkit-animation: jello 20s infinite;
  animation: jello 9s infinite;
}
@-webkit-keyframes {
  -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
}
@keyframes {
  transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
}
#googly2 {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: black;
  border-radius: 50px;
  -webkit-animation: look 2s infinite;
}
@-webkit-keyframes look {
  0% {
    transform:
    translate3d(0px, 3px, 0px);
  }
  100% {
    tansform: translate3d(1px, 0px, 0px);
  }
}
            
          
!
            
              // Thanks to: https://codepen.io/rachsmith/post/controlling-the-canvas-with-javascript-objects

var cvs = document.getElementById("eyes");
var ctx = cvs.getContext("2d");

var radius = 7;
var radius1 = 3;
// for loops determining circle location, creating a grid
//outer circle
for (var y = 0; y < 30; y++) {
  for (var x = 0; x < 20; x++) {
    ctx.beginPath();
    ctx.arc(13 + x * 25, 7 + y * 20, radius, 0, 2 * Math.PI, false);
    ctx.strokeStyle = "#ccc";
    ctx.stroke();
  }
}
//inner circle
for (var b = 0; b < 30; b++) {
  for (var a = 0; a < 20; a++) {
    ctx.beginPath();
    ctx.arc(12 + a * 25, 10 + b * 20, radius1, 0, 2 * Math.PI, false);
    ctx.fillStyle = "black";
    ctx.fill();
  }
}
/*var p = Math.random();
  var x = centerX * Math.cos(2 * Math.PI * p);
  var y = centerY * Math.sin(2 * Math.PI * p);
  var circle = new Circle(x,y,radius,colors[Math.floor(i%4)]);
  var r = Math.random()*80;
  circle.innerX = x;
  circle.outerX = centerX + r * Math.cos(2 * Math.PI * p);
  circle.innerY = y + x + 200;
  circle.outerY = centerY + r * Math.sin(2 * Math.PI * p);
  circles.push(circle);
  
}

*/

            
          
!
999px
Loading ..................

Console