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.

            
              .stage
  .santa
    .dem-eyes-do
  .cactus
            
          
!
            
              // 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 $p0 $p0 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p1 $p0 $p0 $p5 $p5 $p0 $p0 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p6 $p5 $p5 $p5 $p0 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p6 $p6 $p5 $p5 $p5 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p6 $p6 $p6 $p5 $p5 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p7 $p10 $p11 $p11 $p7 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p7 $p11 $p11 $p11 $p7 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p7 $p10 $p7 $p8 $p7 $p11 $p12 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p8 $p7 $p11 $p7 $p12 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p0 $p0 $p7 $p7 $p7 $p9 $p7 $p0 $p0 $p0 $p0 $p0,
  $p0 $p0 $p0 $p13 $p12 $p9 $p7 $p7 $p7 $p9 $p12 $p14 $p0 $p0 $p0,
  $p0 $p0 $p13 $p13 $p12 $p7 $p12 $p12 $p12 $p7 $p7 $p14 $p14 $p0 $p0,
  $p0 $p0 $p13 $p13 $p14 $p7 $p7 $p7 $p12 $p7 $p14 $p14 $p14 $p0 $p0,
  $p0 $p13 $p13 $p14 $p14 $p14 $p7 $p7 $p12 $p14 $p14 $p14 $p14 $p14 $p0,
  $p0 $p13 $p13 $p14 $p14 $p14 $p7 $p7 $p9 $p14 $p14 $p14 $p14 $p14 $p0,
  $p0 $p13 $p13 $p14 $p14 $p14 $p16 $p13 $p16 $p14 $p14 $p14 $p14 $p14 $p0,
  $p0 $p13 $p13 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p14 $p0,
  $p14 $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
🕑 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