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

              
                <div class="container">
  <div class="car-wrapper">
    <div class="car-wrapper_inner">

      <div class="car_outter">  
        <div class="car">
          <div class="body">
            <div></div>
          </div>
          <div class="decos">
            <div class="line-bot"></div>
            <div class="door">
              <div class="handle"></div>
              <div class="bottom"></div>
            </div>
            <div class="window"></div> 
            <div class="light"></div>
            <div class="light-front"></div>
            <div class="antenna"></div>
            <div class="ice-cream">
              <div class="cone"></div>
            </div>  
          </div>
          <div>
            <div class="wheel"></div>
            <div class="wheel"></div>
          </div>    
          <div class="wind">
            <div class="p p1"></div>
            <div class="p p2"></div>
            <div class="p p3"></div>
            <div class="p p4"></div>
            <div class="p p5"></div>
          </div>
        </div>
      </div>
    </div>

  </div>

  <div class="background-stuff">
    <div class="bg"></div>
    <div class="bg bg-2"></div>
    <div class="bg bg-3"></div>
    <div class="ground"></div>
  </div>

</div>


              
            
!

CSS

              
                $basepx: 16px;

@function em($target, $context: $basepx) {
   @if $target == 0 { @return 0 }
   @return $target / $context + 0em;
}

@mixin prefix($name, $value) {
  @each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') {
    #{$vendor}#{$name}: #{$value};
  }
}

