cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="stage">
  <div class="tree">
    <div class="trunk"></div>
    <div class="leaves lone"><span></span></div>
    <div class="leaves ltwo"><span></span></div>
    <div class="leaves lthree"><span></span></div>
  </div>
  <div class="snow">
    <div class="group sone"></div>
    <div class="group stwo"></div>
    <div class="group sthree"></div>
    <div class="group sfour"></div>
    <div class="group sfive"></div>
    <div class="group ssix"></div>

    <div class="flurry f1"></div>
    <div class="flurry f2"></div>
    <div class="flurry f3"></div>
    <div class="flurry f4"></div>
    <div class="flurry f5"></div>
    <div class="flurry f6"></div>
    <div class="flurry f7"></div>
    <div class="flurry f8"></div>
    <div class="flurry f9"></div>
    <div class="flurry f10"></div>
    <div class="flurry f11"></div>
    <div class="flurry f12"></div>
  </div>
  <svg version="1.1" x="0px" y="0px"
	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<path stroke-linecap="round" class="m1" d="M155.4,194.5c0,0-3,8.6,4.5,11.2c7.4,2.7,13.9-2.8,15.6-7.8c1.7-5,5.7-16.5-12.2-23.6
	c-17.8-7.2-32.9,15.2-32.3,28.5c0.6,13.3,11.2,23.5,24.7,24c13.5,0.5,25.6-4.1,36.3-26.4c10.7-22.3,15.5-33.8,14.6-39.5
	c-0.9-5.6-12.3-3.7-12.3-3.7s10.3-2.6,12.3,3.7c2.9,8.9-6.3,59.3-6.3,59.3s10.2-16.7,15.5-29.3c5.2-12.7,12.6-25.8,12.6-25.8
	s-7.4,18.8-8.5,33.6c-1.1,14.8,1,22.7,1,22.7s4.2-1.6,6.7-4.5c2.5-2.9,7.9-11,7.9-11"/>
<path stroke-linecap="round" class="m2" d="M239.4,205.4c0,0,7.9,1,13.6-5.2c5.7-6.2,9.6-18.4,4.1-20.3s-12.1,6.4-15.8,12.8s-9.3,28.5,3,26.3
	s20.2-15.9,20.2-15.9"/>
<path stroke-linecap="round" class="m3" d="M273.1,181.5c0,0-4.4,8.4-6.3,16c-1.8,7.7-4.1,21.7-4.1,21.7s3.5-16.7,7.9-25.5c4.4-8.7,15.5-18.6,16.5-15.1
	c1,3.5-4.7,12.2-4.4,15.4c0.3,3.2,4,6.3,7.9,2.7"/>
<path stroke-linecap="round" class="m4" d="M301.6,179.6c0,0-4.4,8.4-6.3,16c-1.8,7.7-4.1,21.7-4.1,21.7s3.5-16.7,7.9-25.5c4.4-8.7,15.5-18.6,16.5-15.1
	c1,3.5-4.7,12.2-4.4,15.4c0.3,3.2,4,6.3,7.9,2.7"/>
<path stroke-linecap="round" class="m5" d="M331.6,176.6c0,0-7.2,17.1-8.4,24.4s0.8,18.5,7.4,10.2s17.8-34.9,17.8-34.9s-13,51.1-20.3,60.1
	s-14.5,7.3-15.6,3.2c-1.1-4.1,5.4-11.8,15.1-18.2c9.7-6.4,40.3-25.2,42.8-43s-2.5-21.2-9-26.8c-6.4-5.6-27.1-9.3-51.1-0.2
	c-24,9.1-37.8,13.6-55.3,11.2c-17.5-2.4-27.2-18.1-26.4-29c0.9-10.9,5.4-18.7,16.7-23.5c11.3-4.8,26.5-1.6,30.8,7.9
	s-2.2,18.7-6.4,20.4c-4.2,1.7-17.5,3.6-19.6-5c-2.1-8.6,8.5-8.6,8.5-8.6"/>
<path stroke-linecap="round" class="m6" d="M126.3,229c0,0-5,9.2,4,14c9,4.7,19.7-4,20.3-18.6c0.7-14.7-31-23-47.3-2.3s-17.3,40.8-7.7,53.8
	c9.6,13,25.7,18.6,41.3,13.6s24-21.3,24.7-28c0.7-6.7,3.7-16.7-5.7-11.3s-16.7,17.7-21.3,31.7c-4.7,14-1,28.3,9,23
	c10-5.3,20.7-15.7,20.7-15.7"/>
