css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div id="r8">
  <div class="body">
    <div class="hood">
      <div class="top"></div>
      <div class="bottom"></div>
      <div class="lights"></div>
    </div>
    <div class="top">
      <div class="front"></div>
      <div class="center"></div>
      <div class="rear"></div>
    </div>      
    <div class="windows">
      <div class="front"></div>
      <div class="center"></div>
    </div>
    <div class="door"></div>
    <div class="mirror"></div>
    <div class="shine">
      <div class="door-top"></div>
      <div class="door-center"></div>
      <div class="door-bottom"></div>
      <div class="door-dark"></div>
    </div>
    <div class="trunk">
      <div class="top"></div>
      <div class="bottom"></div>
      <div class="lights"></div>
    </div>
    <div class="wheel-socket">
      <div class="front"></div>
      <div class="rear"></div>
    </div>
    <div class="kit">
      <div class="front"></div>
      <div class="center"></div>
      <div class="rear"></div>
    </div>
  </div>
  <div class="wheel front">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
  </div>
  <div class="wheel rear">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
  </div>
  <div class="shadow"></div>
</div>
            
          
!
            
              @import "compass/css3";

* {
  @include box-sizing(border-box);
  
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  background: #c4a1a9;
  padding: 40px 0;
  text-align: center;
  overflow: hidden;
}

