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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <script src="https://code.createjs.com/easeljs-0.8.2.min.js"></script>
<body>
  <canvas id="catCanvas" width="1000" height="600"></canvas>
  
  <div id="stars"></div>
  <div id="stars1"></div>
  <div id="stars2"></div>
  <div id="stars3"></div>
</body>
            
          
!
            
              //Stars stolen from https://codepen.io/saransh/pen/BKJun
@import compass
  
// n is number of stars required
@function multiple-box-shadow ($n) 
  $value: '#{random(5000)}px #{random(5000)}px #FFF'
  @for $i from 2 through $n
    $value: '#{$value} , #{random(5000)}px #{random(5000)}px #FFF'

  @return unquote($value)

$shadows-small:  multiple-box-shadow(700)
$shadows-medium: multiple-box-shadow(200)
$shadows-big:    multiple-box-shadow(100)

html
  height: 100%
  background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%)
  overflow: hidden
    
#stars
  width: 1px
  height: 1px
  background: transparent
  box-shadow: $shadows-small
  animation			: animStar 5s linear infinite
    
  &:after
    content: " "
    position: absolute
    top: 2000px
    width: 1px
    height: 1px
    background: transparent
    box-shadow: $shadows-small
    
#stars2
  width: 2px
  height: 2px
  background: transparent
  box-shadow: $shadows-medium
  animation			: animStar 10s linear infinite
    
  &:after
    content: " "
    position: absolute
    top: 2000px
    width: 2px
    height: 2px
    background: transparent
    box-shadow: $shadows-medium
    
#stars3
  width: 3px
  height: 3px
  background: transparent
  box-shadow: $shadows-big
  animation			: animStar 15s linear infinite
    
  &:after
    content: " "
    position: absolute
    top: -2000px
    width: 3px
    height: 3px
    background: transparent
    box-shadow: $shadows-big

#title
  position: absolute
  top: 50%
  left: 0
  right: 0
  
  color: #FFF
  text-align: center
  font-family: 'lato',sans-serif
  font-weight: 300
  font-size: 50px
  letter-spacing: 10px
  
  margin-top: -60px
  padding-left: 10px
  
  span
    background: -webkit-linear-gradient(white, #38495a)
    -webkit-background-clip: text
    -webkit-text-fill-color: transparent
    
@keyframes animStar
  from	
    transform: translateY(-2000px) translateX(-2500px)
  to		
    transform: translateY(0px)
    transform: translateX(0px)
    
            
          
!
            
              // Uses the following sprite sheet
// https://i.imgur.com/eBRbpuh.png

// Looking for a new gig?
// http://join.hired.com/x/GQ96gt
// <3

stage = new createjs.Stage("catCanvas");
stage.globalCompositeOperation='destination-over';

var spriteSheet = new createjs.SpriteSheet({
  framerate: 20,
  "images": ["https://78.media.tumblr.com/5fd3052563766c3377307ab1a37b768a/tumblr_oxj1xe5Bna1qz4vfso2_1280.png"],
  frames: {width:420, height:285, "count": 7},
  animations: {
    "fly": [0, 1, 2, 3, 4, 5, 6]
  }
});

cat = new createjs.Sprite(spriteSheet, "fly");
cat.y = 100;
cat.x = 300;

stage.addChild(cat);
stage.update();

createjs.Ticker.on("tick", handleTick);
function handleTick(event) {
  stage.update(event);
}

function tick(event) {
  stage.update();
};
            
          
!
999px
Loading ..................

Console