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

              
                .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

              
            
!

CSS

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

              
            
!

JS

              
                
              
            
!
999px

Console