cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              <div class="banner">
	<div id="mc">
    <div class="robot"></div>  
</div>
</div>
            
          
!
            
              	a {text-decoration: none;color: #000;}
	.banner { position: absolute; width: 298px; height: 248px; border: 1px solid #666; background-color:#FFF; top: 0px; left: 0px; margin: auto; z-index: 100; display: block; cursor: pointer; overflow: hidden; }
.off { opacity: 0; }
.robot{
  opacity:0;
	display: block;
	position: absolute;
	left: 169px;
	top: 119px;
	width: 128px;
	height: 128px;
	background-image: url('http://emmanuelulloa.com/codepen/robot.png');
	background-repeat: no-repeat;
	background-position: 0px 0px;
	background-size: 128px 128px;
	transform-origin: 64px 64px;
	-webkit-transform-origin: 64px 64px;
	transition: all 1s cubic-bezier(.65, 1.95, .03, .32) 0s;
	-webkit-transition: all 1s cubic-bezier(.65, 1.95, .03, .32) 0s;
}
.frame1 .robot {
  opacity:1;
	left: -49px;
	top: -4px;
	width: 384px;
	height: 384px;
	background-size: 384px 384px;
	transform-origin: 192px 192px;
	-webkit-transform-origin: 192px 192px;
	transition: all 0.5s cubic-bezier(.65, 1.95, .03, .32) 0s;
	-webkit-transition: all 0.5s cubic-bezier(.65, 1.95, .03, .32) 0s;
}
.frame2 .robot{
  opacity:1;
	left: 106px;
	top: -4px;
	width: 384px;
	height: 384px;
	background-size: 384px 384px;
	transform-origin: 192px 192px;
	-webkit-transform-origin: 192px 192px;
	transition: all 0.5s cubic-bezier(.755,.05,.855,.06) 0s;
	-webkit-transition: all 0.5s cubic-bezier(.755,.05,.855,.06) 0s;
}
.frame3 .robot{
  opacity:1;
	left: -53px;
	top: -6px;
	width: 256px;
	height: 256px;
	background-size: 256px 256px;
	transform-origin: 128px 128px;
	-webkit-transform-origin: 128px 128px;
	transition: all 1s cubic-bezier(.175, .885,.32,1.275) 0s;
	-webkit-transition: all 1s cubic-bezier(.175, .885,.32,1.275) 0s;
}
            
          
!
            
              /*
 ___                  __  
|__  |     /\      | /__` 
|    |___ /~~\ .\__/ .__/ 
                          
*/
var fla = (function() { var F = { UA : navigator.userAgent.toLowerCase(), DOC : document, WIN : window, DET : {}, TIME: 0, TOS : [] }; F.DET.html5 = 'querySelector' in F.DOC && 'addEventListener' in F.WIN; F.DET.ie = (F.UA != -1) ? parseInt(F.UA.split('msie')[1]) : 0; function hasClass(elem, className) { return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); } function addClass(elem, className) { if (!hasClass(elem, className)) { elem.className += ' ' + className; } } function removeClass(elem, className) { var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; if (hasClass(elem, className)) { while (newClass.indexOf(' ' + className + ' ') >= 0) { newClass = newClass.replace(' ' + className + ' ', ' '); } elem.className = newClass.replace(/^\s+|\s+$/g, ''); } } function toggleClass(elem, className) { var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; if (hasClass(elem, className)) { while (newClass.indexOf(' ' + className + ' ') >= 0) { newClass = newClass.replace(' ' + className + ' ', ' '); } elem.className = newClass.replace(/^\s+|\s+$/g, ''); } else { elem.className += ' ' + className; } } function switchClass(el, c1, c2) { removeClass(el, c1); addClass(el, c2); } function _classManager(fn, dom, a, b, c) { if (dom.length) { var arr = []; for (var i = 0; i < dom.length; i++) { arr.push(fn(dom[i], a, b, c)); } return arr; } return fn(dom, a, b, c); } function on(el, evt, fn) { el.addEventListener(evt, fn, false); } function off(el, evt, fn) { el.removeEventListener(evt, fn, false); } function _eventManager(fn, dom, evt, foo) { if (dom.length) { for (var i = 0; i < dom.length; i++) { fn(dom[i], evt, foo); } return; } fn(dom, evt, foo); } function each(arr, fn, arg) { var l = arr.length; while (l) { --l; fn.call(arg, l, arr[l], arr); } } function timeline(t) { if (typeof t === 'boolean' && t === false) { for (var i = 0; i < F.TOS.length; i++) { clearTimeout(F.TOS[i]); } } for (var i = 0; i < t.length; i++) { F.TOS.push(setTimeout(t[i][0], F.TIME += t[i][1])); } } return { detect: function(val) { return F.DET[val]; }, ready: function(fn) { if (typeof fn !== 'function') { return; } if (document.readyState === 'complete') { return fn(); } document.addEventListener('DOMContentLoaded', fn, false); return; }, $id: function(id) { return document.getElementById(id); }, $tag: function(tag) { return document.getElementsByTagName(tag); }, $class: function(classname) { return document.getElementsByClassName(classname); }, $: function(selector, el) { return (el || document).querySelector(selector); }, $$: function(selector, el) { return (el || document).querySelectorAll(selector); }, hide: function(el) { el.style.display = 'none'; }, show: function(el) { el.style.display = ''; }, text: function(el, val) { if (val) { el.textContent = val; } return el.textContent; }, html: function(el, val) { if (val) { el.innerHTML = val; } return el.innerHTML; }, attr: function(el, att, val) { if (val) { el.setAttribute(att, val); } return el.getAttribute(att); }, css: function(el, prop, val) { var p = (prop).replace(/-([a-z])/g, function(g) { return g[1].toUpperCase(); }).toLowerCase(); if (val) { el.style[p] = val; } return getComputedStyle(el)[p]; }, rect: function(el) { return el.getBoundingClientRect(); }, transform: function(el, t) { if (t) { el.style.transform = t; el.style.webkitTransform = t; } return el.style.transform || el.style.webkitTransform; }, delay: function(fn, time) { return setTimeout(fn, time || 1000); }, hasClass: function(dom, c1) { _classManager(hasClass, dom, c1); }, addClass: function(dom, c1) { _classManager(addClass, dom, c1); }, removeClass: function(dom, c1) { _classManager(removeClass, dom, c1); }, toggleClass: function(dom, c1) { _classManager(toggleClass, dom, c1); }, switchClass: function(dom, c1, c2) { _classManager(switchClass, dom, c1, c2); }, on: function(dom, eventname, fn) { _eventManager(on, dom, eventname, fn); }, off: function(dom, eventname, fn) { _eventManager(off, dom, eventname, fn); }, each: each, timeline: timeline }})();

/*
 __                  ___  __      __   __   __   ___ 
|__)  /\  |\ | |\ | |__  |__)    /  ` /  \ |  \ |__  
|__) /~~\ | \| | \| |___ |  \    \__, \__/ |__/ |___ 
                                                     
*/
function sc(elem, c1, c2){
  fla.removeClass(elem, c1);
  elem.offsetWidth = elem.offsetWidth;
  fla.addClass(elem, c2);
}
function init(){
fla.ready(function() {
 if (fla.detect('html5')) {
  fla.on(fla.$('.banner'), 'click', function(){
   Enabler.exit('clickTag');
  });
  var $mc = fla.$('#mc');
  var tl = [
    [function(){fla.addClass($mc, 'frame1');},0],
    [function(){fla.switchClass($mc, 'frame1', 'frame2');},2000],
    [function(){fla.switchClass($mc, 'frame2', 'frame3');},2000]
  ];
  fla.timeline(tl);
 }
})
}
if (Enabler.isInitialized()) {
 init();
} else {
 Enabler.addEventListener(studio.events.StudioEvent.INIT, init);
}

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console