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">
  <!-- Base -->
  <div class="base"></div>
  <div class="power-button"></div>
  <div class="volume-button"></div>
  <div class="audio-meter-top"></div>
  <div class="audio-meter-bottom"></div>

  <!-- Turntable -->
  <div class="record"></div>
  <div class="record-center"></div>
  <div class="record-ring-1"></div>
  <div class="record-ring-2"></div>

  <!-- Slider -->
  <div class="slider-base"></div>
  <div class="slider-rail"></div>
  <div class="slider-button"></div>

  <!-- Tone arm -->
  <div class="tonearm-unit">
    <div class="arm-base"></div>
    <div class="weight-arm"></div>
    <div class="weight"></div>
    <div class="tone-arm"></div>
    <div class="pivot-base"></div>
    <div class="pivot-mech"></div>
    <div class="headshell"></div>
  </div>
</div>
              
            
!

CSS

              
                /* Turntable */
.base {
  width: 474px;
  height: 355px;
  background: white;
  position: absolute;
  left: 13px;
  top: 72px;
  border: solid 2px gray;
  border-radius: 5px;
}

.power-button {
  width: 24px;
  height: 24px;
  background: lightgray;
  position: absolute;
  left: 36px;
  top: 91px;
  border: solid 4px gray;
  border-radius: 10%;
  animation: power-button linear 10s infinite;
}

@keyframes power-button {
  from {
    border: solid 4px gray;
  }
  10% {
    border: solid 4px gray;
  }
  12% {
    border: solid 4px #f99f3e;
    box-shadow: inset 0 0 5px gray;
  }
  88% {
    border: solid 4px #f99f3e;
    box-shadow: inset 0 0 5px gray;
  }
  91% {
    border: solid 4px gray;
  }
  to {
    border: solid 4px gray;
  }
}

.volume-button {
  width: 33px;
  height: 33px;
  background: lightgray;
  position: absolute;
  left: 32px;
  top: 368px;
  border-radius: 50%;
  border: solid 4px gray;
}

.volume-button::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: gray;
  top: 4px;
  left: 12px;
}

/* Record */
.record-center {
  width: 104px;
  height: 104px;
  background: #170468;
  position: absolute;
  left: 139px;
  top: 178px;
  border-radius: 50%;
  border: solid 20px black;
}

.record-center::before {
  content: "";
  position: absolute;
  width: 12.5px;
  height: 12.5px;
  border-radius: 50%;
  background: white;
  top: 46px;
  left: 45px;
}

.record-ring-1 {
  width: 191px;
  height: 191px;
  background: transparent;
  position: absolute;
  left: 112px;
  top: 151px;
  border-radius: 50%;
  border: solid 1.5px darkgray;
  border-top: solid 1.5px black;
}

.record-ring-2 {
  width: 245px;
  height: 245px;
  background: transparent;
  position: absolute;
  left: 86px;
  top: 125px;
  border-radius: 50%;
  border: solid 1.5px darkgray;
  border-left: solid 1.5px black;
  border-right: solid 1.5px black;
}

.record {
  width: 303px;
  height: 303px;
  background: gray;
  position: absolute;
  left: 44px;
  top: 83px;
  border-radius: 50%;
  border: solid 15px lightgrey;
  filter: blur(0.5px);
}

.record::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 152px solid #555555;
  border-right: 152px solid #444444;
  border-bottom: 152px solid #555555;
  border-left: 152px solid #444444;
  border-radius: 50%;
}

.record-ring-1,
.record-ring-2,
.record {
  animation: record linear 10s infinite;
}

