Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


        <script type="text/javascript" src=""></script> 
        <title>Happy Holidays!</title>
        <link rel="stylesheet" href="style.css" type="text/css">
   <center> <section>
      <canvas id="canvas"></canvas>
    <!-- Add your heading below this line -->
    <h1>Merry Christmas and Happy New Year</h1>
    <!-- I'm a comment! You won't see me on the page! -->
    <h2>Valeh Farzaliyev</h2>
    <img src="">


                @import url(;

body {
    background: darkslategray;
section {
    /* You will add new style rules here */
    margin: auto;
    position: relative;
    background: url(;
    width: 700px;
    height: 500px;
    color:  white;
    font-family: Lobster;
    /* I am a comment. */
img {
    position: absolute;
    top: 200px;
    left: 120px;
h1 {
    /* Any styles here just affect your "<h1>" tags. */
    position: absolute;
    margin: 0;
    top:  0;
    left: 280px;
    font-size: 48px;
h2 {
    color: white;
    position: absolute;
    margin: 0;
    top: 360px;
    left: 340px;
    /* Any styles here just affect your "<h1>" tags. */
    font-size: 36px;


                var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");

var W = 700;
var H = 500;
canvas.width = W;
canvas.height = H;

var numberFlakes = 100;

var flakes = [];
for (var i = 0; i < numberFlakes; i++) {
    x: Math.random()*W,
    y: Math.random()*H,
    radius: Math.random()*8+1

function drawFlakes() {
  // Have to clear it every time to redraw
  ctx.clearRect(0, 0, W, H);

  ctx.fillStyle = "rgba(255, 255, 255, 0.8)";
  for (var i = 0; i < numberFlakes; i++) {
    var f = flakes[i];
    ctx.moveTo(f.x, f.y);
    ctx.arc(f.x, f.y, f.radius, 0, Math.PI*2, true);

var angle = 0;

function moveFlakes() {
  for (var i = 0; i < numberFlakes; i++) {
    var f = flakes[i];
    // cos and sin for moving diagonally
    f.y += Math.cos(angle) + 1 + f.radius/2;
    //Start flakes over at top
    if (f.x > W+5 || f.x < -5 || f.y > H) {

      // Introduces some more random behavior to make the snowfall look real
      if (i%3 > 0) {
        flakes[i] = {x: Math.random()*W, y: -10, radius: f.radius};
      } else {
        // flake leaves from right
        if (Math.sin(angle) > 0) {
          // come in from left
          flakes[i] = {x: -5, y: Math.random()*H, radius: f.radius};
        } else {
          //come in from right
          flakes[i] = {x: W+5, y: Math.random()*H, radius: f.radius};

function init() {

setInterval(init, 30);