#r8 {
  position: relative;
  display: inline-block;
  z-index: 0;
  
  width: 291px;
  height: 88px;
  
  overflow: hidden;
  
  .body {
    position: absolute;
    overflow: hidden;
    z-index: 5;
    
    top: 0;
    left: 0;
  
    width: 291px;
    height: 75px;
  }
  
  .hood {
    .top,
    .bottom {
      position: absolute;
      background: #a6c3cb;
    }
    
    .top {
      @include border-top-left-radius(205px 65px);
      
      top: 23px;
      left: 3px;
      
      width: 80px;
      height: 40px;
      z-index: 10;
      
      &:before {
        @include border-radius(50%);
        @include box-shadow(
          -3px -3px 0 0 #a6c3cb,
          1px -2px 0 0 #c5d8dc
        );
        
        content: " ";
        position: absolute;
        
        top: 9px;
        left: 26px;
        
        width: 51px;
        height: 20px;
      }
    }
    
    .bottom {      
      top: 61px;
      left: 3px;
      
      width: 22px;
      height: 8px;
      
      &:before {
        content: " ";
        position: absolute;
        
        top: 3px;
        left: -3px;
        
        border-style: solid;
        border-color: transparent #a6c3cb transparent transparent;
        border-width: 3px 3px 2px 0;
      }
      
      &:after {
        content: " ";
        position: absolute;
        
        top: 8px;
        left: 0;
        
        border-style: solid;
        border-color: #a6c3cb #a6c3cb transparent transparent;
        border-width: 0 22px 8px 0;
      }
    }
    
    .lights {
      @include border-top-left-radius(34px 30px);
      @include box-shadow(        
        inset 0 -4px 0 0 #010207,
        inset 0 -5px 0 0 #33383c,
        
        inset 0 -8px 0 0 #010207,
        inset 0 -9px 0 0 #33383c,
        
        inset 0 -12px 0 0 #010207,
        inset 0 -13px 0 0 #33383c,
        
        inset 0 -17px 0 0 #010207 
      );
      
      position: absolute;
      background: #e5e6e8;
      overflow: hidden;
      z-index: 20;
      
      top: 37px;
      left: 5px;
      
      width: 16px;
      height: 24px;
      
      &:before {
        @include border-top-left-radius(50%);
        
        content: " ";
        position: absolute;
        background: #a7c2cb;
        
        top: 0;
        left: 12px;
        
        width: 20px;
        height: 30px;
      }
      
      &:after {
        @include border-radius(50%);
        @include box-shadow(7px 24px 0 0 #a7c2cb);
        
        content: " ";
        position: absolute;
        
        top: -6px;
        left: -6px;
        
        width: 20px;
        height: 30px;
      }
    }
  }
  
  .top {
    .front,
    .center,
    .rear {
      position: absolute;
      background: #a6c3cb;
      overflow: hidden;

      top: 0;
    }
    
    .front {
      @include border-top-left-radius(115px 50px);
      
      left: 64px;
      
      width: 90px;
      height: 67px;
    }
    
    .center {
      @include border-top-right-radius(185px 22px);
      
      left: 151px;
      
      width: 30px;
      height: 67px;
    }
    
    .rear {
      position: relative;
      background: none;
      border-style: solid;
      border-color: transparent transparent transparent #a6c3cb;
      border-width: 14px 0 0 61px;
      overflow: visible;
      
      top: 5px;
      left: 181px;
      
      &:before {
        content: " ";
        position: absolute;
        background: #a6c3cb;
        display: block;
        
        top: 0;
        left: -61px;
        
        width: 61px;
        height: 42px;
      }
    }
  }
    
  .windows {
    position: absolute;
    overflow: hidden;
    
    top: 5px;
    left: 40px;
    
    width: 161px;
    height: 19px;
    
    .front {
      @include border-radius(50%);
      @include box-shadow(
        -10px 0 0 0 #000207
      );

      position: absolute;
      background: transparent;

      top: -2px;
      left: -4px;

      width: 220px;
      height: 200px;
      
      &:after {
        content: " ";
        position: absolute;
        
        top: 0;
        left: 57px;
        
        border-style: solid;
        border-color: transparent #a5c2ca transparent transparent;
        border-width: 0 20px 10px 13px;
      }
    }
      
    .center {
      @include border-radius(50% 75% 0 0);
      @include box-shadow(
        inset -91px -127px 0px #2a2f33
      );

      position: absolute;
      background: #010207;
      overflow: hidden;

      top: 2px;
      left: 15px;

      width: 220px;
      height: 200px;
      
      &:before {
        content: " ";
        position: absolute;
        z-index: 10;
        
        top: 14px;
        left: 37px;
        
        border-style: solid;
        border-color: transparent transparent #a6c3cb transparent;
        border-width: 0 0 3px 92px;
      }
      
      &:after {
        content: " ";
        position: absolute;
        z-index: 20;
        
        top: 3px;
        left: 122px;
        
        border-style: solid;
        border-color: transparent transparent #2a2f33 transparent;
        border-width: 0 0 14px 10px;
      }
    }
  }
  
  .door {
    @include border-bottom-right-radius(30px 37px);
    
    position: absolute;
    z-index: 10;
    
    top: 24px;
    left: 154px;
    
    width: 51px;
    height: 35px;
    
    border-style: solid;
    border-color: transparent transparent #2a2f33 transparent;
    border-width: 0 0 35px 23px;
    
    &:before {
      @include border-radius(50%);
      
      content: " ";
      position: absolute;
      background: #2a2f33;
      
      top: -5px;
      left: 17px;
      
      width: 11px;
      height: 11px;
    }
    
    &:after {
      @include border-radius(0 0 90% 0);
      @include box-shadow(
        0 3px 0 0 #a6c3cb
      );
      
      content: " ";
      position: absolute;
      background: transparent;
      
      top: 15px;
      left: -23px;
      
      width: 47px;
      height: 20px;
    }
  }
  
  .mirror {
    @include border-bottom-right-radius(20%);
    @include border-bottom-left-radius(90% 50%);
    position: absolute;
    z-index: 40;

    top: 23px;
    left: 93px;

    width: 0;
    height: 8px;

    border-left: solid 3px #8cb1ba;
    border-right: solid 3px #749398;
    
    &:after {
      @include border-top-left-radius(90% 50%);
      @include border-top-right-radius(20%);
      @include border-bottom-right-radius(20%);
      @include border-bottom-left-radius(90% 50%);
      @include box-shadow(
        inset -1px 0 0 0 #a6c3cb,
        inset 2px 0 0 0 #a6c3cb,
        inset 0 -1px 0 0 #a6c3cb,
        inset 0 -3px 0 0 #8bb1ba
      );

      content: " ";
      position: absolute;
      background: #a6c3cb;
      border: solid 1px #8bb1ba;

      top: -8px;
      left: -5px;

      width: 11px;
      height: 10px;
    }
  }
  
  .shine {
    .door-top {
      position: absolute;
      z-index: 5;

      top: 25px;
      left: 94px;

      width: 83px;
      height: 4px;

      border-style: solid;
      border-color: transparent transparent #b9ced1 transparent;
      border-width: 0 0 4px 83px;
    }
  
    .door-center {
      position: absolute;
      overflow: hidden;
      z-index: 5;

      top: 33px;
      left: 120px;

      width: 72px;
      height: 12px;

      &:before {
        content: " ";
        position: absolute;

        top: 0;
        left: 0;

        border-style: solid;
        border-color: transparent transparent #829fa5 transparent;
        border-width: 0 0 4px 72px;
      }

      &:after {
        @include border-top-right-radius(100%);
        @include box-shadow(
          20px -1px 0 0 #829fa5 
        );

        content: " ";
        position: absolute;
        background: transparent;

        top: 4px;
        left: 0;

        width: 44px;
        height: 5px;
      }
    }
    
    .door-bottom {
      @include border-top-left-radius(200% 200%);
      @include border-bottom-right-radius(5px);

      position: absolute;
      background: #94bdc3;
      border-top: solid 3px #c6d8da;
      border-left: solid 3px #c6d8da;

      top: 46px;
      left: 85px;

      width: 84px;
      height: 18px;

      z-index: 5;

      &:after {
        content: " ";
        position: absolute;

        left: 0;
        bottom: 0;

        border-style: solid;
        border-width: 0 0 8px 100px;
        border-color: transparent transparent #a6c3cb transparent;
      }
    }

    .door-dark {
      position: absolute;
      z-index: 20;

      height: 4px;

      top: 25px;
      left: 177px;

      border-style: solid;
      border-width: 1px 25px 1px 0;
      border-color: transparent #505558 transparent transparent;
    }
  }
  
  .trunk {
    .top,
    .bottom {
      position: absolute;
      background: #a6c3cb;
    }
    
    .top {
      @include border-top-right-radius(25px 40px);
      @include border-bottom-right-radius(3px);
      
      top: 20px;
      left: 242px;
      
      width: 42px;
      height: 40px;
      
      &:before {
        content: " ";
        position: absolute;
        
        top: -6px;
        left: -21px;
        
        border-style: solid;
        border-color: transparent transparent transparent #a6c3cb;
        border-width: 6px 0 0 45px;
      }
    }
    
    .bottom {    
      @include border-top-right-radius(5px);
      @include border-bottom-right-radius(10px);
      
      top: 60px;
      left: 260px;
      
      width: 24px;
      height: 10px;
      
      &:after {
        content: " ";
        position: absolute;
        
        top: 9px;
        left: 0;
        
        border-style: solid;
        border-color: transparent transparent transparent #a6c3cb;
        border-width: 0 0 12px 22px;
      }
    }
    
    .lights { 
      @include border-top-right-radius(25px 40px);
      @include box-shadow(       
        inset 0 -4px 0 0 #010207,
        inset 0 -5px 0 0 #33383c,
        
        inset 0 -8px 0 0 #010207,
        inset 0 -9px 0 0 #33383c,
        
        inset 0 -12px 0 0 #010207,
        inset 0 -13px 0 0 #33383c,
        
        inset 0 -16px 0 0 #010207,
        inset 0 -17px 0 0 #33383c,
        
        inset 0 -20px 0 0 #010207  
      );
      
      position: absolute;
      background: #e1417f;
      
      top: 23px;
      right: 8px;
      
      width: 17px;
      height: 26px;
      
      &:before {
        @include border-top-right-radius(100% 80%);
        @include box-shadow(
          inset 0 2px 0 0 #a6c3cb,
          inset 0 -12px 0 0 #a6c3cb,
          
          inset -2px 0 0 0 #a6c3cb,
          inset -3px 0 0 0 #c6d8da
        );
        
        content: " ";
        position: absolute;
        background: #a6c3cb;
      
        top: 0;
        left: -10px;

        width: 20px;
        height: 37px;
      }
      
      &:after {
        content: " ";
        position: absolute;
        
        top: 0;
        left: -15px;
        
        border-style: solid;
        border-color: #a6c3cb transparent transparent transparent;
        border-width: 10px 10px 0 10px;
      }
    }
  }
  
  .wheel-socket {
    .front,
    .rear{
      position: absolute;
      background: #010005;
      z-index: 1000;
    }
    
    .front {
      @include border-radius(50% 50% 0 50%);
      @include box-shadow(
        0 0 0 2px #a6c3cb,
        0 -2px 0 3px #bfd4d9
      );
      
      top: 37px;
      left: 25px;
      
      width: 51px;
      height: 51px;
    }
    
    .rear {
      @include border-radius(50% 50% 50% 0);
      @include box-shadow(
        0 0 0 3px #a6c3cb,
        0 -3px 0 3px #bfd4d9,
        0 -3px 0 8px #a6c3cb,
        0 -8px 0 5px #c6d8da
      );
      
      top: 34px;
      left: 210px;
    
      width: 57px;
      height: 57px;
    }
  }
  
  .kit {
    .front {
      position: absolute;

      top: 67px;
      left: 4px;

      border-style: solid;
      border-color: #8cb1ba #8cb1ba transparent transparent;
      border-width: 0 20px 6px 0;
      
      &:before {
        @include border-radius(50%);
        
        content: " ";
        position: absolute;
        background: #c6d8da;
        
        width: 13px;
        height: 2px;
        
        top: -5px;
        left: 4px;
      }
    }
    
    .center {
      @include border-radius(2px);
      
      position: absolute;
      background: #a6c3cb;
      border: solid 2px #a6c3cb;
      border-right-width: 4px;
      overflow: hidden;
      
      left: 76px;
      bottom: 0;
      
      width: 134px;
      height: 22px;
      
      &:before {
        content: " ";
        position: absolute;
        
        right: 0;
        bottom: 0;
        
        border-style: solid;
        border-color: transparent #8cb1ba transparent transparent;
        border-width: 8px 263px 0 0;
      }
    }
    
    .rear {
      @include border-bottom-right-radius(40px);
      
      position: absolute;
      background: #8cb1ba;
      overflow: hidden;
      
      left: 250px;
      bottom: 2px;
      
      width: 28px;
      height: 11px;
    }
  }
  
  .wheel {
    @include border-radius(50%);
    
    position: absolute;
    border: solid 3px #282c2d;
    z-index: 10;
    
    > span {      
      position: absolute;
      display: block;
      z-index: 10;
      
      top: 50%;
      right: 50%;
      
      margin-top: -2px;
      margin-right: 4px;
      
      width: 13px;
      height: 5px;
      
      border-top: solid 2px #cbdeef;
      border-bottom: solid 2px #cbdeef;
      
      &:first-child + * {
        @include rotate(360deg / 5 * 1);
        
        margin-top: -13px;
        margin-right: -3px;
      }
      
      &:first-child + * + * {
        @include rotate(360deg / 5 * 2);
        
        margin-top: -9px;
        margin-right: -15px;
      }
      
      &:first-child + * + * + * {
        @include rotate(360deg / 5 * 3);
        
        margin-top: 4px;
        margin-right: -16px;
      }
      
      &:first-child + * + * + * + * {
        @include rotate(360deg / 5 * 4);
        
        margin-top: 8px;
        margin-right: -3px;
      }
    }
    
    &.front {
      @include box-shadow(
        inset 0 0 0 1px #000004,
        inset 0 0 0 2px #cbdeef,
        inset 0 0 0 3px #8fa2b1,
        inset 0 0 0 4px #caddee,
        inset 0 0 0 10px #090a0e,
        inset 0 0 0 13px #000004,
        inset 0 0 0 16px #cadcf0,
        inset 0 0 0 17px #90a1b1,
        inset 0 0 0 23px #c9def1
      );
      
      top: 40px;
      left: 28px;
    
      width: 44px;
      height: 44px;
    }
    
    &.rear {
      @include box-shadow(
        inset 0 0 0 1px #000004,
        inset 0 0 0 2px #cbdeef,
        inset 0 0 0 3px #8fa2b1,
        inset 0 0 0 4px #caddee,
        inset 0 0 0 12px #090a0e,
        inset 0 0 0 15px #000004,
        inset 0 0 0 18px #cadcf0,
        inset 0 0 0 19px #90a1b1,
        inset 0 0 0 23px #c9def1
      );
      
      top: 38px;
      left: 215px;
    
      width: 47px;
      height: 47px;
    }
  }
  
  .shadow {
    @include border-radius(50%);
    
    position: absolute;
    background: #010207;
    z-index: 0;
    
    left: 0;
    bottom: 0;
    
    width: 291px;
    height: 22px;
  }
}

