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.

Quick-add: + add another resource

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.

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.

            
              .container
  %canvas#snow.snow
  
  .container__type
    .heading.heading--1 ho
    .heading.heading--2 ho
    .heading.heading--3 ho
 
  .container__artwork
    .eye-brows
      .eye-brow.eye-brow--left
      .eye-brow.eye-brow--right
    .head
      .eyes
        .eye
          .eye__pupil
        .eye
          .eye__pupil
      .nose
    .ears
      .ear
        .ear__inner
      .ear
        .ear__inner
    .hat
    .hat__ball
    .beard
      .beard__ball.beard__ball--1
      .beard__ball.beard__ball--2
      .beard__ball.beard__ball--3
      .beard__ball.beard__ball--4
      .beard__ball.beard__ball--5
      .beard__ball.beard__ball--6
      .beard__ball.beard__ball--7
      
      .beard__mouth
            
          
!
            
              // Import stuff
@import url('https://fonts.googleapis.com/css?family=Fredoka+One');

// Vars
$color--green: #93B3A7;
$color--green--dark: scale-color($color--green, $lightness: -20%);
$color--gray: #C0C0B0;
$color--white: #FAFBF7;
$color--brown: #C19469;
$color--red: #CF4F43;
$color--red--dark: scale-color($color--red, $lightness: -20%);
$color--peach: #FFC8B2;
$color--peach--dark: scale-color($color--peach, $lightness: -12%);
$color--blue: #2BDECF;
$color--black: #4A4A4A;
$color--black--dark: darken($color--black, 10%);

$layer--low: -5;
$layer--mid: 0;
$layer--high: 5;
$layer--very-high: 10;
$layer--highest: 20;

// Mixin
@mixin size($val) {
  height: $val;
  width: $val;
}

@mixin flex-center() {
  align-items: center;
  justify-content: center;
}

// Styles
html,
body,
.container,
.container__sub{
  width: 100%;
  height: 100%;
  font-family: 'Fredoka One', sans-serif;
}

.snow {
  @include size(100%);
  position: absolute;
  z-index: $layer--highest;
}

.container {
  @include flex-center();
  background: linear-gradient(0deg, $color--green--dark, $color--green);
  display: flex;
}

.container__artwork {
  position: relative;
}

.hair {
  color: $color--white;
}

.head {
  @include size(300px);
  display: block;
  position: relative; // allows absolute positioning within
  z-index: $layer--high;
  background: $color--peach;
  clip-path: ellipse(44% 50% at 50% 50%);
}

.eyes,
.eye-brows {
  position: absolute;
  left: 0;
  top: 100px;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  width: 100%;
  height: 20px;
}

.eye-brows {
  top: 62px;
  z-index: $layer--highest;
}

.eye-brow {
  position: relative;
  width: 50px;
  height: 20px;
  border-radius: 50px;
  border: 5px solid darken($color--white, 5%);
  background: $color--white;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}


.eye {
  @include flex-center();
  @include size(20px);
  border-radius: 50%;
  background: $color--white;
  display: flex;
  box-shadow: 0 10px 20px rgba($color--peach--dark, 0.75);
}

.eye__pupil {
  @include size(7px);
  border-radius: 50%;
  background: $color--green;
}

.nose {
  position: absolute;
  z-index: $layer--very-high;
  top: 115px;
  left: 95px;
  display: block;
  width: 40%;
  height: 60px;
  background: linear-gradient(0deg, $color--red, $color--peach--dark);
  //border: 5px solid $color--peach;
  border-radius: 50%;
  box-shadow: 0 10px 20px $color--peach--dark;
}

.hat {
  display: block;
  background: linear-gradient(0deg, $color--red--dark, $color--red);
  height: 200px;
  width: 250px;
  position: absolute;
  z-index: $layer--very-high;
  left: 26px;
  border-radius: 50%;
  top: -130px;
  border-bottom: 30px solid $color--white;
  clip-path: polygon(50% 0%, 0 100%, 100% 100%);
}

.hat__ball {
  @include size(35px);
  border-radius: 50%;
  background: $color--white;
  position: absolute;
  z-index: $layer--very-high;
  bottom: 400px;
  left: 132px;
}