@keyframes record {
  from {
    transform: rotate(0deg);
  }
  12% {
    transform: rotate(0deg);
  }
  92% {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Slider */
.slider-base {
  width: 30px;
  height: 156px;
  background: gray;
  position: absolute;
  left: 432px;
  top: 250px;
  border-radius: 5px;
}

.slider-rail {
  width: 6px;
  height: 127px;
  background: black;
  position: absolute;
  left: 445px;
  top: 266px;
}

.slider-button {
  width: 14px;
  height: 14.5px;
  background: lightgray;
  position: absolute;
  left: 436px;
  top: 310px;
  border: solid 5px white;
  border-radius: 15%;
  animation: slider-button linear 10s infinite;
}

@keyframes slider-button {
  from {
    top: 310px;
  }
  12% {
    top: 310px;
    background: lightgray;
  }
  14% {
    top: 285px;
    background: #f99f3e;
    box-shadow: 0px 1px 2px #2b2b2b;
  }
  89% {
    top: 285px;
    background: #f99f3e;
    box-shadow: 0px 1px 2px #2b2b2b;
  }
  91% {
    top: 310px;
    background: lightgray;
  }
  to {
    top: 310px;
  }
}

/* Tonearm Unit */
.tonearm-unit {
  position: absolute;
  width: 79px;
  height: 79px;
  left: 372px;
  top: 108px;
  transform-origin: center;
  animation: tonearm-unit linear 10s infinite;
}

@keyframes tonearm-unit {
  from {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(13deg);
  }
  50% {
    transform: rotate(20deg);
  }
  93% {
    transform: rotate(30deg);
  }
  to {
    transform: rotate(0deg);
  }
}

/* Arm */
.arm-base {
  width: 79px;
  height: 79px;
  background: black;
  position: absolute;
  left: 0px;
  top: 0px;
  border-radius: 50%;
}

.arm-base::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: lightgray;
  top: 52px;
  left: 56px;
}

.pivot-base {
  width: 40px;
  height: 40px;
  background: lightgray;
  position: absolute;
  left: 20px;
  top: 18px;
  border-radius: 50%;
}

.pivot-mech {
  width: 14px;
  height: 40px;
  background: white;
  position: absolute;
  left: 39px;
  top: 7px;
  transform: rotate(-44deg);
  transform-origin: bottom left;
  border-radius: 15px 15px 30px 30px;
}

.weight-arm {
  width: 13px;
  height: 48px;
  background: darkgray;
  position: absolute;
  left: 40px;
  top: -25px;
  transform: rotate(20deg);
  transform-origin: bottom;
  border-radius: 4px 4px 0px 0px;
}

.weight {
  width: 27px;
  height: 35px;
  background: dimgray;
  position: absolute;
  left: 35px;
  top: -20px;
  transform: rotate(20deg);
  transform-origin: bottom;
  border-radius: 4px;
}

.weight::before {
  content: "";
  width: 27px;
  height: 12px;
  background: lightgray;
  position: absolute;
  left: 0px;
  top: 9px;
}

/* Tonearm */
.tone-arm {
  width: 14px;
  height: 159px;
  background: darkgray;
  position: absolute;
  left: 32px;
  top: 56px;
  border-radius: 0px 0px 2px 0px;
}

.tone-arm::before {
  content: "";
  width: 14px;
  height: 60px;
  background: darkgray;
  position: absolute;
  left: 5px;
  top: 152px;
  transform: rotate(38deg);
  transform-origin: top;
  border-radius: 0px 9px 0px 0px;
}

.headshell {
  width: 22px;
  height: 40px;
  background: black;
  position: absolute;
  left: -25px;
  top: 238px;
  transform: rotate(44deg);
  transform-origin: bottom;
  border-radius: 30px 30px 15px 15px;
}

.headshell::before {
  content: "";
  width: 17px;
  height: 5px;
  background: gray;
  position: absolute;
  left: 22px;
  top: 17px;
  transform: rotate(0deg);
  transform-origin: bottom;
  border-radius: 0px 5px 5px 0px;
}

.headshell::after {
  content: "";
  width: 5px;
  height: 5px;
  background: black;
  position: absolute;
  left: 9px;
  top: 31px;
  border-radius: 50%;
  animation: headshell-light linear 10s infinite;
}

@keyframes headshell-light {
  from {
    background: black;
  }
  19% {
    background: black;
  }
  20% {
    background: #f99f3e;
  }
  25% {
    background: black;
  }
  30% {
    background: #f99f3e;
  }
  35% {
    background: black;
  }
  40% {
    background: #f99f3e;
  }
  55% {
    background: black;
  }
  65% {
    background: #f99f3e;
  }
  70% {
    background: black;
  }
  75% {
    background: #f99f3e;
  }
  80% {
    background: black;
  }
  84% {
    background: #f99f3e;
  }
  86% {
    background: black;
  }
  87% {
    background: #f99f3e;
  }
  88% {
    background: black;
  }
  90% {
    background: #f99f3e;
  }
  91% {
    background: black;
  }
  to {
    background: black;
  }
}

/* Audio Meter */
.audio-meter-top {
  position: absolute;
  width: 5px;
  height: 50px;
  left: 20px;
  top: 180px;
  background: linear-gradient(
      to bottom,
      #ff0d0d,
      #ff0d0d 4px,
      transparent 4px,
      transparent 5px,
      #ff2d2d 5px,
      #ff2d2d 9px,
      transparent 9px,
      transparent 10px,
      #ffb633 10px,
      #ffb633 14px,
      transparent 14px,
      transparent 15px,
      #ffad18 15px,
      #ffad18 19px,
      transparent 19px,
      transparent 20px,
      #feff0f 20px,
      #feff0f 24px,
      transparent 24px,
      transparent 25px,
      #feff0f 25px,
      #feff0f 29px,
      transparent 29px,
      transparent 30px,
      #6cdf01 30px,
      #6cdf01 34px,
      transparent 34px,
      transparent 35px,
      #56df01 35px,
      #56df01 39px,
      transparent 39px,
      transparent 40px,
      #00b800 40px,
      #00b800 44px,
      transparent 44px,
      transparent 45px,
      #00a400 45px,
      #00a400 50px
    ),
    linear-gradient(gray, gray);
  border: solid 1.5px gray;
  border-radius: 1px;
}

.audio-meter-top::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 50px;
  left: 0px;
  top: 0px;
  background: gray;
  animation: audio-meter-top linear 10s infinite;
}

