cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="scenery">
  &nbsp;

  <div class="sun"></div>
  <div class="cloud left"></div>
  <div class="cloud right flip"></div>
  <div class="cloud left bigger lower faster flip"></div>
  
  
  <div class="mountains"></div>
</div>
            
          
!
            
              $size-sun: 140px
$size-sun-border: 15px
$size-cloud: 120px
$size-scenery: 100%
$color-sun: #FFD93B
$color-cloud: #fafaff
$day: 12s
body, html
  overflow: hidden
  height: 400px
.scenery
  position: relative
  box-sizing: border-box
  background-color: #D7EFF7// radial-gradient(circle, #D7EFF7, #98E3F9)
  width: 100%
  height: 100%
  padding: 40px
  overflow: hidden
  animation: skysetting $day infinite
  //position: relative

.cloud, .cloud
  background-color: $color-cloud
  width: $size-cloud
  height: $size-cloud*0.85
  border-radius: 50%
  position: absolute
  right: -200px
  top: 10px
  &.flip
    transform: scaleX(-1)
  &.left
    top: 60px
    left: -200px
    animation: toright 25s infinite ease-in-out
    animation-delay: 2s
  &.right
    top: 120px
    right: 0px
    animation: toleft 20s infinite ease-in
  &.faster
    animation-duration: 15s
  &.lower
    top: 200px
    animation-delay: 4s
  &.bigger
    transform: scale(1.2)
  &:after
    content: ''
    background-color: $color-cloud
    position: absolute
    right: -10px
    bottom: -10px
    width: $size-cloud*0.7
    height: $size-cloud*0.5
    border-radius: 50%
  &:before
    content: ''
    background-color: $color-cloud
    position: absolute
    left: -25px
    bottom: -10px
    width: $size-cloud*0.8
    height: $size-cloud*0.7
    border-radius: 50%
  
.sun
  transform: translate(-50%, 50%)
  left: 50%
  position: relative
  box-sizing: border-box
  width: $size-sun
  height: $size-sun
  background-color: rgba($color-sun, 1)
  border-radius: $size-sun/2
  animation: glow 4s infinite, rise $day infinite ease-in-out
  border-color: rgba($color-sun, 0.4)
  border-width: $size-sun-border
  border-style: solid
  background-clip: content-box
  margin-top: 0px

.mountains
  $size-mountain: 180px
  margin-top: -$size-mountain*0.75
  box-sizing: border-box
  $color-mountains: #95BF13
  width: $size-mountain*2
  height: $size-mountain
  position: absolute
  //bottom: 0px
  left: 45%
  bottom: $size-mountain
  transform: translate(-50%, 0%)

  &:before, &:after
    content: ''
    border: $size-mountain solid transparent
    border-bottom: $size-mountain solid $color-mountains
    position: absolute
    
  &:after
    animation: mountain $day infinite
  
  &:before
    margin-left: $size-mountain
    bottom: -$size-mountain
    border-bottom-color: #7FA507
    border-bottom-width: $size-mountain*0.75
    animation: mountain2 $day infinite
  
@keyframes mountain
  0%
    border-bottom-color: #BDD66E
  10%
    border-bottom-color: #B0D627
  75%
    border-bottom-color: #95BF13
  80%
    border-bottom-color: #729113
  90%
    border-bottom-color: #3B0659
  100%
    border-bottom-color: #BDD66E
@keyframes mountain2
  $darken-by: 5
  0%
    border-bottom-color: darken(#BDD66E, $darken-by)
  10%
    border-bottom-color: darken(#B0D627, $darken-by)
  75%
    border-bottom-color: darken(#95BF13, $darken-by)
  80%
    border-bottom-color: darken(#729113, $darken-by)
  90%
    border-bottom-color: darken(#3B0659, $darken-by)
  100%
    border-bottom-color: darken(#BDD66E, $darken-by)
@keyframes skysetting
  0%
    background-color: #ffffff
  10%
    background-color: #D7EFF7//radial-gradient(circle, #D7EFF7, #98E3F9)
  70%
    background-color: #4BCCEF
  80%
    background-color: #FF7C3B //radial-gradient(circle, #FF7C3B, #7E3BFF)
  90%
    background-color: #220854 //radial-gradient(circle, #220854, #06040A)
  100%
    background-color: #ffffff
@keyframes rise
  0%
    top: 110%
    transform: scale(0.5)
  30%
    top: 0%
    transform: scale(1)
    background-color: $color-sun
  70%
    top: 0%
    transform: scale(1)
    background-color: white
    border-color: rgba(white, 0.4)
  100%
    top: 110%
    transform: scale(0.5)

@keyframes toright
  0%
    left: -150px
  50%
    left: $size-scenery*1.2
  100% 
    left: -150px
@keyframes toleft
  0%
    right: -150px
  50%
    right: $size-scenery*1.2
  100% 
    right: -150px
@keyframes glow
  0% 
    margin-left: 0px
    margin-top: 0px
  50%
    $shrink-ratio: 0.02
    $size-sun-border-smaller: $size-sun-border
    $color-sun-smaller: darken($color-sun, 0.1)
    border-color: rgba($color-sun-smaller, 0.2)
    background-color: $color-sun-smaller
    border-width: $size-sun-border*$shrink-ratio
    margin-left:  $size-sun-border*$shrink-ratio
    margin-top:  $size-sun-border*$shrink-ratio
  
  100%
    margin-left: 0px
    margin-top: 0px
 
  
    
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console