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="message">
  &check; Made by <a href="https://codepen.io/pieter-biesemans/" target="_blank" title="&#128565; check out my other work">Pieter Biesemans</a> with &#9749;, &#128420; &amp; &#8986;</i>
</div>

<div class="target top left"></div>
<div class="target top right"></div>
<div class="target bottom left"></div>
<div class="target bottom right"></div>

<div class="hud">
  <div class="orange">
    <div class="notches">
      <div class="notch notch1"></div>
      <div class="notch notch2"></div>
      <div class="notch notch3"></div>
      <div class="notch notch4"></div>
      <div class="notch notch5"></div>
      <div class="notch notch6"></div>
      <div class="notch notch7"></div>
      <div class="notch notch8"></div>
      <div class="notch notch9"></div>
      <div class="notch notch10"></div>
      <div class="notch notch11"></div>
      <div class="notch notch12"></div>
    </div>
    <div class="circle outer1"></div>
    <div class="circle outer2"></div>
    <div class="circle outer3"></div>
    <div class="circle inner1"></div>
    <div class="circle inner2"></div>
    <div class="topnotches">
      <div class="notch notch1"></div>
      <div class="notch notch2"></div>
      <div class="notch notch3"></div>
      <div class="notch notch4"></div>
      <div class="notch notch5"></div>
      <div class="notch notch6"></div>
      <div class="notch notch7"></div>
      <div class="notch notch8"></div>
      <div class="notch notch9"></div>
      <div class="notch notch10"></div>
      <div class="notch notch11"></div>
      <div class="notch notch12"></div>
    </div>
    <div class="bottomnotches">
      <div class="notch notch1"></div>
      <div class="notch notch2"></div>
      <div class="notch notch3"></div>
      <div class="notch notch4"></div>
      <div class="notch notch5"></div>
      <div class="notch notch6"></div>
      <div class="notch notch7"></div>
      <div class="notch notch8"></div>
      <div class="notch notch9"></div>
      <div class="notch notch10"></div>
      <div class="notch notch11"></div>
      <div class="notch notch12"></div>
    </div>
    <div class="circle inner3"></div>
    <div class="center">
      <div class="top left"></div>
      <div class="top right"></div>
      <div class="bottom left"></div>
      <div class="bottom right"></div>
    </div>
  </div>
  <div class="blue">
    <div class="circle inner1"></div>
    <div class="notches">
      <div class="notch notch1"></div>
      <div class="notch notch2"></div>
      <div class="notch notch3"></div>
      <div class="notch notch4"></div>
      <div class="notch notch5"></div>
      <div class="notch notch6"></div>
      <div class="notch notch7"></div>
      <div class="notch notch8"></div>
      <div class="notch notch9"></div>
      <div class="notch notch10"></div>
      <div class="notch notch11"></div>
      <div class="notch notch12"></div>
    </div>
    <div class="circle inner2"></div>
  </div>
  <div class="callout left">
    <div class="title">AH-64E</div>
    <div class="body">N606SP</div>
  </div>
  <div class="callout right">
    <div class="title">1239 m</div>
    <div class="body">275 km/h</div>
  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Open+Sans');

$bgColor: #0d0d0d;
$textColor: #fff;
$orangeColor: #d87930;
$blueColor: #57b3c0;

