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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="fox">
    <div class="body">
    <div class="tail">
      <div class="tail2">
        <div class="tail">
          <div class="tail">
            <div class="tail">
              <div class="tail">
                <div class="tail">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="snow"></div>
              
            
!

CSS

              
                $color-fox: transparent !default;
$color-fox-dark: transparent !default;
$color-white: transparent !default;
$color-black: transparent !default;
$color-inner-ears: transparent !default;

*, *::before, *::after {
  border: solid 1px;
}

$color-fox: #E2DEE8;
$color-fox-dark: #C7C3D0;
$color-white: #F0E9EC;
$color-black: #000;
$color-inner-ears: #D5D1DC;

$color-bg: #9095B9;

$fox-width: 470px;
$fox-height: 335px;

$duration: 0.9s;
$delay-hind: -$duration / 4;
$easing: cubic-bezier(0.445, 0, 0.55, 1);


.fox {
  width: $fox-width;
  height: $fox-height;
  min-width: $fox-width;
  min-height: $fox-height;
  
  * {
    position: absolute;
  }
  
  &:after {
    content: '';
    display: block;
    position: absolute;
    width: 80%;
    height: 20px;
    border-radius: 100%;
    background: rgba($color-black, 0.2);
    bottom: -10px;
    left: 10%;
    z-index: -1;
  }
}

$kfs: (
  -30 15   -20 50,
  25 -15   15 30,
); 

$anims: log, log-inner, hind-log, hind-log-inner;
$a-len: length($anims);
$k-len: length($kfs);
@function a($name) {
  @return unquote('#{$name} #{$duration} #{$easing} both infinite');
}

@for $a from 1 through $a-len {
  @keyframes #{nth($anims, $a)} {    
    @for $i from 1 through $k-len {
      $val: nth(nth($kfs, $i), $a);
      @if ($val != x) {        
        $rot: $val * 1deg;
        $p: if($i == 1, unquote('from, to'), percentage(($i - 1) / ($k-len )));

        #{$p} {
          transform: rotate($rot);
        }
      }
    }
  }
}

.body {
  top: 50%;
  left: 170px;
  height: 90px;
  width: 173px;
  background: $color-fox;
  border-top-left-radius: 25% 50%;
  border-bottom-left-radius: 25% 50%;
  // border-top-right-radius: 25% 50%;
  border-bottom-right-radius: 25% 50%;
  transform-origin: right center;
  animation: a(body);
  animation-duration: $duration / 2;
  animation-delay: $delay-hind;

  @keyframes body {
    from, to {
      transform: rotate(-1deg);
    }
    50% {
      transform: rotate(1deg);
    }
  }
}

@mixin n-tail($n, $size: null, $prev: null, $rot: 0deg) {
  $selector: '.tail';
  $sep: ' > ';
  $result: '';
  
  $a: $size / 2;
  $b: $prev / 2;
  $t: sqrt(pow($a + $b, 2) - pow($b - $a, 2));
  $angle: acos($t/($a + $b)) * 180deg / 3.14159;
  $angle: if($size > $prev, $angle, -$angle);
  
  @for $i from 1 through $n - 1 {
    $result: $result + $sep + $selector;
  }
  
  #{unquote($result)} {
    @if ($size) {
      height: $size * 1px;
      width: $size * 1px;
      top: ($size - $prev) / 2 * -1px;
    }
    @content;
    transform-origin: calc(100% + #{$prev * 1px / 2});
    transform: rotate($rot);
    
    &:before, &:after {
      content: '';
      left: 50%;
      position: absolute;
      height: 50%;
      width: $t * 1px;
      display: block;
      background: $color-fox;
    }
    
    &:after {
      bottom: 0;
      transform-origin: top left;
      transform: rotate(-$angle);
    }
    &:before {
      transform-origin: bottom left;
      transform: rotate($angle);
    }
  }
}

.tail {
  border-radius: 50%;
  background: $color-fox;
  // border: 1px solid;
  width: 1rem;
  height: 1rem;
}

$tail1: (
  20 58deg 58deg,
  36 0 0,
  93 -30deg -24deg,
  98 -24deg -17deg,
  36 10deg 41deg,
  15 0deg 10deg,
);

$tail2: (
  20 18deg 18deg,
  70 -33deg -30deg,
  120 -35deg -30deg,
  50 5deg 27deg,
  20 0deg 23deg,
  10 3deg 10deg,
);

.body > .tail {
  $size: nth(nth($tail1, 1), 1);
  height: $size;
  width: $size;
  left: 10px;
  transform: rotate(nth(nth($tail1, 1), 2));
  
  .tail {
    right: 100%;
    border-color: green;
    z-index: -1;
  }
  
  @for $i from 2 through length($tail1) {
    
    @include n-tail($i,
      nth(nth($tail1, $i), 1),
      nth(nth($tail1, $i - 1), 1),
      nth(nth($tail1, $i), 3)
    ) {
      animation: a(tail-#{$i});
      animation-delay: if($i == 4, -200ms, 0) + $delay-hind;
    
      @if $i == 4 {
        background: $color-white !important;
        &:before {
          background: linear-gradient(to right, $color-white, $color-fox) !important;
        }
      }
      @if $i > 4 {
        &, &:before, &:after {
          background: $color-white !important;
        }
      }
      
      @keyframes tail-#{$i} {
        from, to {
          transform: rotate(nth(nth($tail1, $i), 2));
        }
        50% {
          transform: rotate(nth(nth($tail1, $i), 3));
        }
      }
    }
    
    > .tail2 {
      @include n-tail($i,
        nth(nth($tail2, $i), 1),
        nth(nth($tail2, $i - 1), 1),
        nth(nth($tail2, $i), 3)
      ) {
        animation: a(tail2-#{$i});
        animation-delay: if($i == 3, -200ms, 0) + $delay-hind;
        
        @if $i == 3 {
          $x: 90deg;
          background: 
            linear-gradient(45deg, $color-white 25%, transparent 25%),
            linear-gradient(135deg, $color-white 25%, transparent 25%) 0 0,
            linear-gradient(to left, transparent, transparent 66%, $color-white 66%);	
          background-size: 40px 40px, 40px 40px, 100%;
          background-position: center;
          background-color: $color-fox;
          background-repeat: repeat-y;
        }
        
        @if $i == 4 {
          &:before {
            display: none !important;
          }
        }
        
        @if $i >= 4 {
          &, &:before, &:after {
            background: $color-white !important;
          }
        }
      
        @keyframes tail2-#{$i} {
          from, to {
            transform: rotate(nth(nth($tail2, $i), 2));
          }
          50% {
            transform: rotate(nth(nth($tail2, $i), 3));
          }
        }
      }
    }
  }
  
  > .tail2 {
    height: nth(nth($tail2, 1), 1) * 1px;
    width: nth(nth($tail2, 1), 1) * 1px;
    border-radius: 50%;
    position: absolute;
    right: 50%;
    transform-origin: right center;
    transform: rotate(18deg);
    
    .tail {
      border-color: blue;
      z-index: -1;
    }
  }
}

//------------------------------------
body {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background: $color-bg;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

*, *:before, *:after {
  box-sizing: border-box;
  position: relative;
}
              
            
!

JS

              
                /* hover for ❄️ happy holidays! */
              
            
!
999px

Console