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 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.

            
              <html>
<head></head>
  <body>
    <div class="container">
      <div class="boombox">
        <div class="lights"></div>
        <div class="lines"></div>
        <div class="speaker"></div>
        <div class="speaker"></div>
      </div>
      <div class="shadow"></div>
    </div>
  </body>
</html>
            
          
!
            
              @keyframes music {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(102, 102, 102, 0.4);
    -webkit-box-shadow: 0 0 0 0 rgba(102, 102, 102, 0.4);
    box-shadow: 0 0 0 0 rgba(102, 102, 102, 0.4);
  }
  70% {
    -moz-box-shadow: 0 0 0 30px rgba(102, 102, 102, 0);
    -webkit-box-shadow: 0 0 0 30px rgba(102, 102, 102, 0);
    box-shadow: 0 0 0 30px rgba(102, 102, 102, 0);
  }
  100% {
    -moz-box-shadow: 0 0 0 0 rgba(102, 102, 102, 0);
    -webkit-box-shadow: 0 0 0 0 rgba(102, 102, 102, 0);
    box-shadow: 0 0 0 0 rgba(102, 102, 102, 0);
  }
}

@keyframes dance-and-bounce {
  0% {
    -moz-transform: rotate(0deg) translateY(0px);
    -webkit-transform: rotate(0deg) translateY(0px);
    transform: rotate(0deg) translateY(0px);
  }
  16.6% {
    -moz-transform: rotate(0deg) translateY(-20px);
    -webkit-transform: rotate(0deg) translateY(-20px);
    transform: rotate(0deg) translateY(-20px);
  }
  33.2%{
    -moz-transform: rotate(0deg) translateY(0px);
    -webkit-transform: rotate(0deg) translateY(0px);
    transform: rotate(0deg) translateY(0px);
  }
  49.8%{
    -moz-transform: rotate(-10deg) translateY(0px);
    -webkit-transform: rotate(-10deg) translateY(0px);
    transform: rotate(-10deg) translateY(0px);
  }
  66.4%{
    -moz-transform: rotate(0deg) translateY(0px);
    -webkit-transform: rotate(0deg) translateY(0px);
    transform: rotate(0deg) translateY(0px);
  }
  83%{
    -moz-transform: rotate(10deg) translateY(0px);
    -webkit-transform: rotate(10deg) translateY(0px);
    transform: rotate(10deg) translateY(0px);
  }
  100%{
    -moz-transform: rotate(0deg) translateY(0px);
    -webkit-transform: rotate(0deg) translateY(0px);
    transform: rotate(0deg) translateY(0px);
  }
}

@keyframes click {
  0%, 25%, 50%, 75% {
    background-color: #7ff0fd; 
  }
  100% {
    background-color: #103950; 
  }
}

@keyframes change-background {
  0% {
    background: #16a085;
  }
  25% {
    background: #1abc9c;
  }
  50% {
    background: #9b59b6;
  }
  75% {
    background: #8e44ad;
  }
  100% {
    background: #16a085;
  }
}

@keyframes shadow {
  0% {
    left: -25px;
    width: 275px;
    background: #11806a;
  }
  16.6% {
    left: 25px;
    width: 200px;
  }
  25% {
    background: #14967c;
  }
  33.2%{
    left: -25px;
    width: 275px;
  }
  50% {
    background: #7c4791;
  }
  75% {
    background: #71368a;
  }
  100% {
    background: #11806a;
  }
}

body{
  background-color: #ccc;
  -moz-animation: change-background 2s infinite;
  -webkit-animation: change-background 2s infinite;
  animation: change-background 2s infinite;
  -moz-animation-delay: 2s;
  -webkit-animation-delay: 2s;
  animation-delay: 2s;
}

.container {
  position: fixed;
  top: 50%;
  left: 50%;
  -moz-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.boombox {
  position: relative;
  width: 200px;
  height: 120px;
  border: 12px solid #103950;
  -moz-border-radius: 18px;
  -webkit-border-radius: 18px;
  border-radius: 18px;  
  background-color: #fff;
  -webkit-animation: dance-and-bounce 2s infinite;
  -moz-animation: dance-and-bounce 2s infinite;
  animation: dance-and-bounce 2s infinite;
  -moz-animation-delay: 2s;
  -webkit-animation-delay: 2s;
  animation-delay: 2s;
  z-index: 2;
  
  &:before, &:after{
    content:'';
    position: absolute;
    width: 150px;
    border: 10px solid #103950;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
  }
  
  &:before {
    top: -48px;
    left: 16px;
    height: 10px;
    background-color: #ffcf54;
    border-bottom-width: 8px;
  }
  
  &:after{
    border-top: 0;
    height: 15px;
    top: -26px;       
    left: 16px;
  }
  
  .lights {
    position: absolute;
    top: 10px;
    left: 38px;
    width: 12px;
    height: 12px;
    background-color: #7ff0fd;
    -moz-border-radius: 50px;
    -webkit-border-radius: 50px;
    border-radius: 50px;
    -moz-animation: click 1s 1s;
    -webkit-animation: click 1s 1s;
    animation: click 1s 1s;
    
    &:before, &:after {
      content: '';
      position: absolute;
      width: 12px;
      height: 12px;
      -moz-border-radius: 50px;
      -webkit-border-radius: 50px;
      border-radius: 50px;
    }
    
    &:before {
      background-color: #ffcf54;
      left: -20px;
    }
    
    &:after {
      background-color: #7ff0fd;
      left: 20px;
    }
  }
  
  .lines {
    position: absolute;
    border: 2px solid #103950;
    width: 90px;
    top: 18px;
    left: 90px;
    
    &:before{
      content:'';
      position: absolute;
      border: 2px solid #103950;
      width: 90px;
      top: -10px;
      left: -2px;
    }
  }
  
  .speaker {
    position: absolute;
    border: 15px solid #7ff0fd;
    -moz-border-radius: 100px;
    -webkit-border-radius: 100px;
    border-radius: 100px;
    -moz-box-shadow: 0px 0px 0px 10px #103950;
    -webkit-box-shadow: 0px 0px 0px 10px #103950;
    box-shadow: 0px 0px 0px 10px #103950;
    height:30px;
    width:30px;
    left: 20px;
    top: 40px;
    
    &:last-child {
      left: 120px;
    }
    
    &:before{
      content:'';
      position: absolute;
      -moz-border-radius: 100px;
      -webkit-border-radius: 100px;
      border-radius: 100px;
      -moz-box-shadow: 0px 0px 0px 0px #fff;
      -webkit-box-shadow: 0px 0px 0px 0px #fff;
      box-shadow: 0px 0px 0px 0px #fff;
      height:70px;
      width:70px;
      left: -20px;
      top: -20px;
      -moz-animation: music .5s infinite;
      -webkit-animation: music .5s infinite;
      animation: music .5s infinite;
      -moz-animation-delay: 2s;
      -webkit-animation-delay: 2s;
      animation-delay: 2s;
    }
  }
}

.shadow {
  position: absolute;
  bottom: -30px;
  left: -25px;
  width: 275px;
  height: 40px;
  background: #b7b7b7;
  border-radius: 50%;
  animation: shadow 2s infinite;
  animation-delay: 2s;
}
            
          
!
999px
Loading ..................

Console