@mixin scrollbars($size, $foreground-color, $background-color) {
  ::-webkit-scrollbar-button{
    display: none;
  }
  ::-webkit-scrollbar {
    width:  $size;
    height: $size;
  }
  ::-webkit-scrollbar-thumb {
    background: $foreground-color;
    border: 1px solid lighten($foreground-color, 10%);
    cursor: pointer;
  }
  ::-webkit-scrollbar-track {
    background: $background-color;
    width: calc(#{$size} * 2);
    border: 2px solid lighten($background-color, 10%);
  }
  ::-webkit-scrollbar-track-piece {
    background: $background-color;
    width: calc(#{$size} / 2);
    border: 2px solid lighten($background-color, 10%);
  }
  body {
    scrollbar-face-color: $foreground-color;
    scrollbar-track-color: $background-color;
  }
}

div{
  position: absolute;
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow: visible;
  &:before, &:after{
    content: '';
    position: absolute;
    display: block;
    box-sizing: border-box;
  }
}

@include scrollbars(2px, white, transparent);

body{
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  color: $textColor;
  font-family: 'Open Sans';
  font-size: 1vw;
  background: $bgColor;
  background: $bgColor url(https://source.unsplash.com/UfCYo7zHyY8) center center /cover repeat-y;
  background-blend-mode: hard-light;
  perspective: 500px;
    
  & .target{
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    &.bottom{
      top: auto;
      bottom: 0;
    }
    &.right{
      left: auto;
      right: 0;
    }
  }
  
  & .hud{
    top: 7.5vw;
    left: 25vw;
    width: 50vw;
    height: 50vw;
    transition: all 0.5s ease;
    transform-origin: center center;
    transform-style: preserve-3d;
    transform: perspective(500px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
    animation: hud-3d 2s 4s ease-in-out forwards;
    pointer-events: none;
    
    & .circle{
      border-radius: 50%;
    }
    
    & .orange{
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      animation: glow-orange 1s 3s ease-in-out forwards;
      
      & .notches{
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: perspective(500px) translate3d(0px, 0px, 0px);
        animation: notches-rotate 3s 1s ease-in-out, notches-3d 2s 4s ease-in-out, notches-pulse-rotate 10s 6s ease-in-out alternate infinite;
        
        & .notch{
          top: 0;
          left: calc(50% - 0.25vw);
          width: 0.5vw;
          height: 50%;
          transform-origin: bottom center;
          animation: notches-grow 3.5s 0.5s ease-in-out;
          &:before{
            width: 100%;
            height: 10%;
            background: $orangeColor;
          }
          
          @for $i from 1 through 12 {
            &#{$i} {
              transform: rotate( 15 + (30 * $i) + deg );
            }
          }
          
        }
        
      }
      
      & .outer{
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0.85vw solid $orangeColor;
        &1{
          top: 7%;
          left: 7%;
          width: 86%;
          height: 86%;
          border: 0.25vw dotted $orangeColor;
        }
        &2{
          top: 12%;
          left: 12%;
          width: 76%;
          height: 76%;
          border: 0.45vw solid $orangeColor;
        }
        &3{
          top: 20%;
          left: 20%;
          width: 60%;
          height: 60%;
          border: 0.25vw dotted $orangeColor;
        }
      }
      
      & .inner{
        top: 22%;
        left: 22%;
        width: 56%;
        height: 56%;
        border: 0.25vw solid $orangeColor;
        &2{
          top: 23%;
          left: 23%;
          width: 54%;
          height: 54%;
          border: 0.25vw solid $orangeColor;
        }
        &3{
          top: 36%;
          left: 36%;
          width: 28%;
          height: 28%;
          border: 0.25vw dashed $orangeColor;
          transform: perspective(500px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
          animation: innerorange3-pulse-3d 2s 4s ease-in-out alternate infinite;
        }
        
      }
      
      & .topnotches{
        top: 25%;
        left: 25%;
        width: 50%;
        height: 50%;
        transform: rotate(90deg) perspective(500px) translate3d(0px, 0px, 0px);
        animation: notchestop-rotate 2s 2s ease-in-out, notchestop-3d 2s 4s ease-in-out forwards;
        
        & .notch{
          top: 0;
          left: calc(50% - 0.4vw);
          width: 0.8vw;
          height: 50%;
          transform-origin: bottom center;
          &:before{
            width: 100%;
            height: 10%;
            background: $orangeColor;
          }
          
          @for $i from 1 through 12 {
            &#{$i} {
              transform: rotate( -65 + (10 * $i) + deg );
            }
          }
          
        }
        
      }
      
      & .bottomnotches{
        top: 25%;
        left: 25%;
        width: 50%;
        height: 50%;
        transform: rotate(90deg) perspective(500px) translate3d(0px, 0px, 0px);
        animation: notchestop-rotate 2s 2s ease-in-out, notchestop-3d 2s 4s ease-in-out forwards;
        
        & .notch{
          top: 0;
          left: calc(50% - 0.2vw);
          width: 0.4vw;
          height: 50%;
          transform-origin: bottom center;
          &:before{
            width: 100%;
            height: 10%;
            background: $orangeColor;
          }
          
          @for $i from 1 through 12 {
            &#{$i} {
              transform: rotate( 115 + (10 * $i) + deg );
            }
          }
          
        }
        
      }
      
      & .center{
        top: 46%;
        left: 43%;
        width: 14%;
        height: 8%;
        transform: translate3d(0px, 0px, 0px);
        animation: center-pulse-3d 12s 4s ease-in-out alternate infinite;
        
        & .top, & .bottom {
          width: 2vw;
          height: 0.25vw;
          background: $orangeColor;
          &:before{
            height: 1vw;
            width: 0.25vw;
            background: $orangeColor;
          }
        }
        
        & .top.left{
          top: 0;
          left: 0;
        }
        
        & .top.right{
          top: 0;
          right: 0;
          &:before{
            right: 0;
          }
        }
        
        & .bottom.left{
          bottom: 0;
          left: 0;
          &:before{
            bottom: 0;
          }
        }
        
        & .bottom.right{
          bottom: 0;
          right: 0;
          &:before{
            bottom: 0;
            right: 0;
          }
        }
        
      }
      
    }
    
    & .blue{
      top: 32%;
      left: 32%;
      width: 36%;
      height: 36%;
      animation: glow-blue 1s 3s ease-in-out forwards;
      
      & .inner1{
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 1vw solid $blueColor;
      }
      
      & .inner2{
        top: 20%;
        left: 20%;
        width: 60%;
        height: 60%;
        border: 0.25vw solid $blueColor;
        transform: perspective(500px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        animation: innerblue2-pulse-3d 2s 4s ease-in-out alternate infinite;
      }
      
      & .notches{
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        animation: notches-rotate 3s 1s ease-in-out;
        
        & .notch{
          top: 0;
          left: calc(50% - 0.25vw);
          width: 0.5vw;
          height: 50%;
          transform-origin: bottom center;
          &:before{
            width: 100%;
            height: 20%;
            background: $blueColor;
          }
          
          @for $i from 1 through 12 {
            &#{$i} {
              transform: rotate( 15 + (30 * $i) + deg );
            }
          }
          
        }
        
      }
      
    }
    
    & .callout{
      opacity: 0;
      width: 0;
      height: 5vw;
      border-bottom: 0.25vw solid $orangeColor;
      &.left{
        bottom: 12.5vw;
        left: -10vw;
        animation: calloutleft-grow 3s 3s ease-in-out alternate infinite;
      }
      &.right{
        top: 7.5vw;
        right: -10vw;
        text-align: right;
        animation: calloutright-grow 3s 4s ease-in-out alternate infinite;
      }
      
      & .title, & .body{
        position: relative;
        width: 100%;
      }
      
      & .title {
        font-size: 2em;
      }
      
    }
    
  }
  
  & .target.top.left:hover ~ .hud{
    animation: none;
    transform: perspective(500px) rotateX(10deg) rotateY(-10deg) rotateZ(0deg) scale(0.75)
  }
  & .target.top.right:hover ~ .hud{
    animation: none;
    transform: perspective(500px) rotateX(10deg) rotateY(10deg) rotateZ(0deg) scale(0.75)
  }
  & .target.bottom.left:hover ~ .hud{
    animation: none;
    transform: perspective(500px) rotateX(-10deg) rotateY(-10deg) rotateZ(0deg) scale(0.75);
  }
  & .target.bottom.right:hover ~ .hud{
    animation: none;
    transform: perspective(500px) rotateX(-10deg) rotateY(10deg) rotateZ(0deg) scale(0.75);
  }
  
  & .message{
    position: absolute;
    right:  0.5vw;
    top: 1vw;
    max-width: 30vw;
    font-size: 0.75em;
    font-family: "Open Sans", sans-serif;
    color: white;
    z-index: 1;

    & a{
      color: inherit;
      text-decoration: none;
      border-bottom: 1px solid #444;
      &:hover{
        border-width: 3px;
      }
    }

  }
  
}


@keyframes glow-orange {
  0%   {filter: drop-shadow(0 0 0 transparent);}
  100% {filter: drop-shadow(0 0 0.25vw $orangeColor);}
}

@keyframes glow-blue {
  0%   {filter: drop-shadow(0 0 0 transparent);}
  100% {filter: drop-shadow(0 0 0.25vw $blueColor);}
}

@keyframes notches-grow {
  0%   {width: 0;}
  100% {width: 0.5vw;}
}

@keyframes notches-rotate {
  0%   {transform: rotate(0deg);}
  100% {transform: rotate(360deg);}
}

@keyframes notches-pulse-rotate {
  0%   {transform: rotate(0deg) perspective(500px) translate3d(0px, 0px, 80px);}
  25%  {transform: rotate(30deg) perspective(500px) translate3d(0px, 0px, 60px);}
  25%  {transform: rotate(0deg) perspective(500px) translate3d(0px, 0px, 80px);}
  100% {transform: rotate(60deg) perspective(500px) translate3d(0px, 0px, 90px);}
}

@keyframes notchestop-rotate {
  0%   {transform: rotate(90deg);}
  100% {transform: rotate(0deg);}
}

@keyframes notchesbottom-rotate {
  0%   {transform: rotate(90deg);}
  100% {transform: rotate(0deg);}
}

@keyframes calloutleft-grow {
  0%   {left: 11vw;width: 0;opacity: 0;}
  100% {left: -10vw;width: 21vw;opacity: 1;}
}

@keyframes calloutright-grow {
  0%   {right: 11vw;width: 0;opacity: 0;}
  100% {right: -10vw;width: 21vw;opacity: 1;}
}

@keyframes hud-3d {
  0%   {transform: perspective(500px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);}
  100% {transform: perspective(500px) rotateX(10deg) rotateY(-10deg) rotateZ(0deg) scale(0.75);}
}

@keyframes notches-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px);}
  100% {transform: perspective(500px) translate3d(0px, 0px, 80px);}
}

@keyframes notchesbottom-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px) rotate(0deg);}
  100% {transform: perspective(500px) translate3d(0px, 0px, -140px) rotate(90deg);}
}

@keyframes notchestop-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px) rotate(0deg);}
  100% {transform: perspective(500px) translate3d(0px, 0px, 140px) rotate(90deg);}
}

@keyframes innerorange3-pulse-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px);}
  100% {transform: perspective(500px) translate3d(0px, 0px, -60px);}
}

@keyframes innerblue2-pulse-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px);}
  50% {transform: perspective(500px) translate3d(0px, 0px, -50px);}
  100% {transform: perspective(500px) translate3d(0px, 0px, -200px);}
}

@keyframes center-pulse-3d {
  0%   {transform: perspective(500px) translate3d(0px, 0px, 0px);}
  50% {transform: perspective(500px) translate3d(0px, 0px, 80px);}
  100% {transform: perspective(500px) translate3d(0px, 0px, 40px);}
}
              
            
!

JS

              
                /*

All CSS baby!

This Codepen is in the Public Domain.
You can use it for whatever purpose you like, except evil.

Based on an original design by the very talented Luck1122 at https://dribbble.com/shots/4290620-HUD-Animation

*/
              
            
!
999px

Console