<path stroke-linecap="round" class="m7" d="M178.3,249c0,0-6,12.3-10.3,25.3s-8.3,31.5-8.3,31.5s8-22.5,15.3-32.1c7.3-9.7,13.7-14,11.7-3.3
	c-2,10.7-10,24.7-8.7,29c1.3,4.3,2.3,6.3,9.3-2c7-8.3,8.7-10.3,8.7-10.3"/>
<path stroke-linecap="round" class="m8" d="M203.1,265.7c0,0-4.4,8.4-6.3,16c-1.8,7.7-4.1,21.7-4.1,21.7s3.5-16.7,7.9-25.5c4.4-8.7,15.5-18.6,16.5-15.1
	c1,3.5-4.7,12.2-4.4,15.4s4,6.3,7.9,2.7"/>
<path stroke-linecap="round" class="m9" d="M233,262.2c0,0-4.7,10.3-7.9,20.6c-3,9.8-6.1,23.2,5.5,15.5c11.7-7.7,27.3-38.3,26.7-44.3c-0.7-6-3.3-4.7-5.7,0
	c-2.3,4.7-0.7,14.1,0.7,23.4c1.3,9.3,2,20.2-8.3,21.9c-10.3,1.7-11.3-7.3-11.3-7.3"/>
<path stroke-linecap="round" class="m10" d="M234,251.8c0,0,10.5-3.8,8.9-7.4s-9.1,0.6-8.2,4.4c0.9,3.8,6.9,1.2,6.9,1.2"/>
<path stroke-linecap="round" class="m11" d="M280.5,245.3c0,0-11.9,25.8-13.8,35.8s-1.8,19.9,3.5,15.8S282,284,282,284"/>
<path stroke-linecap="round" class="m12" d="M263.1,259.6c0,0,8.5-1.8,13.4-1.9s10.1,0,10.1,0"/>
<path stroke-linecap="round" class="m13" d="M292.3,259.6c0,0-5.4,8.9-7.5,18.4s-3.8,19.1-3.8,19.1s4-14.5,12.3-27.5s15.1-15.6,15.1-9.4s-10.3,36-10.3,36
	s9.3-28.3,17.6-35.9s12.6-4.8,9.1,3.7c-3.5,8.5-8.5,16.2-9.9,23.1s2.1,8.1,5.1,7s10.5-13.5,10.5-13.5"/>
<path stroke-linecap="round" class="m14" d="M354.9,257.7c0,0-0.6-5.1-5.3-3.7s-12.3,11.6-14.3,19.3s-3.8,20.4,2.3,20s19.8-33.6,19.8-33.6s-8.1,16.3-8.6,27
	s7.1,4.4,13.8-6s19.5-26,19.8-33.4s-5.3-6.7-5.6,0.3s5.9,33.6,2.9,39.3s-7.8,6.6-15.9,6.5s-5.7-14.8-5.7-14.8"/>
<path stroke-linecap="round" class="m15" d="M107,304.8c0,0,59.2,43.5,163,31s54.3-27,12-19.3s-76.4,19.8-95.1,38.3s-4.7,47,15.8,47s38.4-15.3,36.6-31
	c-1.8-15.8-17.1-17.5-23.1-14.5s-14.5,13-7.8,19.5s13.8-0.5,13.8-0.5"/>
<path stroke-linecap="round" class="m16" d="M346.3,320.8c0,0,45.5-9,61-34.5c15.5-25.5,12.8-42.8-9.8-58c-0.5-0.3-1-0.7-1.5-1c-21.8-14-40.3-9.3-45,1
	c-4.8,10.5,4.8,14.5,10.3,11.7s4.8-5,4.8-5"/>
<path stroke-linecap="round" class="m17" d="M394,226.8c0,0-28.1-13-20-26s19.8-7.5,23-4.5s6.7,16.7-5.6,13.1"/>
</svg>

</div>

            
          
!
            
              $gl: #558833;
$gd: #4a6b33;
$b: #6f3309;
$bg: #f2feff;
$snow: #cee;

