Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<head>
<meta charset="UTF-8">
<title>300x600_V1</title>
<meta name="ad.size" content="width=300,height=600">
<!-- write your code here -->

<!-- Load TweenMax.min.js v 1.18.2 -->
<script src="https://s0.2mdn.net/ads/studio/cached_libs/tweenmax_2.0.1_min.js"></script>
<script src="https://s0.2mdn.net/ads/studio/cached_libs/createjs_2015.11.26_54e1c3722102182bb133912ad4442e19_min.js"></script>
<script src="300x600_V1.js"></script>

<script>
var canvas, stage, exportRoot;
function init() {
	// --- write your JS code here ---
	
	canvas = document.getElementById("canvas");
	images = images||{};

	var loader = new createjs.LoadQueue(false);
	loader.addEventListener("fileload", handleFileLoad);
	loader.addEventListener("complete", handleComplete);
	loader.loadManifest(lib.properties.manifest);
}

function handleFileLoad(evt) {
	if (evt.item.type == "image") { images[evt.item.id] = evt.result; }
}

function handleComplete(evt) {
	exportRoot = new lib._300x600_V1();

	stage = new createjs.Stage(canvas);
	stage.addChild(exportRoot);
	stage.update();

	createjs.Ticker.setFPS(lib.properties.fps);
	createjs.Ticker.addEventListener("tick", stage);
	
	if (window.devicePixelRatio) {
    // grab the width and height from canvas
    var height = canvas.getAttribute('height');
    var width = canvas.getAttribute('width');
    // reset the canvas width and height with window.devicePixelRatio applied
    canvas.setAttribute('width', Math.round(width * window.devicePixelRatio));
    canvas.setAttribute('height', Math.round( height * window.devicePixelRatio));
    // force the canvas back to the original size using css
    canvas.style.width = width+"px";
    canvas.style.height = height+"px";
    // set CreateJS to render scaled
    stage.scaleX = stage.scaleY = window.devicePixelRatio;
	}
}

</script>

<!-- write your code here -->

</head>
<body onload="init();" style="background-color:#D4D4D4;margin:0px;">
	<canvas id="canvas" width="300" height="600" style="background-color:#EDECEC"></canvas>
</body>


              
            
!

CSS

              
                
              
            
!

