css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .horizon
.magic-happens
  .keyboard
    ul.kb-line
      each char in [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '-', '=' ]
        li !{char}
    ul.kb-line
      each char in [ 'ESC', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '&larr;' ]
        li !{char}
    ul.kb-line
      each char in [ 'CAP', '&#8644;', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '?' ]
        li !{char}
    ul.kb-line
      each char in [ '&#8682;', '"', '\\', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '&uarr;', '?', '&#8682;' ]
        li !{char}
    ul.kb-line.end
      each char in [ 'CTL', 'ALT', 'Fn', '{', '}', 'SPACEBAR', '&larr;', '&darr;', '&rarr;', 'DEL' ]
        if char == 'SPACEBAR'
          li.spacebar
        else
          li !{char}
  .laser

            
          
!
            
              $color-background: #080808
$color-horizon: ( #149cc0, #004E98 )
$color-laser: #f00903

=size($width, $height)
  width: percentage($width / 100)
  height: percentage($height / 100)

=position($top, $left)
  position: absolute
  top: percentage($top / 100)
  left: percentage($left / 100)

%pseudo-init
  content: ''
  display: block

body
  margin: 0
  padding: 0
  padding-top: 10vh
  background-color: $color-background
  overflow-x: hidden

  >.horizon
    width: 100vw
    height: 30vw
    +position(20, 0)
    overflow: hidden

    &::after, &::before
      @extend %pseudo-init
      +size(200, 200)
      +position(50, -50)
      border-radius: 50%

    &::after
      box-shadow: 0 -2vw 25vw 0 rgba(nth($color-horizon, 2), 0.5)
      animation: horizon 5s linear infinite alternate

    &::before
      box-shadow: 0 0 15vw 0 nth($color-horizon, 1), inset 0 0 5vw 0 lighten(nth($color-horizon, 1), 10%)

  >.magic-happens
    position: relative
    margin: auto
    width: 70vw
    height: 70vw
    perspective: 70vw

    &::before
      @extend %pseudo-init
      +size(25, 50)
      +position(5, 37.5)
      background: linear-gradient(to right, rgba(nth($color-horizon, 1), 0.1), transparent 10%, transparent 90%, rgba(nth($color-horizon, 1), 0.1)), linear-gradient(to bottom, #222, $color-background 20%)
      border-radius: 20% 20% 5% 5% / 10% 10% 2.5% 2.5%

    &::after
      @extend %pseudo-init
      content: 'PWR'
      +position(12, 44.5)
      background: $color-background
      border-radius: 0.5vw
      font-family: 'VT323', monospace
      font-size: 2.5vw
      letter-spacing: 0.2vw
      padding: 0.5vw 2vw
      color: $color-laser
      box-shadow: inset 0 0 1vw 0 rgba($color-laser, 0.2)
      animation: bzz 3s linear infinite alternate

.keyboard
  +size(100, 35)
  +position(65, 0)
  display: flex
  flex-direction: column
  transform-origin: bottom
  transform: rotateX(30deg)

  ul.kb-line
    list-style-type: none
    padding: 0
    margin: 0
    display: inline-flex
    flex-direction: row
    justify-content: center

    li
      color: $color-laser
      border: 0.4vw solid $color-laser
      border-right-width: 0
      border-bottom-width: 0
      padding: 0.5vw 1.5vw
      font-family: 'VT323', monospace
      font-size: 3vw
      box-shadow: inset 0 0 0.5vw 0 $color-laser, 0 0 0.5vw 0 $color-laser
      animation: bzz 3s linear infinite alternate

      &:first-child
        border-radius: 1vw 0 0 0

      &:last-child
        border-right-width: 0.4vw
        border-radius: 0 1vw 0 0

      &.spacebar
        padding-right: 17.3vw

    &.end li
      border-bottom-width: 0.4vw
        
      &:first-child
        border-radius: 0 0 0 1vw
      &:last-child
        border-radius: 0 0 1vw 0

.laser
  +size(15, 38)
  +position(20, 42.5)
  perspective: 22vw

  &::after
    @extend %pseudo-init
    +size(100, 100)
    +position(0, 0)
    background: linear-gradient(to bottom, $color-laser 40%, transparent)
    transform-origin: top
    transform: rotateX(45deg)
    animation: bzz 3s linear infinite alternate

  &::before
    @extend %pseudo-init
    +size(105, 2)
    +position(-1, -2.5)
    background-color: darken($color-laser, 20%)
    border-radius: 0.5vw

@keyframes bzz
  0%
    opacity: 1
  49%
    opacity: 0.7
  50%
    opacity: 0.5
  51%
    opacity: 1
  52%
    opacity: 0.2
  53%
    opacity: 0.8
  54%
    opacity: 1
  79%
    opacity: 0.7
  80%
    opacity: 0.2
  81%
    opacity: 1
  100%
    opacity: 1

@keyframes horizon
  0%
    box-shadow: 0 -2vw 25vw 0 rgba(nth($color-horizon, 2), 0.5)
  100%
    box-shadow: 0 -2vw 25vw 0 rgba(lighten(nth($color-horizon, 2), 40%), 0.5)

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console