Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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="body">

       
        <div class="silver"></div>
        <div class="speaker-left"></div>
        <div class="speaker-right"></div>
        
        <div class="screen"></div>

        <div class="outer"> 
        <p id="power-on"></p>
        <div id="screen-on"></div>

        <div id="animation"></div>
        <div id="device">DEVICE CONNECTED</div>
    </div>


        <img class="logo" src="https://cdn1.umg3.net/685/files/2017/02/bush-logo.png">

        <audio id="myAudio">
            <source src="bensound-energy.mp3" type="audio/ogg">
        
          </audio>
        
        <div class="btn btn-1"  onclick="myFunction()"><span>Power</span></div> 
        <div class="btn btn-2"><span>Mode</span></div>
        <div class="btn btn-3"><span>Menu</span></div>
        <div class="btn btn-4"><span>Alarm</span></div>
        <div class="btn btn-5"><span>Snooze</span></div>
        <div class="btn btn-6"onclick="scanDevice()"><span>Scan</span></div>
        <div class="btn btn-7"><span>Preset</span></div>
        <div class="btn btn-8 " onclick="playAudio()" ><span>Play</span></div>
        <div class="btn btn-9"  onclick="pauseAudio()" ><span>Pause</span></div>
        <div class="btn btn-10"><span>Stop</span></div>

        <div class="btn-tune"><span>Tune</span></div>
        <div class="btn-tune btn-volume"><span>Volume</span></div>

    </div>

    <div class="body-top"></div>
    <div class="antena"></div>

    </div
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap');
body {
     width: 100vw;
     height: 100vh;
     font-family: 'Noto Sans', sans-serif;
     
}

.container { 
 
    width: 70%;
    height: 85%;
    background-size: 1300px;
    position: relative;
    top: 10%;
}

.body {
    width: 1080px;
    height: 600px;
    background: rgb(73,75,86);
    background: linear-gradient(90deg, rgba(73,75,86,1) 11%, rgba(74,76,89,1) 79%);
    position: relative;
    left: 8%;
    top: 21%;
    border-radius: 80px;    z-index: 1;
    box-shadow: 0px 30px 34px 9px rgba(0,0,0,0.3);
}

.body-top {
    width: 1060px;
    height: 600px;
    background: rgb(44,46,51);
    background: linear-gradient(90deg, rgba(44,46,51,1) 0%, rgba(66,66,78,1) 12%, rgba(61,66,73,1) 48%, rgba(64,67,80,1) 78%, rgba(50,51,59,1) 98%);
    position: absolute;
    left: 9%;
    top: 15%;
    border-radius: 120px;
    z-index: 0;
   
}

.silver {
    width: 96%;
    height: 90%;
    background: rgb(223,222,224);
background: linear-gradient(90deg, rgba(223,222,224,1) 4%, rgba(221,218,221,1) 67%, rgba(226,224,227,1) 95%);
    position: absolute;
    left: 2%;
    top: 5%;
    border-radius: 230px;
    box-shadow: 10px 10px 5px 0px  #43464f;
   
}

.speaker-left {
    position: absolute;
    width: 28%;
    height: 80%;
    background-color: #818181;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23b7b4b7' fill-opacity='0.4' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
background-size: 8px;   
border-radius: 50% 10% 10% 50% / 50% 50% 50% 50%;
    left: 5%;
    top: 10%;
    border: 3px solid #6e6e74;
   
}

.speaker-left:after {
    content: "";
    position: absolute;
    width: 80%;
    height: 50%;
    border-radius: 50%;
    background-color:rgba(60, 58, 60,0.2);
    left: 10%;
    top: 25%;
  }

.speaker-right {
    position: absolute;
    width: 28%;
    height: 80%;
    background-color: #818181;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23b7b4b7' fill-opacity='0.4' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 8px;   
    border-radius: 50% 10% 10% 50% / 50% 50% 50% 50%;
    right: 5%;
    top: 10%;
    transform: rotate(180deg);
    border: 3px solid #6e6e74;
}