/* The animation part ;) */

@mixin animation($value) {
  -webkit-animation: unquote($value);
     -moz-animation: unquote($value);
       -o-animation: unquote($value);
          animation: unquote($value);
}

@mixin keyframes($name) {
  @-webkit-keyframes #{$name} { @content; }
     @-moz-keyframes #{$name} { @content; }
       @-o-keyframes #{$name} { @content; }
          @keyframes #{$name} { @content; }
}

.wheel {
  @include animation(wheels-animation .9s cubic-bezier(.44,.33,.46,.92));
  @include transform-origin(50% 50% 0);
}

.body {
  @include animation(body-animation 1.2s cubic-bezier(.44,.33,.46,.92));
  @include transform-origin(82% 83% 0);
}

.trunk .lights {
  @include animation(lights-animation 1s ease-in-out infinite alternate);
}

#r8 {
  @include animation(r8-animation .9s cubic-bezier(.44,.33,.46,.92));
  @include transform-origin(50% 50% 0);
}

@include keyframes(wheels-animation) {
  0% {
    @include rotate(0deg);
  }
  
  100% {
    @include rotate(-720deg);
  }
}

@include keyframes(body-animation) {
  0% {
    @include rotate(0deg);
  }
  
  85% {
    @include rotate(-1deg);
  }
  
  100% {
    @include rotate(0deg);
  }
}

@include keyframes(lights-animation) {
  0% {
    background: #b01329;
  }
  
  20% {
    background: #b01329;
  }
  
  80% {
    background: #e3407f;
  }
  
  100% {
    background: #e3407f;
  }
}

@include keyframes(r8-animation) {
  0% {
    @include translateX(1000px);
  }
  
  100% {
    @include translateX(0);
  }
}
            
          
!
            
              /* 
Audi R8
Made by Kevin Jannis (@kevinjannis)
View more at www.janniskev.in 

Inspired by: https://dribbble.com/shots/1344020-Audi-R8
*/
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console