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

              
                .moon

ul.clouds
  - let cloud = 3;
  while (cloud--)
    li.cloud

ul.grasses
  - let grass = 200
  while (grass--)
   li.grass

.pokeball-container
  .reflection
    
ul.stars
  - let star = 75
  while (star--)
   li.star
              
            
!

CSS

              
                $red: #ee262e;
$white: #f8f8f8;
$black: #353536;
$blue: #3046a7;
$green: #017740;

body {
  height: 100vh;
  background: $blue;
  overflow: hidden;
}

ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.moon {
  width: 30vw;
  height: 30vw;
  background: $white;
  position: absolute;
  right: -15vw;
  top: -15vw;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba($white, 0.5);
  
  animation: bright 10s infinite;
  
  @keyframes bright {
    0%, 100% {
      box-shadow: 0 0 10px 2px rgba($white, 0.5);
    }
    50% {
      box-shadow: 0 0 0 0 rgba($white, 0.5);
    }
  }
  
  &:before,
  &:after {
    content: '';
    display: block;
    background: rgba(darken($white, 30%), 0.4);
    position: absolute;
    border-radius: 50%;
  }
  
  &:before {
    left: 15%;
    top: 45%;
    width: 10%;
    height: 10%;
  }
  
  &:after {
    left: 6%;
    top: 56%;
    width: 15%;
    height: 15%;
  }
}

.clouds {
  position: absolute;
  left: 0;
  top: 0;
  width: 85vw;
  height: 80vh;
  
  @media (max-width: 800px) {
    display: none;
  }
}
.cloud {
  width: 20vw;
  height: 10vh;
  background: $white;
  border-radius: 40px;
  opacity: 0.8;
  position: absolute;
  
  animation: move 50s infinite;
  
  @keyframes move {
    0%, 100% {
      margin-left: 0;
    }
    50% {
      margin-left: -10%;
    }
  }
  
  &:before,
  &:after {
    content: '';
    display: block;
    background: $white;
    border-radius: 50px;
    position: absolute;
    height: 80%;
    bottom: 65%;
  }
  
  &:before {
    width: 38%;
    left: 20%;
    bottom: 65%;
  }
  
  &:after {
    width: 35%;
    right: 10%;
    bottom: 60%;
  }
  
  &:nth-child(1) {
    top: 15%;
    left: 15%;
  }
  
  &:nth-child(2) {
    top: 70%;
    left: 90%;
  }
  
  &:nth-child(3) {
    top: 5%;
    left: 77%;
  }
}

.stars {
  width: 100%;
  height: 75vh;
  position: absolute;
  left: 0;
  top: 0;
}
.star {
  display: block;
  background: $white;
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  
  animation: star 1s 0s linear;
  
  @keyframes star {
    0%, 100% {
      background: $white;
    }
    30% {
      background: rgba($white, 0.1)
    }
  }
  
  @for $i from 1 through 75 {
    &:nth-child(#{$i}) {
      $size: unquote(random(10) + 'px');
      width: $size;
      height: $size;
      top: unquote(random(100) + '%');
      left: unquote(random(100) + '%');
      animation-delay: unquote($i + 's');
    }
  }
}

.grasses {
  width: 100%;
  height: 20vh;
  background: $green;
  position: absolute;
  left: 0;
  bottom: 0;
  
  &:before {
    content: '';
    width: 150px;
    height: 60px;
    background: rgba($black, 0.8);
    position: absolute;
    bottom: calc(20vh - 60px);
    left: 0;
    right: 0;
    margin: 0 auto;
    border-radius: 50%;
  
    animation: shadow 2s infinite;
  
    @keyframes shadow {
      20%, 40%, 50% {
        width: 150px;
        height: 60px;
        bottom: calc(20vh - 60px);
      }
      30% {
        width: 100px;
        height: 30px;
        bottom: calc(20vh - 30px);
      }
    }
  }
}
.grass {
    display: block;
    background: darken($green, 10%);
    position: absolute;
    border-radius: 10px 0; 
    
    @for $i from 1 through 200 {
      &:nth-child(#{$i}) {
        $size: unquote(random(10) + 'px');
        width: $size;
        height: $size;
        top: unquote(random(100) + '%');
        left: unquote(random(100) + '%');
        animation-delay: unquote(random(100) + 's');
        transform: rotate(unquote(random(360) + 'deg'));
      }
    }
  }

.pokeball-container {
  position: absolute;
  width: 250px;
  height: 250px;
  margin: 0 auto;
  border: 4px solid $black;
  border-radius: 50%;
  left: 0;
  right: 0;
  bottom: 17vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to bottom,
    $red 0,
    $red 47%,
    $black 47%,
    $black 55%,
    $white 55%,
    $white 100%
  );
  
  animation: twist 2s infinite;
  
  @keyframes twist {
    20%, 40%, 50% {
      bottom: 17vh;
      transform: none;
    }
    30% {
      bottom: 20vh;
    }
    43% {
      transform: rotate(-10deg);
    }
    47% {
      transform: rotate(10deg);
    }
  }
  
  &:before,
  &:after{
    content: '';
    display: block;
    background: $white;
    border: 2px solid $black;
    border-radius: 50%;
    position: absolute;
  }
  
  &:before {
    width: 20%;
    height: 20%;
    box-shadow: 0 0 4px 1px rgba($black, 0.3);
  }
  
  &:after {
    width: 7.5%;
    height: 7.5%;
    
    animation: blink 1s infinite;
    
    @keyframes blink {
      50% {
        background: rgba($red, 0.7)
      }
    }
  }
}
.reflection {
  width: 25px; 
  height: 20px;  
  border: solid 5px white;
  border-color: transparent transparent transparent rgba(lighten($red, 80%), 0.3);
  border-radius: 20px 0 0 50%/20px;
  position: absolute;
  transform: rotate(140deg);
  right: 18%;
  top: 15%;
}
              
            
!

JS

              
                
              
            
!
999px

Console