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.

            
              .nexus
 img(src='http://rednosemonkey.com/img/nexus5.png' width="306" height="600")
.container
 - for (var i = 0; i < 4; i++)
   span

            
          
!
            
              $size: 30px;

height,
body {
  height: 100%;
  background: #e67e22;
}

* { box-model: border-box; }

.nexus {
  position: absolute;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  &:before {
    position: absolute;
    content: "";
    display: block;
    width: 290px;
    height: 140px;
    left: 50%; margin-left: -145px;
    background: url("http://rednosemonkey.com/img/google-logo-290.min.png") no-repeat 50% 80px;
    background-size: 50%;
  }
}

.container {
  position: absolute;
  top: 50%;
  left: 50%;
   animation: rotate 7s infinite forwards linear; 
}

span {
  position: absolute;
  display: inline-block;
  width: $size;
  height: $size;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin: -$size / 2;
  animation: 1.25s infinite forwards linear;
  
  &:nth-child(1) {
      background-color: red;
      animation-name: flip-right;
  }
    
  &:nth-child(2) {
      background-color: yellow;
      animation-name: flip-bottom;
  }
        
  &:nth-child(3) {
      background-color: green;
      animation-name: flip-left;
  }
        
  &:nth-child(4) {
      background-color: blue;
      animation-name: flip-top;
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes flip-right {
  0% {
    transform: translate(0, 0) scaleX(1);
  }
  
  5% {
    transform: translateX((sin(1 * 90deg))*$size) scaleX(0.1);
    transform-origin: 0 50%;
  }
  
  25% { 
    transform: translateX((sin(1 * 90deg))*$size/1.3);
    background-color: red;
  }
  
  90% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(red, 0.5);
  }
  
  100% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(white, 0.25);
  }
}

@keyframes flip-left {
  0% {
    transform: translate(0, 0) scaleX(1);
  }
  
  5% {
    transform: translateX((sin(3 * 90deg))*$size) scaleX(0.1);
    transform-origin: 100% 50%;
  }
  
  25% { 
    transform: translateX((sin(3 * 90deg))*$size/1.3);
    background-color: green;
  }
  
  90% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(green, 0.5);
  }
  
  100% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(white, 0.25);
  }
}

@keyframes flip-top {
  0% {
    transform: translate(0, 0) scaleY(1);
  }
  
  5% { 
   transform: translateY((cos(2 * 90deg))*$size) scaleY(0.1);
    transform-origin: 50% 100%;
  }
  
  25% { 
   transform: translateY((cos(2 * 90deg))*$size/1.3);
    background-color: blue;
  }
  
  90% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(blue, 0.5);
  }
  
  100% {
    transform: translate(0, 0) scaleY(1);
    background-color: rgba(white, 0.25);
  }
}

@keyframes flip-bottom {
  0% {
    transform: translate(0, 0) scaleY(1);
  }
  
  5% { 
   transform: translateY((cos(4 * 90deg))*$size) scaleY(0.1);
    transform-origin: 50% 0;
  }
  
  25% { 
   transform: translateY((cos(4 * 90deg))*$size/1.3);
    background-color: yellow;
  }
  
  90% {
    transform: translate(0, 0) scaleX(1);
    background-color: rgba(yellow, 0.5);
  }
  
  100% {
    transform: translate(0, 0) scaleY(1);
    background-color: rgba(white, 0.25);
    box-shadow: 0 0 1px rgba(white, 0.25);
  }
}

            
          
!
            
              /*

The bootloader for my Nexus 7, running Android 4.4 (KitKat). Animation not quite right, but close enough for now!

I wanted to try a quick go at copying the animation in CSS before updating my Nexus to Lollipop.

A video of the animation can be seen towards the end of this video:

https://www.youtube.com/watch?v=mHJV_UprpE8

*/
            
          
!
999px
Loading ..................

Console