.speaker-right:after {
    content: "";
    position: absolute;
    width: 80%;
    height: 50%;
    border-radius: 50%;
    background-color:rgba(60, 58, 60,0.2);
    left: 10%;
    top: 25%;
  }

.screen {
    position: absolute;
    width: 30%;
    height: 31%;
    background-color: #323234;
    border-radius: 40px;
    left: 35%;
    top: 10%;
    transform: rotate(180deg);
    box-shadow: -10px -10px 5px 0px rgba(0,0,0,0.1);
}

.antena {
  width: 85%;
    height: 3%;
    background: rgb(159,159,159);
    background: linear-gradient(0deg, rgba(159,159,159,1) 2%, rgba(136,136,136,1) 27%, rgba(49,49,49,1) 44%, rgba(117,117,117,1) 66%, rgba(188,188,188,1) 70%, rgba(223,223,223,1) 81%, rgba(206,206,206,1) 95%, rgba(70,70,70,1) 100%);
    z-index: -1;
    position: absolute;
    left: 10%;
    top: 10%;
    transform: rotate(-10deg);
}

.antena:before {
  content: "";
  position: absolute;
  width: 3%;
  height: 130%;
  background: rgb(200,200,200);
background: linear-gradient(0deg, rgba(200,200,200,1) 2%, rgba(144,144,144,1) 25%, rgba(143,143,143,1) 49%, rgba(208,208,208,1) 83%, rgba(101,101,101,1) 100%);
  left: 100%;
  top: -10%;
  border-left: 5px solid rgb(126, 126, 126);
}

.logo {
  position: absolute;
  z-index: 10;
  width: 10%;
  left: 45%;
  top: 12%;
}

.btn-tune {
    position: absolute;
    width: 8%;
    height: 15%;
   border: 3px solid #434043;
    border-radius: 50%;
    left:37%;
    top: 72%;
    background-color: #b3b1b4;
    box-shadow: -1px 12px 24px 10px rgba(0,0,0,0.4);
}

.btn-tune:before {
    content: "";
    position: absolute;
    width: 110%;
    height: 110%;
    background: rgb(98,97,98);
    background: linear-gradient(0deg, rgba(98,97,98,1) 3%, rgba(163,161,164,1) 9%, rgba(64,61,64,1) 33%, rgba(122,119,123,1) 43%, rgba(164,161,165,1) 57%, rgba(244,241,244,1) 66%, rgba(56,53,56,1) 86%);
    border-radius: 50%;
    left:-5%;
    top: 5%;
    z-index: 5;
  }

.btn-tune:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgb(239,236,240);
background: radial-gradient(circle, rgba(239,236,240,1) 36%, rgba(217,214,217,1) 62%, rgba(212,209,213,1) 80%);
    border-radius: 50%;
    left:0%;
    top: 10%;
    z-index: 5;
    box-shadow: inset -1px -10px 24px 5px rgba(0,0,0,0.2);
  }

  .btn-tune span {
font-weight: bold;
color:  #494b56;
position: absolute;
top: -30px;
left: 25px;
font-size: 0.8rem;
  }

  .btn-volume {
    left: 55%;
  }

  
  .btn {
    position: absolute;
    width: 2.4%;
    height: 4.4%;
   border: 2px solid #434043;
    border-radius: 50%;
    left:38%;
    top: 45%;
    background-color: #b3b1b4;
    box-shadow: -1px 12px 24px 0px rgba(0,0,0,0.3);
    cursor: pointer;
}

  .btn:before {
    content: "";
    position: absolute;
    width: 115%;
    height: 115%;
    background: rgb(98,97,98);
    background: linear-gradient(0deg, rgba(98,97,98,1) 3%, rgba(163,161,164,1) 9%, rgba(64,61,64,1) 33%, rgba(122,119,123,1) 43%, rgba(164,161,165,1) 57%, rgba(244,241,244,1) 66%, rgba(56,53,56,1) 86%);
    border-radius: 50%;
    left:-8%;
    top: 3%;
    z-index: 5;
  }

