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

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 id="helicopter">
  <div class="fuselage"></div>
  <div id="rotor"></div>
  <div id="smallrotor"></div>
  <div class="rotor-hole"></div>
  <div class="rotor-mount"></div>
  <div class="back"></div>
  <div class="tail"></div>
  <div class="conjoiner"></div>
  <div class="tail-white"></div>
  <div class="stripe"></div>
  <div class="landing-gear"></div>
  <div class="landing-gear2"></div>
  <div class="gear_bottom"></div>
  <div class="window"></div>
  <div class="Letter">
    <p>VIYATH</p>
  </div>
  <div class="man_head"></div>
  <div class="man_head_visor"></div>
  <div class="man"></div>
</div>
<div class="floor">
  <div class="ground"></div>
  <div class="helipad"></div>
  <div class="letters">Programmed by Viyath</div>
</div>
</div>
<button id="startbtn">TAKE-OFF</button>
<button id="stopbtn">LAND</button>
              
            
!

CSS

              
                body {
  animation-name: night;
  animation-duration: 60s;
}
/*For the night*/
@keyframes night {
  0% {
    background-color: #cdccff;
  }
  50% {
    background-color: #070429;
  }
  100% {
    background-color: #cdccff;
  }
}
/*Entire helicopter*/
#helicopter {
  position: relative;
  left: -440px;
  top: -95px;
  transform: scale(0.6);
}
/*Biggest part of the helicopter*/
.fuselage {
  width: 350px;
  height: 200px;
  border-radius: 50%;
  background-color: grey;
  border: 13px black solid;
  z-index: 1;
  position: relative;
  top: 120px;
  left: 800px;
}
/*Connector for blades*/
.rotor-mount {
  width: 50px;
  height: 20px;
  background-color: black;
  position: absolute;
  top: 105px;
  left: 950px;
}
/*Tail section*/
.back {
  width: 350px;
  height: 50px;
  background-color: grey;
  border: 13px black solid;
  position: absolute;
  top: 200px;
  left: 1120px;
}
/*Smooth connection with body and tail*/
.conjoiner {
  height: 50px;
  width: 100px;
  background-color: grey;
  position: relative;
  z-index: 2;
  top: -13px;
  left: 1100px;
}
/*For the triangle at the back of the helicopter*/
.tail {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 140px 100px;
  border-color: transparent transparent black transparent;
  position: absolute;
  z-index: 1;
  top: 70px;
  left: 1396px;
}
/*Holds the tail in place*/
.tail-white {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 110px 70px;
  border-color: transparent transparent red transparent;
  position: absolute;
  z-index: 3;
  top: 90px;
  left: 1419px;
  transform: rotate(1deg);
}
/*The stripe on the helicopter*/
.stripe {
  height: 30px;
  width: 670px;
  border-radius: 10px 0px 0px 10px;
  background-color: red;
  position: absolute;
  z-index: 3;
  left: 813px;
  top: 220px;
}
/*Rotor*/
#rotor {
  width: 800px;
  height: 20px;
  background-color: black;
  border-radius: 10px;
  position: absolute;
  top: 100px;
  left: 600px;
}
/*Small rotor*/
#smallrotor {
  width: 10px;
  height: 70px;
  background-color: black;
  border-radius: 10px;
  position: absolute;
  top: 193px;
  left: 1446px;
  z-index: 6;
}
/*White hole outside the small rotor at the back*/
.rotor-hole {
  height: 70px;
  width: 70px;
  border-radius: 50%;
  border: 2px black solid;
  background-color: white;
  position: absolute;
  left: 1413px;
  top: 191px;
  z-index: 4;
}
/*Landing gear*/
.landing-gear {
  height: 50px;
  width: 20px;
  background-color: black;
  position: relative;
  left: 930px;
  top: 50px;
}
.landing-gear2 {
  height: 50px;
  width: 20px;
  background-color: black;
  position: relative;
  left: 1000px;
  top: 0px;
}
.gear_bottom {
  height: 20px;
  width: 220px;
  background-color: black;
  position: relative;
  left: 870px;
  top: 0px;
}
/*Window*/
.window {
  height: 70px;
  width: 150px;
  background-color: #dcdcdc;
  border: 3px black solid;
  border-radius: 300px 40px 0px 0px;
  position: relative;
  left: 815px;
  top: -250px;
  z-index: 5;
}
/*My name-"Viyath"*/
.Letter {
  position: relative;
  left: 1250px;
  top: -280px;
  z-index: 4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  font-weight: bold;
}
/*green ground*/
.ground {
  transform: scale(0.6);
  height: 100px;
  width: 1000px;
  background-color: #33ff33;
  border: 2px black solid;
  position: relative;
  left: -200px;
  top: -400px;
}
/*Pilot's head*/
.man_head {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background-color: red;
  z-index: 6;
  position: relative;
  top: -410px;
  left: 890px;
}
/*Pilot's helmet*/
.man_head_visor {
  height: 14px;
  width: 14px;
  background-color: grey;
  border-radius: 5px 0px 0px 5px;
  border: 2px black solid;
  z-index: 6;
  position: relative;
  top: -440px;
  left: 890px;
}
/*Pilot*/
.man {
  height: 27px;
  width: 20px;
  background-color: black;
  position: relative;
  top: -430px;
  left: 897px;
  z-index: 6;
  transform: rotate(1deg);
  border-right: 6px solid black;
}
/*Black helipad*/
.helipad {
  transform: scale(2.34);
  height: 15px;
  width: 90px;
  border-radius: 0 0 90px 90px;
  background: black;
  position: relative;
  left: 220px;
  top: -472px;
  z-index: 2;
}
/*My name again!*/
.letters {
  position: relative;
  left: 192px;
  top: -485px;
  z-index: 4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  text-decoration: italic;
  font-weight: bold;
  color: white;
}
/*Land button*/
#stopbtn {
  position: relative;
  background-color: #33ff33;
  border: 2px solid black;
  border-radius: 8px;
  color: black;
  top: -500px;
  left: 280px;
  z-index: 3;
  font-size: 14px;
}
#stopbtn:hover {
  position: relative;
  background-color: green;
  border: 2px solid black;
  border-radius: 8px;
  color: black;
  top: -500px;
  left: 280px;
  z-index: 3;
  font-size: 14px;
  cursor: pointer;
}
/*Takeoff button*/
#startbtn {
  position: relative;
  background-color: #33ff33;
  border: 2px solid black;
  border-radius: 8px;
  color: black;
  top: -500px;
  left: 80px;
  z-index: 3;
  font-size: 14px;
}
#startbtn:hover {
  position: relative;
  background-color: green;
  border: 2px solid black;
  border-radius: 8px;
  color: black;
  top: -500px;
  left: 80px;
  z-index: 3;
  font-size: 14px;
  tranform: scale(1.5);
  cursor: pointer;
}
/*Animation of helicopter*/
@keyframes main1 {
  0% {
    top: -95px;
    left: -440px;
    transform: scale(0.6);
  }
  10% {
    left: -800px;
    top: -400px;
    transform: rotate(-10deg) scale(0.6);
  }
  15% {
    left: -1200px;
    top: -400px;
    transform: scale(0.6);
  }
  20% {
    left: -2300px;
    top: -400px;
    transform: scale(0.6);
  }
  21% {
    top: -400px;
    left: 200px;
    transform: scale(0.6);
  }
  80% {
    top: -95px;
    left: -440px;
    transform: rotate(0deg);
    transform: scale(0.6);
  }
  100% {
    top: -95px;
    left: -440px;
    transform: scale(0.6);
  }
}
/*Animation of main rotor*/
@keyframes spin {
  0% {
    width: 800px;
    left: 580px;
  }
  50% {
    width: 400px;
    left: 780px;
  }
  100% {
    width: 800px;
    left: 580px;
  }
}
/*Animation for small rotor*/
@keyframes smallrtr {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/*Animation for landing*/
@keyframes land {
  100% {
    top: 305px;
    left: 1100px;
  }
}

              
            
!

JS

              
                var x = 1000;
startbtn.addEventListener("click", function () {
  
  helicopter.style.animation = "main1 14s linear 2s infinite";
  rotor.style.animation = "spin 0.1s linear infinite";
  smallrotor.style.animation = "smallrtr 0.1s linear infinite";
});
stopbtn.addEventListener("click", function () {
  helicopter.style.animation = "";
  rotor.style.animation = "";
  smallrotor.style.animation = "";
});

              
            
!
999px

Console