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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <div class="container">
  <i class="wi wi-snowflake-cold flake"></i>
  <a href="https://reactgo.com/css-snow-animation/" target="_blank" class="master">View Tutorial</a>
</div>

              
            
!

CSS

              
                body {
  font-family: sans-serif;
  background: #070606e8;
  background-image: url(http://photoshopdesire.com/wp-content/uploads/2016/02/day2night-after-photoshop.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}
.container {
  height: 100vh;
  overflow: hidden;
}

.flake {
  color: rgb(247, 252, 243);
  font-size: 2rem;
  padding: 1rem;
  animation: fall 2s linear forwards infinite;
  animation-delay: 1s;
}

@keyframes fall {
  from {
    transform: translateY(-10vh);
  }
  to {
    transform: translateY(100vh);
  }
}

.master{
  color:white;
  float:right;
}

@media only screen and (max-width: 800px) {
  .flake {
    font-size: 1rem;
    animation-delay: 0s;
  }
  
  .master{
    display:none;
  }
}



              
            
!

JS

              
                
const flake = document.querySelector(".flake");
const container = document.querySelector(".container");

function createFlake() {
  const clone = flake.cloneNode(true);
  clone.style.paddingLeft = Math.random() * 10 + "px"; // creating left padding
  clone.style.animationDuration = Math.random() * 5 + 3 + "s"; // animation duration between 3-5
  clone.style.opacity = Math.random() * 1;
  const randomC = Math.random() * 200;
 const randomA = Math.random() * 200;
 const randomB = Math.random() * 56;
  clone.style.color = `rgb(${randomA + 256},${randomB + 200},${randomC + 100})`;
  container.append(clone); // adding clone flake to container
}
const s = setInterval(createFlake, 100); // to create more flakes decrease 100

setTimeout(() => {
  clearInterval(s);
}, 3000); // flake creation stops after 3000 milliseconds or 3s


              
            
!
999px

Console