cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Untitled

A Pen By Captain Anonymous

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.

            
              <div id="app-icon-container" onMouseMove="trackPos(event)">
  <div id="app-icon">
    <svg viewBox="0 0 160 164" xmlns="http://www.w3.org/2000/svg">
      <g>
        <g id="svg_1">
          <path d="m127.805969,90.003128c0.224838,24.213104 21.241287,32.270615 21.474121,32.373459c-0.177704,0.56826 -3.358078,11.482742 -11.072464,22.756622c-6.668747,9.746841 -13.590027,19.457977 -24.493088,19.659103c-10.713348,0.197403 -14.158287,-6.353043 -26.406677,-6.353043c-12.24469,0 -16.072174,6.151901 -26.213551,6.550446c-10.52422,0.398254 -18.538303,-10.539917 -25.26247,-20.251053c-13.740021,-19.864456 -24.24024,-56.132286 -10.1411,-80.613663c7.004152,-12.157551 19.521101,-19.85622 33.10713,-20.053638c10.334515,-0.197132 20.089069,6.952717 26.406689,6.952717c6.313614,0 18.167473,-8.59832 30.628998,-7.335548c5.21682,0.217129 19.860519,2.1073 29.263641,15.871029c-0.75766,0.469692 -17.472931,10.200527 -17.291229,30.443592m-20.134499,-59.456692c5.587379,-6.7633 9.348007,-16.178439 8.322067,-25.546439c-8.053787,0.32369 -17.792625,5.36682 -23.569427,12.126399c-5.177124,5.985922 -9.711121,15.566772 -8.48777,24.749359c8.976891,0.69453 18.147476,-4.561718 23.73513,-11.329308"/>
        </g>
      </g>
    </svg>
    <canvas id="canvas" width="400px" height="400px">
    </canvas>
  </div>
</div>
            
          
!
            
              body {
  background-color: #34495e; 
}
#app-icon-container {
  width: 300px;
  height: 300px;
  position: absolute;
}

#app-icon {
  margin-left: 100px;
  margin-top: 100px;
  width: 100px;
  height: 100px;
  text-align: center;
  border-radius: 20%;
  border: 1px solid #aaa;
  background-color: rgba(69, 0, 115, 1);
  position: relative;
  overflow: hidden;
  -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); /* this fixes the overflow:hidden in Chrome/Opera */
}

svg {
  fill: #bdc3c7;
  width: 3em;
  margin: 1.25em auto 1em;
}

#canvas {
  position: absolute;
  left: 0;
  top: 0;
}
            
          
!
            
              var c=document.getElementById("canvas");
var ctx=c.getContext("2d");
xpos = ypos = 50;

function trackPos(event) {
	xpos = event.x - 100;
  ypos = event.y - 100;
	draw();
}

function draw() {
  ctx.clearRect(0,0,400,400);
  var grd=ctx.createRadialGradient(xpos,ypos,0,xpos, ypos,100);
  grd.addColorStop(0,'rgba(255,255,255,0.5)');
  grd.addColorStop(1,'rgba(255,255,255,0.2)');

  // Fill with gradient
  ctx.fillStyle=grd;
  ctx.fillRect(0,0,100,100);
}
            
          
!
999px
Loading ..................

Console