/* base */
body {
  background: $bg;
  font-size: 10px;
  margin: 0;
  padding: 0;  
}
body * {
  &, div, span {
    display: inline-block;
    left: 50%;
    position: absolute;
    transform: translate(-50%,0);
  }
}
::before,
::after {
  display: inline-block;
  position: absolute;
}
script {display: none;}
.tree {
  height: 10em;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
  width: 10em;
  *, ::before, ::after {
    transition: 0.5s all cubic-bezier(0, 0.5, 0.6, 1.5);
  }
  
  &::before {
    content: "";
    background: $bg;
    height: 100%;
    opacity: .15;
    width: 50%;
    z-index: 2;
  }
  
  .trunk {
    border: .9em solid #ccc;
    border-color: $b transparent transparent transparent;
    border-width: .45em .9em 0 .9em;
    bottom: 0em;
    
    &::before {
      background: $b;
      bottom: .45em;
      content: "";
      height: 2em;
      left: -.9em;   
      width: 1.8em;
    }
  }
  .leaves {
    border: 3.4em solid #ccc;
    border-color: $gl transparent transparent transparent;
    border-width: 1.7em 3.4em 0 3.4em;
    bottom: .5em;
    
    span, 
    &::before {
      border: 3.4em solid #ccc;
      border-color: transparent transparent $gl transparent;
      border-width: 0 3.4em 4.5em 3.4em;
      bottom: 1.7em;
      left: -3.4em;
    }
    &::after {
      border: 3.4em solid #ccc;
      border-color: $gd transparent transparent transparent;
      border-width: 1.7em 3.38em 0 3.38em;
      bottom: 1.835em;
      font-size: .776em;      
      transform: translate(-50%,0);
    }
    &::before,
    &::after {
      content: "";
    }
    
    span {
      bottom: 3.55em;
      border-color: transparent transparent $gd transparent;
      font-size: .77em;
      left: 0em;
    }
  }
  .l {
    &two {
      bottom: 2.8em;
      font-size: .82em;
      &::before {
        margin-bottom: -.015em;
      }
      &::after {
        bottom: 2.67em;
        font-size: .7em;
      }
      span {
        bottom: 4.401em;
        font-size: .694em;        
      }
    }
    &three {
      bottom: 7.2em;
      font-size: .58em;
      &::before {
        margin-bottom: -.015em;
      }
      &::after {
        bottom: 7.6em;
        font-size: .45em;
      }
      span {
        bottom: 9.38em;
        font-size: .446em;
      }
    }
  }
}
.snow {
  *, ::after, ::before {
     transition: 0.5s all ease-in-out;
  }
  .group {
    background: $snow;
    border: 0 solid mix($snow, #fff);
    border-radius: 500em;
    box-sizing: border-box;
    height: 0;
    position: absolute;
    z-index: 1;
    
    &.s {
      &one, &five {
        transform: rotate(26.5deg);
      }
      &two, &three, &four {
        transform: rotate(-26.5deg);
      }
      &one {
        bottom: 1.8em;
        left: -3.7em;
        width: 3.95em;
        body.snowy & {
          bottom: 1.3em;
          width: 4.1em;
        }
      }
      &two {
        bottom: 1.18em;
        left: -.15em;
        width: 1em;
        body.snowy & {
          border: 0;
          bottom: .65em;
          left: -.3em;
          width: 1.15em;
        }
      }
      &three { 
        bottom: 3.7em;
        left: 1.3em;
        width: 1.5em;
        body.snowy & {
          bottom: 3.2em;
          height: .4em;
          width: 1.65em;
        }
      }
      &four { 
        bottom: 4.6em;
        left: -.1em;
        width: 1em;
        body.snowy & {
          bottom: 4.2em;
          height: .3em;
          left: -.1em;
          width: 1.15em;
        }
      }
      &five {
        bottom: 4.6em;
        left: -.7em;
        width: .3em;
        body.snowy & {
          bottom: 4.2em;
          height: .3em;
          width: .45em;
        }
      }
      &six {
        border-radius: .2em .3em .5em .3em;
        bottom: 7.7em;
        transform: rotate(45deg);
        width: 0em;        
        body.snowy & {
          bottom: 6.7em;
          border-width: 0 0 .08em .08em;
          left: -.5em;
          height: 1em;
          width: 1em;
        }
      }
    }
  }
  
  .flurry {
    animation-name: flurry;
    animation-duration: 6s;
    animation-iteration-count: infinite;
    
    background: $snow;
    border-radius: 500em;
    box-sizing: border-box;
    height: 0;
    left: 50%;
    position: fixed;    
    top: -1em;
    width: 0;
    
    &.f1  {                         animation-delay:   0s; margin-top: 0;}
    &.f2  {animation-name: flurry2; animation-delay:  .9s; margin-top: -1em;}
    &.f3  {                         animation-delay: 1.8s; margin-top: -2em;}
    &.f4  {animation-name: flurry2; animation-delay: 2.4s; margin-top: -.1em;}
    &.f5  {                         animation-delay: 2.5s; margin-top: -2.1em;}
    &.f6  {animation-name: flurry2; animation-delay: 3.6s; margin-top: -1.6em;}
    &.f7  {                         animation-delay: 3.7s; margin-top: -.5em;}
    &.f8  {animation-name: flurry2; animation-delay: 4.2s; margin-top: -1.8em;}
    &.f9  {                         animation-delay: 4.3s; margin-top: -2.8em;}
    &.f10 {animation-name: flurry2; animation-delay: 4.8s; margin-top: -1.2em;}
    &.f11 {                         animation-delay: 5.6s; margin-top: -.3em;}
    &.f12 {animation-name: flurry2; animation-delay: 5.8s; margin-top: -.8em;}
  }
}

svg {
  height: 8.5em;
  width: 8.5em;
  position: absolute;
  top: 2em;
  filter: drop-shadow( 0 0 10px $snow );
  -webkit-filter: drop-shadow( 0 0 10px $snow );
  
  
  * {
    fill: transparent;
    left: 0;
    stroke: #a92e23;
    stroke-width: .04em;
    transition: .5s all ease-in-out;
    transform: none;
    body.snowy & {
      stroke-dashoffset: 0;
    }
  }
  
  $list: 470.8630, 118.2567, 116.9157, 116.9157, 563.2486, 367.4138, 174.8919, 116.9156, 176.1222, 32.4916, 76.2244, 23.6493, 242.8673, 274.2789, 577.2563, 220.0025, 84.6938;
  
  $totdur: 0;
  @for $i from 1 through length($list) {
    $len: nth($list, $i);
    $dur: $len/500;
    $totdur: $totdur + $dur + .3;
    .m#{$i} { 
      stroke-dasharray: $len,$len;
      stroke-dashoffset: $len;
      transition-duration: #{$dur}s;
      /*transition-delay: #{$totdur}s;*/
    }    
  }
  
}

