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 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.

            
              // Variables
$pixel-size: 8px;

$p0: transparent;

// *******
// * HAT *
// *******
$p1:  #fafafb; // hat super light gray
$p2:  #f1f1f3; // hat light gray
$p3:  #dededf; // hat gray
$p4:  #e64631; // hat light red
$p5:  #cc3424; // hat red
$p6:  #9e2420; // hat dark red

// ********
// * FACE *
// ********
$p7:  #d5d5d5; // beard gray
$p8:  #abacaa; // beard dark gray
$p9:  #fdfdfd; // beard light gray
$p10: #b18b70; // face dark tan
$p11: #cca182; // face light tan
$p12: #f0f0f1; // face super light gray

// ********
// * SUIT *
// ********
$p13: #b81630; // suit dark red
$p14: #df3527; // suit red
$p15: #c7212e; // suit medium red
$p16: #9e2420; // suit very dark red
$p17: #e98f10; // belt yellow
$p18: #dd8609; // belt dark yellow
$p19: #b92a52; // gloves and legs
$p20: #040404; // feet
$p21: #e6e6e6; // stage

// **********
// * CACTUS *
// **********
$p22: #73c804; // cactus light green
$p23: #60aa04; // cactus green
$p24: #288604; // cactus dark green
$p25: #865004; // cactus brown

// Matrix for santa blocks
$santa:
  $p0 $p0 $p0 $p2 $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p1 $p2 $p3 $p4 $p5 $p0 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14 $p15 $p15 $p15 $p15 $p15 $p14 $p14 $p14 $p13 $p13 $p13 $p13 $p14 $p14,
  $p14 $p15 $p15 $p13 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14,
  $p14 $p13 $p13 $p14 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p14,
  $p14 $p13 $p14 $p14 $p14 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p14,
  $p14 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p14,
  $p14 $p13 $p13 $p14 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p14,
  $p14 $p13 $p14 $p12 $p12 $p14 $p14 $p17 $p18 $p14 $p14 $p12 $p12 $p13 $p14,
  $p14 $p13 $p14 $p14 $p14 $p12 $p12 $p18 $p17 $p12 $p12 $p14 $p14 $p13 $p14,
  $p14 $p13 $p14 $p13 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p14,
  $p19 $p13 $p14 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p13 $p19,
  $p19 $p13 $p14 $p13 $p14 $p14 $p14 $p0 $p14 $p14 $p14 $p14 $p14 $p13 $p19,
  $p0 $p0 $p0 $p13 $p13 $p14 $p0 $p0 $p0 $p14 $p14 $p14 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0 $p0 $p19 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p20 $p0 $p0 $p0 $p0 $p0 $p20 $p0 $p0 $p0 $p0,
  $p21 $p21 $p21 $p20 $p20 $p21 $p21 $p21 $p21 $p21 $p20 $p20 $p21 $p21 $p21;


// NOTE:
// Filled empty bit of
// cactus with transparent
// blocks in order to force
// cactus to grow upwards.
// Same is true with the rest.
$cactus-base:
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p22 $p0 $p0,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p0 $p25 $p0;

$cactus-one:
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p22 $p0 $p0,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p0 $p25 $p0;

$cactus-two:
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0,
  $p0 $p22 $p0 $p0,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p0 $p25 $p0;

$cactus-three:
  $p0 $p22 $p0 $p0,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p24 $p22 $p23,
  $p0 $p23 $p23 $p0,
  $p23 $p23 $p23 $p22,
  $p0 $p23 $p22 $p0,
  $p24 $p23 $p24 $p22,
  $p0 $p0 $p25 $p0;


// Mixin borrowed from https://codepen.io/roborich/pen/dqoDj
@mixin pixelmatic($art, $size: 10px){
  display: block;
  height: $size;
  width: $size;
  $shadow: 0 0 transparent;
  @for $y from 1 through length($art){
    @for $x from 1 through length(nth($art, $y)){
      $shadow: $shadow
      + ", " + 
      ($x * $size)
      + " " + 
      ($y * $size) 
      + " " + 
      nth(nth($art, $y), $x) ;
    }
  }
  box-shadow: unquote($shadow);
}

.santa {
  @include pixelmatic($santa, $pixel-size);
  position: absolute;
  top: 0; left: 0;
  
  .dem-eyes-do {
    position: absolute;
    bottom: -64px; left: 56px;
    height: $pixel-size;
    width: $pixel-size;
    
    background: $p20;
    box-shadow: 16px 0 0 currentColor;
    animation:
      blink 3s infinite,
      shift 3s infinite;
  }
}

@keyframes blink {
  10%, 22%, 34%, 100% {
    height: $pixel-size;
  }
  14%, 18%, 26%, 30% { height: 2px; }
}

@keyframes shift {
  0%, 39%, 81%, 100% {
    transform: translateX(0);
  }
  40%, 80% {
    transform: translateX(8px);
  }
}

.cactus {
  position: absolute;
  bottom: 0; right: 0;
  transform: translateY(-200px);
  animation: let-it-grow 12s linear infinite;
}

@keyframes let-it-grow {
  0%, 29% {
    @include pixelmatic($cactus-base, $pixel-size);
  }
  30%, 54% {
    @include pixelmatic($cactus-one, $pixel-size);
  }
  55%, 79% {
    @include pixelmatic($cactus-two, $pixel-size);
  }
  80%, 100% {
    @include pixelmatic($cactus-three, $pixel-size);
  }
}


// Stage Styles
html,body { height: 100%; }
body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  width: 240px;
  height: 320px;
}
            
          
!
999px
Loading ..................

Console