JS

              
                (function(lib, img, cjs, ss) {
  var p; // shortcut to reference prototypes

  // library properties:
  lib.properties = {
    width: 300,
    height: 600,
    fps: 60,
    color: "#EDECEC",
    manifest: [{ src: "images/image_c.jpg?1573560524775", id: "image_c" }]
  };

  // symbols:

  (lib.image_c = function() {
    this.initialize(img.image_c);
  }).prototype = p = new cjs.Bitmap();
  p.nominalBounds = new cjs.Rectangle(0, 0, 600, 862);

  (lib.image_c_1 = function(mode, startPosition, loop) {
    this.initialize(mode, startPosition, loop, {});

    // Layer 2
    this.shape = new cjs.Shape();
    this.shape.graphics
      .f("#666666")
      .s()
      .p("EgvfBDNMAAAiGZMBe/AAAMAAACGZg");
    this.shape.setTransform(300, 437.9, 0.987, 1.046);

    this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));

    // Layer 1
    this.instance = new lib.image_c();

    this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(0, -12, 600, 900);

  (lib.image_b = function(mode, startPosition, loop) {
    if (loop == null) {
      loop = false;
    }
    this.initialize(mode, startPosition, loop, {});

    // Layer 2
    this.shape = new cjs.Shape();
    this.shape.graphics
      .f("#9984AD")
      .s()
      .p("Egu3BKOMAAAiUbMBdvAAAMAAACUbg");
    this.shape.setTransform(300, 475);

    this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(0, 0, 600, 950);

  (lib.image_a = function(mode, startPosition, loop) {
    if (loop == null) {
      loop = false;
    }
    this.initialize(mode, startPosition, loop, {});

    // Layer 2
    this.shape = new cjs.Shape();
    this.shape.graphics
      .f("#996666")
      .s()
      .p("Egu3BKOMAAAiUbMBdvAAAMAAACUbg");
    this.shape.setTransform(300, 475);

    this.timeline.addTween(cjs.Tween.get(this.shape).wait(1));
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(0, 0, 600, 950);

  (lib.cta_hover = function(mode, startPosition, loop) {
    this.initialize(mode, startPosition, loop, {});

    // Layer 1
    this.shape = new cjs.Shape();
    this.shape.graphics
      .f("#EAEAEA")
      .s()
      .p(
      "AGAAoQgIgIAAgRQAAgPAIgHQAIgKAPAAQAOgBAHAKQAHAIAAAMIAAAHIgvAAQACAWARAAQAMAAADgKIAMAAQgFAUgWgBQgQAAgHgKgAGFAKIAhAAIAAgBQAAgSgQAAQgQAAgBATgAD/ApQgIgJAAgRQAAgPAIgIQAIgKAOABQAOgBAJAKQAHAIAAAPQAAARgIAJQgIAJgOAAQgPAAgHgJgAEDAPQAAAaASAAQATAAgBgaQAAgYgSAAQgSAAAAAYgAgmAdIAAgtIALAAIAAAnQABALACADQAEAEAHAAQAQAAAAgXIAAgiIALAAIAABBIgKAAIAAgLIgBAAQgDAMgQAAQgWABAAgWgAhvApQgIgJAAgRQAAgPAIgIQAIgKAOABQAOgBAJAKQAHAIAAAPQAAARgIAJQgIAJgPAAQgOAAgHgJgAhsAPQAAAaATAAQASAAAAgaQAAgYgSAAQgTAAAAAYgAjvAQQAAgQAIgIQAIgJANAAQAOgBAFAMIAAAAIAAgsIAMAAIAABjIgLAAIAAgLIgBAAQgGAMgOAAQgcABAAgjgAjjAPQAAAaASAAQAJAAAEgFQAGgHgBgJIAAgHQABgLgGgEQgEgHgJABQgSAAAAAXgAAsAgIAAgnIgMAAIAAgIIACAAQAIAAABgEQACgCAAgKIAAgEIALAAIAAATIAQAAIAAAJIgQAAIAAAlQAAAKAKAAIAIgBIAAAKIgLABQgSAAgBgSgAFJAxIAAhBIAKAAIAAAMIABAAQACgFAGgEQAGgFAHABIACAAIAAAMIgDAAQgUAAAAARIAAAlgADWAxIAAgpQABgIgDgEQgCgEgIAAQgSAAAAARIAAAoIgLAAIAAgpQAAgIgDgEQgDgEgIAAQgRAAgBARIAAAoIgLAAIAAhBIALAAIAAALQAGgMAPAAQARAAAEANIAAAAQACgGAGgEQAGgDAIAAQAVAAAAATIAAAvgAkPAxIAAgpQgBgIgCgEQgDgEgHAAQgTAAABARIAAAoIgMAAIAAhBIALAAIAAALQAGgMAQAAQAVAAAAATIAAAvgAlhAxIAAhBIALAAIAABBgAmyAxIAAhgIA6AAIAAALIguAAIAAAjIAqAAIAAAJIgqAAIAAApgAlhgfIAAgMIALAAIAAAMg"
    );
    this.shape.setTransform(70.5, 14.1);

    this.shape_1 = new cjs.Shape();
    this.shape_1.graphics
      .f("#F53A0B")
      .s()
      .p("Aq7CLIAAkWIV3AAIAAEWg");
    this.shape_1.setTransform(70, 14);

    this.timeline.addTween(
      cjs.Tween.get({})
      .to({ state: [{ t: this.shape_1 }, { t: this.shape }] })
      .wait(1)
    );
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(0, 0, 140, 28);

  (lib.cta = function(mode, startPosition, loop) {
    this.initialize(mode, startPosition, loop, {});

    // Layer 1
    this.shape = new cjs.Shape();
    this.shape.graphics
      .f("#EAEAEA")
      .s()
      .p(
      "AGAAoQgIgIAAgRQAAgPAIgHQAIgKAPAAQAOgBAHAKQAHAIAAAMIAAAHIgvAAQACAWARAAQAMAAADgKIAMAAQgFAUgWgBQgQAAgHgKgAGFAKIAhAAIAAgBQAAgSgQAAQgQAAgBATgAD/ApQgIgJAAgRQAAgPAIgIQAIgKAOABQAOgBAJAKQAHAIAAAPQAAARgIAJQgIAJgOAAQgPAAgHgJgAEDAPQAAAaASAAQATAAgBgaQAAgYgSAAQgSAAAAAYgAgmAdIAAgtIALAAIAAAnQABALACADQAEAEAHAAQAQAAAAgXIAAgiIALAAIAABBIgKAAIAAgLIgBAAQgDAMgQAAQgWABAAgWgAhvApQgIgJAAgRQAAgPAIgIQAIgKAOABQAOgBAJAKQAHAIAAAPQAAARgIAJQgIAJgPAAQgOAAgHgJgAhsAPQAAAaATAAQASAAAAgaQAAgYgSAAQgTAAAAAYgAjvAQQAAgQAIgIQAIgJANAAQAOgBAFAMIAAAAIAAgsIAMAAIAABjIgLAAIAAgLIgBAAQgGAMgOAAQgcABAAgjgAjjAPQAAAaASAAQAJAAAEgFQAGgHgBgJIAAgHQABgLgGgEQgEgHgJABQgSAAAAAXgAAsAgIAAgnIgMAAIAAgIIACAAQAIAAABgEQACgCAAgKIAAgEIALAAIAAATIAQAAIAAAJIgQAAIAAAlQAAAKAKAAIAIgBIAAAKIgLABQgSAAgBgSgAFJAxIAAhBIAKAAIAAAMIABAAQACgFAGgEQAGgFAHABIACAAIAAAMIgDAAQgUAAAAARIAAAlgADWAxIAAgpQABgIgDgEQgCgEgIAAQgSAAAAARIAAAoIgLAAIAAgpQAAgIgDgEQgDgEgIAAQgRAAgBARIAAAoIgLAAIAAhBIALAAIAAALQAGgMAPAAQARAAAEANIAAAAQACgGAGgEQAGgDAIAAQAVAAAAATIAAAvgAkPAxIAAgpQgBgIgCgEQgDgEgHAAQgTAAABARIAAAoIgMAAIAAhBIALAAIAAALQAGgMAQAAQAVAAAAATIAAAvgAlhAxIAAhBIALAAIAABBgAmyAxIAAhgIA6AAIAAALIguAAIAAAjIAqAAIAAAJIgqAAIAAApgAlhgfIAAgMIALAAIAAAMg"
    );
    this.shape.setTransform(70.5, 14.1);

    this.shape_1 = new cjs.Shape();
    this.shape_1.graphics
      .f("#37393E")
      .s()
      .p("Aq7CLIAAkWIV3AAIAAEWg");
    this.shape_1.setTransform(70, 14);

    this.timeline.addTween(
      cjs.Tween.get({})
      .to({ state: [{ t: this.shape_1 }, { t: this.shape }] })
      .wait(1)
    );
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(0, 0, 140, 28);

  // stage content:
  (lib._300x600_V1 = function(mode, startPosition, loop) {
    if (loop == null) {
      loop = false;
    }
    this.initialize(mode, startPosition, loop, {});

    // timeline functions:
    this.frame_0 = function() {
      var tl = new TimelineMax({ repeat: 0 });

      loop = 0;
      loopMax = 0;

      tl
        .to(
        this.image_a,
        3,
        {
          alpha: 0,
          ease: Power2.easeInOut
        },
        "image_a+=2"
      )

        .to(
        this.image_b,
        3,
        {
          alpha: 0,
          ease: Power2.easeInOut
        },
        "image_a+=6"
      );

      tl.timeScale(1);

      // HOVER
      //cta.addEventListener("mouseenter", function(){
      //  tl.to(this.cta_hover,1, {
      //	  alpha:1
      //	  });

      //});

      //cta.addEventListener("mouseleave", function(){
      //	tl.to(this.cta_hover,1, {
      // alpha:0
      //	  }
      //	);

      //});
    };

    // actions tween:
    this.timeline.addTween(
      cjs.Tween.get(this)
      .call(this.frame_0)
      .wait(1)
    );

    // cta_hover.svg
    this.cta_hover = new lib.cta_hover();
    this.cta_hover.setTransform(150, 520, 1, 1, 0, 0, 0, 70, 14);
    this.cta_hover.alpha = 0;

    this.timeline.addTween(cjs.Tween.get(this.cta_hover).wait(1));

    // cta.svg
    this.cta = new lib.cta();
    this.cta.setTransform(150, 520, 1, 1, 0, 0, 0, 70, 14);

    this.timeline.addTween(cjs.Tween.get(this.cta).wait(1));

    // image_a
    this.image_a = new lib.image_a();
    this.image_a.setTransform(75, 112.8, 0.5, 0.474, 0, 0, 0, 150, 238.1);

    this.timeline.addTween(cjs.Tween.get(this.image_a).wait(1));

    // image_b
    this.image_b = new lib.image_b();
    this.image_b.setTransform(75, 112.8, 0.5, 0.474, 0, 0, 0, 150, 238);

    this.timeline.addTween(cjs.Tween.get(this.image_b).wait(1));

    // image_c
    this.instance = new lib.image_c_1();
    this.instance.setTransform(150, 225, 0.5, 0.5, 0, 0, 0, 300, 438);

    this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
  }).prototype = p = new cjs.MovieClip();
  p.nominalBounds = new cjs.Rectangle(150, 300, 300, 534);
})(
  (lib = lib || {}),
  (images = images || {}),
  (createjs = createjs || {}),
  (ss = ss || {})
);
var lib, images, createjs, ss;

              
            
!
999px

Console