.btn:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgb(239,236,240);
background: radial-gradient(circle, rgba(239,236,240,1) 36%, rgba(217,214,217,1) 62%, rgba(212,209,213,1) 80%);
    border-radius: 50%;
    left:0%;
    top: 10%;
    z-index: 5;
    
  }

  .btn span {
font-weight: bold;
color:  #494b56;
position: absolute;
top: -20px;
left: -5px;
font-size: 0.7rem;
  }

  .btn-2 {
left: 43%;
  }
  .btn-3 {
    left: 48%;
      }
      .btn-4 {
        left: 53%;
          }
          .btn-5 {
            left: 58%;
              }
              .btn-6 {
               
                top: 55%;
                  }
                  .btn-7 {
                    left:43%;
                    top: 55%;
                      }
                      .btn-8 {
                        left:48%;
                        top: 55%;
                          }
                          .btn-9 {
                            left:53%;
                            top: 55%;
                              }
                              .btn-10 {
                                left:58%;
                                top: 55%;
                                  }

                                  @import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
                                  #power-on {
                                   color: rgb(210, 224, 226);
                                    position: absolute;
                                      z-index: 25;
                                    font-size: 2.5rem;
                                    top: 14%;
                                    left: 10%;
                                    font-family: 'VT323', monospace;
                                   
                                  }


    #animation {
    
      animation: scroll-left 15s linear infinite;
      transform:translateX(10%);
      color: rgb(210, 224, 226);
      position: absolute;
        z-index: 25;
      font-size: 2.5rem;
      top: 35%;
      left: 10%;
      font-family: 'VT323', monospace;
      width: 170%;
    }                              
  

@keyframes scroll-left {
 0%   { 
 -moz-transform: translateX(50%); 
 -webkit-transform: translateX(50%); 
 transform: translateX(50%); 		
 }
 100% { 
 -moz-transform: translateX(-100%); 
 -webkit-transform: translateX(-50%); 
 transform: translateX(-50%); 
 }
}


                                  

                                 
                                #screen-on {
                                  width: 100%;
                                  height: 55%;
                                  background: #555558;
                                  position: absolute;
                                  z-index: 20;
                                  left: 0%;
                                  top: 30%;
                                  opacity: 0;
                                  transition: ease-in 0.5s;
                                }

                                #device {
                                  color: rgb(210, 224, 226);
                                   position: absolute;
                                     z-index: 25;
                                   font-size: 1rem;
                                   top: 70%;
                                   left: 10%;
                                   font-family: 'VT323', monospace;
                                   opacity: 0;
                                 }




                                 .outer {
                                  position: absolute;
                                  width: 30%;
                                  height: 31%;
                                 
                                  border-radius: 40px;
                                  left: 35%;
                                  top: 10%;
                                  
                                  box-shadow: -10px -10px 5px 0px rgba(0,0,0,0.1);
                                  overflow: hidden;
                              }
                              
              
            
!

JS

              
                   function myFunction() {
        
          document.getElementById("screen-on").style.opacity = "1";
          document.getElementById("power-on").innerHTML = "POWER ON";
          document.getElementById("device").style.opacity = "0";
          document.getElementById("animation").innerHTML = "";
        }

        var x = document.getElementById("myAudio"); 

function playAudio() { 
  x.play(); 
  document.getElementById("power-on").innerHTML = "";
  document.getElementById("screen-on").style.opacity = "1";
  document.getElementById("device").style.opacity = "1";
  document.getElementById("animation").innerHTML = "NOW PLAYING - ENERGY - BEN SOUND";
} 

function pauseAudio() { 
  x.pause();
  document.getElementById("power-on").innerHTML = "PAUSED";
  document.getElementById("screen-on").style.opacity = "1";
  document.getElementById("device").style.opacity = "1";
  document.getElementById("animation").innerHTML = "";
} 
   

function scanDevice() {
        
        document.getElementById("screen-on").style.opacity = "1";
        document.getElementById("power-on").innerHTML = "SCANNING DEVICE";
        document.getElementById("animation").innerHTML = "";
      }

     
              
            
!
999px

Console