/* animation */
.tree {
  &.weighed {
    .l {
      &one {
        bottom: .3em;
      }
      &two {
        bottom: 2.42em;
      }
      &three {
        bottom: 6.5em;
      }
    }
  }
}
body.snowy {
  .group {
    border-width: .1em 0 0 .1em;
    height: .5em;
  }
}


/* scaling */
body {
  font-size: 70px;
}

@keyframes flurry {
    0%   {height: 0; width: 0; top: -8.5em; margin-left: 0;}
    10%  {height: .3em; width: .3em;}
    25%  {margin-left: -2em;}
    30%  {height: .1em; width: .1em;}
    50%  {height: .2em; width: .2em;}
    75%  {margin-left: 2em;}
    80%  {height: .3em; width: .3em;}
    100% {top: -1em; margin-left: 0;}
}
@keyframes flurry2 {
    0%   {height: 0; width: 0; top: -8.5em; margin-left: 0;}
    10%  {height: .3em; width: .3em;}
    25%  {margin-left: 2em;}
    30%  {height: .1em; width: .1em;}
    50%  {height: .2em; width: .2em;}
    75%  {margin-left: -2em;}
    80%  {height: .3em; width: .3em;}
    100% {top: -1em; margin-left: 0;}
}
            
          
!
            
              setTimeout(function () {
  $('.tree').addClass('weighed');
  $('body').addClass('snowy');
}, 200);

$('body').click(function() {
  $('.tree').toggleClass('weighed');
  $('body').toggleClass('snowy');
});
            
          
!
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