@keyframes audio-meter-top {
  from {
    height: 50px;
  }
  20% {
    height: 50px;
  }
  21% {
    height: 30px;
  }
  30% {
    height: 45px;
  }
  35% {
    height: 0px;
  }
  40% {
    height: 45px;
  }
  45% {
    height: 5px;
  }
  50% {
    height: 45px;
  }
  60% {
    height: 15px;
  }
  70% {
    height: 45px;
  }
  75% {
    height: 0px;
  }
  80% {
    height: 35px;
  }
  85% {
    height: 0px;
  }
  90% {
    height: 5px;
  }
  92% {
    height: 50px;
  }
  to {
    height: 50px;
  }
}

.audio-meter-bottom {
  position: absolute;
  width: 5px;
  height: 50px;
  left: 20px;
  top: 255px;
  background: linear-gradient(
      to bottom,
      #ff0d0d,
      #ff0d0d 4px,
      transparent 4px,
      transparent 5px,
      #ff2d2d 5px,
      #ff2d2d 9px,
      transparent 9px,
      transparent 10px,
      #ffb633 10px,
      #ffb633 14px,
      transparent 14px,
      transparent 15px,
      #ffad18 15px,
      #ffad18 19px,
      transparent 19px,
      transparent 20px,
      #feff0f 20px,
      #feff0f 24px,
      transparent 24px,
      transparent 25px,
      #feff0f 25px,
      #feff0f 29px,
      transparent 29px,
      transparent 30px,
      #6cdf01 30px,
      #6cdf01 34px,
      transparent 34px,
      transparent 35px,
      #56df01 35px,
      #56df01 39px,
      transparent 39px,
      transparent 40px,
      #00b800 40px,
      #00b800 44px,
      transparent 44px,
      transparent 45px,
      #00a400 45px,
      #00a400 50px
    ),
    linear-gradient(gray, gray);
  border: solid 1.5px gray;
  border-radius: 1px;
}

.audio-meter-bottom::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 50px;
  left: 0px;
  top: 0px;
  background: linear-gradient(to top, gray, gray);
  animation: audio-meter-bottom linear 10s infinite;
}

@keyframes audio-meter-bottom {
  from {
    height: 50px;
  }
  20% {
    height: 50px;
  }
  21% {
    height: 22px;
  }
  30% {
    height: 40px;
  }
  35% {
    height: 0px;
  }
  40% {
    height: 47px;
  }
  45% {
    height: 5px;
  }
  50% {
    height: 37px;
  }
  60% {
    height: 22px;
  }
  70% {
    height: 46px;
  }
  75% {
    height: 0px;
  }
  80% {
    height: 21px;
  }
  85% {
    height: 41px;
  }
  90% {
    height: 0px;
  }
  92% {
    height: 50px;
  }
  to {
    height: 50px;
  }
}

/* Body and Container Settings */
/* Center shapes */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Set background and border color */
.container {
  width: 500px;
  height: 500px;
  border: 5px solid lightgray;
  background: #1c1c1c;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

              
            
!

JS

              
                Check out more CSS animation articles at https://www.pyxofy.com/tag/css-animation/
              
            
!
999px

Console