.ears {
  position: absolute;
  z-index: $layer--mid;
  bottom: 120px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ear {
  display: flex;
  @include flex-center();
  width: 50px;
  height: 75px;
  border-radius: 50%;
  background: $color--peach;
}

.ear__inner {
  @include size(70%);
  background: linear-gradient(0deg, $color--peach, $color--peach--dark);
  border-radius: 50%;
  border: 5px solid $color--peach;
}

.beard {
  position: absolute;
  z-index: $layer--very-high;
}

.beard__ball {
  background: $color--white;
  border-radius: 50%;
  position: absolute;
  transition: all .3s ease; // temporary!
  display: flex; // temporary!
  @include flex-center(); // temporary!
  
  &--1 {
    @include size(50px);
    bottom: 85px;
    left: 15px;
  }
  
  &--2 {
    @include size(75px);
    bottom: 50px;
    left: 25px;
    
  }
  
  &--3 {
    @include size(100px);
    bottom: 10px;
    left: 50px;
  }
  
  &--4 {
    @include size(70px);
    bottom: 50px;
    left: 205px;
  }
  
  &--5 {
    @include size(125px);
    bottom: -20px;
    left: 90px;
  }
  
  &--6 {
    @include size(50px);
    bottom: 85px;
    left: 240px;
  }
  
  &--7 {
    @include size(100px);
    bottom: 10px;
    left: 150px;
  }
}

.beard__mouth {
  @include size(25px);
  border-radius: 50%;
  background: linear-gradient(0deg, $color--black, $color--black--dark);
  border: 3px solid $color--black;
  position: absolute;
  bottom: 55px;
  left: 140px;
  animation: bounceInOut 3s ease infinite;
}

.container__type {
  
}

.heading {
  text-transform: uppercase;
  position: absolute;
  letter-spacing: 0.05em;
  z-index: $layer--highest;
  color: $color--red;
  text-shadow: 0 10px 20px $color--green--dark;
  -webkit-text-fill-color: $color--red;
  -webkit-text-stroke-width: 5px;
  -webkit-text-stroke-color: $color--white;
  opacity: 0;
  
  &--1 {
    font-size: 150px;
    left: 22.5%;
    top: 35%;
    transform: rotate(-15deg);
    animation: fadeOutIn 3s ease infinite;
    animation-delay: 0s;
  }
  
  &--2 {
    font-size: 115px;
    -webkit-text-stroke-width: 3px;
    left: 31.5%;
    top: 48.5%;
    transform: rotate(-20deg);
    animation: fadeOutIn 3s ease forwards infinite;
    animation-delay: 1s;
  }
  
  &--3 {
    font-size: 150px;
    transform: rotate(15deg);
    right: 27.5%;
    top: 45%;
    animation: fadeOutIn 3s ease forwards infinite;
    animation-delay: 2s;
  }
}

// Grouping animations
.head,
.hat__ball,
.hat,
.beard {
  animation: bounceUpDown 3s ease infinite;
}

.ears,
.eye-brows,
.nose {
  animation: bounceUpDown 6s ease infinite;
}

// Keyframes
@keyframes fadeOutIn {
  0% {
    opacity: 0;
  }
  
  50% {
    opacity: 1;
  }
  
  100% {
    opacity: 0;
  }
}

@keyframes bounceUpDown {
  0% {
    transform: translateY(3px);
  }
  
  50% {
    transform: translateY(-3px);
  }
  
  100% {
    transform: translateY(3px);
  }
}

@keyframes bounceInOut {
  0% {
    transform: scale(0.9);
  }
  
  50% {
    transform: scale(1.1);
  }
  
  100% {
    transform: scale(0.9);
  }
}
            
          
!
            
              // STOLEN FROM HERE => https://codepen.io/ivanodintsov/pen/KVgwRG
var canvas = document.getElementById('snow'),
    ctx = canvas.getContext('2d'),
    width = ctx.canvas.width = document.body.offsetWidth,
    height = ctx.canvas.height = document.body.offsetHeight,
    animFrame = window.requestAnimationFrame ||
                window.mozRequestAnimationFrame ||
                window.webkitRequestAnimationFrame ||
                window.msRequestAnimationFrame,
    snowflakes = [];

window.onresize = function() {
  width = ctx.canvas.width = document.body.offsetWidth,
    height = ctx.canvas.height = document.body.offsetHeight;
}

function update() {
  for (var i = 0; i < snowflakes.length; i++) {
    snowflakes[i].update();
  }
}

function Snow() {
  this.x = random(0, width);
  this.y = random(-height, 0);
  this.radius = random(0.5, 3.0);
  this.speed = random(1, 3);
  this.wind = random(-0.5, 3.0);
}

Snow.prototype.draw = function() {
  ctx.beginPath();
  ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
  ctx.fillStyle = '#fff';
  ctx.fill();
  ctx.closePath();
}

Snow.prototype.update = function() {
  this.y += this.speed;
  this.x += this.wind;

  if (this.y > ctx.canvas.height) {
    this.y = 0;
    this.x = random(0, width);
  }
}

function createSnow(count) {
  for (var i = 0; i < count; i++) {
    snowflakes[i] = new Snow();
  }
}

function draw() {
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
  for (var i = 0; i < snowflakes.length; i++) {
    snowflakes[i].draw();
  }
}

function loop() {
  draw();
  update();
  animFrame(loop);
}

function random(min, max) {
  var rand = (min + Math.random() * (max - min)).toFixed(1);
  rand = Math.round(rand);
  return rand;
}

createSnow(150);
loop();
            
          
!
999px
Loading ..................

Console