html, body{
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

.background-stuff{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #98c5e8;
  animation: wrapperIn 2s;
  .bg{
    position: absolute;
    top: 0%;
    left: -100%;
    width: 50%;
    height: 100%;
    background: #636ed1;
    @include prefix(animation, bgIn 4s 0s linear infinite);
    @include prefix(transform, skewX(10deg));
    z-index: 1;
  } 
  .bg-2{
    background: #8faaff;
    @include prefix(animation, bgIn 4s 1s linear infinite);
  } 
  .bg-3{
    background: #5a73da;
    @include prefix(animation, bgIn 4s 2s linear infinite);
  }  
  .ground{
    position: absolute;
    bottom: 0;
    margin-bottom: em(-30px, $basepx);
    height: 50%;
    width: 100%;
    background: #ffc253;
    z-index: 2;
  }
}

.container{
  height: 100%;
  width: 100%;
  display: table;
  overflow: hidden;
  .car-wrapper{
    display: table-cell;
    vertical-align: middle;
    width: 100%;
  }
}

.car{
  width: em(320px, $basepx);
  height: em(200px, $basepx);
  position: relative;
  opacity: 1;
  margin-left: auto;
  margin-right: auto;
  z-index: 4;
  @include prefix(animation, carMove 0.3s infinite);
  .body{
    position: absolute;
    top: 0;
    left: em(14px, $basepx);
    width: em(230px, $basepx);
    height: em(160px, $basepx);
    background: #fff;
    &:before{
      content: "";
      position: absolute;
      left: em(-14px, $basepx);
      border-radius: 10px 10px 0 0;
      width: em(254px, $basepx);
      z-index: 2;
      height: em(12px, $basepx);
      background: #3190dd;
    }
    div{
      position: absolute;
      background: #fff;
      width: em(290px, $basepx);
      height: em(60px, $basepx);
      bottom: em(-10px, $basepx);
      border-radius: 0 0 10px 10px;
      &:before{
        content: "";
        background: #fff;
        position: absolute;
        top: em(-29px, $basepx);
        right: 0px;
        width: em(80px, $basepx);
        height: em(40px, $basepx);
        z-index: 1;
        border-radius: 0 14px 0 0;
        @include prefix(transform, rotate(17deg));
      }
      &:after{
        content: "";
        background: #fff;
        position: absolute;
        top: em(-82px, $basepx);
        right: em(17px, $basepx);
        width: em(90px, $basepx);
        height: em(40px, $basepx);
        z-index: 1;
        border-radius: 10px 0 0 0;
        @include prefix(transform, rotate(75deg));        
      }
    }
   }
  .wheel{
    position: absolute;
    width: em(60px, $basepx);
    height: em(60px, $basepx);
    background: #3c464c;
    border-radius: 50%;
    bottom: 0;
    left: em(48px, $basepx);
    z-index: 14;
    @include prefix(animation, carMove 0.3s 0.2s);
    &:before{
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      background: #fff;
      width: em(24px, $basepx);
      height: em(24px, $basepx);
      border-radius: 50%;
      @include prefix(transform, translate(-50%, -50%));
    }
    &:nth-of-type(2){
      left: em(210px, $basepx);
    }
  }
  .decos{
    width: em(290px, $basepx);
    height: em(168px, $basepx);
    position: absolute;
    z-index: 12;
    top: 0;
    left: em(14px, $basepx);
  }
  .line-bot{
    position: absolute;
    bottom: em(9px, $basepx);
    height: 3px;
    width: 100%;
    background: #e1e8ef;
  }
  .door{
    position: absolute;
    left: em(120px, $basepx);
    bottom: 0;
    width: em(60px, $basepx);
    height: em(141px, $basepx);
    border-radius: 10px 10px 0 0;
    border: 3px solid #e1e8ef;
    border-bottom: 0;
    background: #fff;
    &:after{
      content: "";
      position: absolute;
      top: em(6px, $basepx);
      left: em(7px, $basepx);
      width: em(46px, $basepx);
      height: em(40px, $basepx);
      border-radius: 4px;
      background: #5bc2ef;
    }
    .handle{
      position: absolute;
      right: em(10px, $basepx);
      top: em(70px, $basepx);
      width: em(10px, $basepx);
      height: em(10px, $basepx);
      background: #e1e8ef;
      border-radius: 50%;
      &:after{
        content: "";
        width: em(20px, $basepx);
        height: em(4px, $basepx);
        border-radius: 10px;
        background: #e1e8ef;
        position: absolute;
        top: 50%;
        left: em(-5px, $basepx);
        margin-top: em(-2px, $basepx);
      }
    }
    .bottom{
      position: absolute;
      bottom: em(6px, $basepx);
      left: em(11px, $basepx);
      width: em(38px, $basepx);
      height: em(12px, $basepx);
      &:before, &:after{
        content: "";
        display: block;
        width: 100%;
        height: em(3px, $basepx);
        background: #e1e8ef;
        height: em(4px, $basepx);
        border-radius: 10px;
        margin-bottom: em(4px, $basepx);
      }
    }
  }
  .window{
    position: absolute;
    top: em(18px, $basepx);
    left: em(200px, $basepx);
    width: em(32px, $basepx);
    background: #5bc2ef;
    height: em(72px, $basepx);
    border-radius: 10px 10px 0 10px;
    &:before{
      content: "";
      width: 100%;
      height: em(20px, $basepx);
      background: #5bc2ef;
      position: absolute;
      bottom: 0;
      left: 0;
      width: em(47px, $basepx);
      border-radius: 0 10px 10px 10px;
    }
    &:after{
      content: "";
      height: em(20px, $basepx);
      background: #5bc2ef;
      position: absolute;
      top: em(17px, $basepx);
      left: em(-13px, $basepx);
      width: em(67px, $basepx);
      transform-origin: bottom;
      @include prefix(transform, rotate(74deg));
      border-radius: 10px 10px 10px 10px;
    }    
  }
  .light{
    position: absolute;
    width: em(10px, $basepx);
    height: em(10px, $basepx);
    background: #ff8c40;
    right: em(60px, $basepx);
    bottom: em(50px, $basepx);
    border-radius: 3px;
  }
  .light-front{
    position: absolute;
    width: em(8px, $basepx);
    height: em(8px, $basepx);
    background: #ff8c40;
    right: em(-3px, $basepx);
    bottom: em(57px, $basepx);
    border-radius: 3px;
    &:after{
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      background: #ff8c40;
      top: 100%;
      height: em(15px, $basepx);
      border-radius: 3px;
      margin-top: 2px;
    }
  }  
  .antenna{
    position: absolute;
    width: em(26px, $basepx);
    height: em(10px, $basepx);
    background: #fff;
    bottom: 100%;
    left: em(17px, $basepx);
    border-radius: 4px 4px 0 0;
    &:before{
      content: "";
      position: absolute;
      width: em(38px, $basepx);
      height: em(4px, $basepx);
      background: #fff;
      bottom: 0;
      left: em(-22px, $basepx);
      @include prefix(transform, rotate(55deg));
      @include prefix(transform-origin, right);
      border-radius: 4px;
    }
  }
  .ice-cream{
    position: absolute;
    left: em(30px, $basepx);
    top: em(30px, $basepx);
    width: em(70px, $basepx);
    height: em(70px, $basepx);
    border: 3px solid rgba(246, 200, 102, 0.31);
    border-radius: 50%;
    @include prefix(transform, rotate(-30deg));
    .cone{
      position: absolute;
      top: 50%;
      left: 50%;
      @include prefix(transform, translate(-50%, -20%));
      border-right: em(18px, $basepx) solid transparent;
      border-left: em(18px, $basepx) solid transparent;
      border-top: em(40px, $basepx) solid #f4b224;
      &:after{
        content: "";
        position: absolute;
        width: em(20px, $basepx);
        height: em(20px, $basepx);
        background: #00c0a8;
        border-radius: 50%;
        top: em(-55px, $basepx);
        left: 0px;
        z-index: -1;
      }
      &:before{
        content: "";
        position: absolute;
        width: em(20px, $basepx);
        height: em(20px, $basepx);
        background: #ffd132;
        border-radius: 50%;
        top: em(-55px, $basepx);
        left: em(-20px, $basepx);
        z-index: -1;
        box-shadow: 10px -5px 0px 0px #ff9a9a;
      }      
    }
  }
}

.wind{
  position: absolute;
  z-index: -1;
  right: 100%;
  height: 100%;
  margin-right: em(-20px, $basepx);
  .p{
    position: absolute;
    background: #fff;
    border-radius: em(10px, $basepx);    
    height: em(10px, $basepx);
  }
  .p1{
    width: em(70px, $basepx);
    position: absolute;
    right: 0;
    top: em(25px, $basepx);
    animation: wind 1s -1s linear infinite;
  }
  .p2{
   width: em(100px, $basepx);
   right: em(40px, $basepx);
   top: em(60px, $basepx); 
    animation: wind 1s -2s linear infinite;
  }
  .p3{
   width: em(50px, $basepx);
   right: em(00px, $basepx);
   top: em(105px, $basepx); 
    animation: wind 1s -1s linear infinite;
  } 
  .p4{
   width: em(60px, $basepx);
   right: em(100px, $basepx);
   top: em(135px, $basepx); 
    animation: wind 1s 1s linear infinite;
  }   
  .p5{
   width: em(70px, $basepx);
   right: em(30px, $basepx);
   top: em(145px, $basepx); 
    animation: wind 1s -1.5s linear infinite;
  }     
}

.car-wrapper_inner{
  position: relative;
  z-index: 4;
}

@keyframes carMove{
  0%{
    transform: translateY(0px);
  }
  50%{
   transform: translateY(-1px); 
  }
  100%{
    transform: translateY(0px);
  }
}

@keyframes wind{
  0%{
    transform: translateX(100%);
    opacity: 1;
  }
  100%{
    transform: translateX(-400%);
    opacity: 0;
  }
}

.car_outter{
  @include prefix(transform, translateX(-100%));
  position: relative;
  animation: carDrive 5s 1s cubic-bezier(0.88, 0.08, 0.16, 1.1) infinite;
}

@keyframes carDrive{
  0%{
    transform: translateX(-100%);
  }
  25%{
    transform: translateX(0%);
  }
  70%{
    transform: translateX(0%);
  }
  100%{
    transform: translateX(100%);
  }
}

@keyframes bgIn{
  0%{
    left: 100%;
  }
  100%{
    left: -100%;
  }
}

@keyframes wrapperIn{
  0%{
    transform: scale(0);
    opacity: 0;
  }
  100%{
    transform: scale(1);
    opacity: 1;
  }
}
              
            
!

JS

              
                /* inspired by: https://dribbble.com/shots/2612733-Fresh-meat-delivery */
              
            
!
999px

Console