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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

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

Packages

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.

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

              
                .hanami-neko
  .cherry-tree
    .cherry-tree__cherry
      - for (var i = 0; i < 40; i++)
        - for (var j = 0; j < 50; j++)
          .sakura(style=`top: ${i*10}px; left: ${j*8-20}px;transform: scale(0.5) rotate(${i*i*j*j}deg);`)
    .cherry-tree__tree

  .cherry-tree
    .cherry-tree__cherry
      - for (var i = 0; i < 40; i++)
        - for (var j = 0; j < 50; j++)
          .sakura(style=`top: ${i*10}px; left: ${j*8-20}px;transform: scale(0.5) rotate(${i*i*j*j}deg);`)
    .cherry-tree__tree

  .sakura-wrapper
    - for (var i = 0; i < 35; i++)
      .sakura(style=`left: ${8.5*i}px;`)

  .dango
    .dango__part

  .cat-wrapper
    .cat
      .cat__tail
      .cat__body
      .cat__hand.cat__hand--right
      .cat__hand.cat__hand--left
      .cat__face
        .cat__nose
        .cat__eye
        .cat__beard.cat__beard--right
        .cat__beard.cat__beard--left
        .cat__ear.cat__ear--right
        .cat__ear.cat__ear--left

      .pc
        .pc__huta
        .pc__icon
          .pc__icon-dot
        .pc__bottom
              
            
!

CSS

              
                $CAT_COLOR: #85909e;
$CAT_HAND_COLOR: #aab6c5;
$SAKURA_COLOR: #fde2e2;
$BG_COLOR: #ffb6b6;
$BLACK_COLOR: #333;
$PC_COLOR: #aacfcf;
$PC_ICON_COLOR: #679b9b;

@mixin keyframes($animation-name) {
  @-webkit-keyframes #{$animation-name} {
    @content;
  }
  @-moz-keyframes #{$animation-name} {
    @content;
  }
  @keyframes #{$animation-name} {
    @content;
  }
}

@mixin animation($animation-name) {
  -webkit-animation: $animation-name;
  -moz-animation: $animation-name;
  animation: $animation-name;
  -webkit-animation-fill-mode: both;
  -moz-animation-fill-mode: both;
  animation-fill-mode: both;
}

@mixin prefixes($property, $value) {
  @each $prefix in -webkit-, -moz-, -ms-, -o-, "" {
    #{$prefix}#{$property}: $value;
  }
}

.hanami-neko {
  position: relative;
  margin: auto;
  top: calc(50% - 150px);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}

.cat-wrapper {
  position: absolute;
  left: 41px;
  bottom: 78px;
}

.cat {
  $base: &;
  position: absolute;
  top: 0;
  left: 80px;
  width: 140px;
  height: 100px;
  &__body {
    position: absolute;
    width: 63px;
    height: 75px;
    border-radius: 20px 50%;
    background-color: $CAT_COLOR;
    top: 35px;
    left: 12px;
    @include prefixes(transform, rotate(-13deg));
  }
  &__hand {
    position: absolute;
    width: 13px;
    height: 43px;
    border-radius: 20px 50%;
    background-color: $CAT_HAND_COLOR;
    top: 44px;
    left: 42px;
    z-index: 1;
    overflow: hidden;
    @include prefixes(transform, rotate(50deg));
    @include prefixes(transform-origin, top center);

    &:after {
      top: 32px;
      width: 100%;
      height: 20px;
      background: #fff;
    }
    &--left {
      left: 6px;
      z-index: 0;
      @include animation(cat-hand 0.1s 0.05s linear alternate infinite);
    }
    &--right {
      @include animation(cat-hand 0.1s linear alternate infinite);
    }
  }
  &__tail {
    position: absolute;
    bottom: -16px;
    right: 38px;
    width: 45px;
    height: 65px;
    background-color: transparent;
    border-bottom: 6px solid $CAT_HAND_COLOR;
    border-radius: 10%;
    border-bottom-left-radius: 34px;
    @include prefixes(transform-origin, left center);
    @include prefixes(transform, rotate(-90deg));
    @include animation(cat-tail 0.5s linear alternate infinite);
  }
  &__ear {
    position: absolute;
    border-bottom: 13px solid $CAT_COLOR;
    border-left: 11px solid transparent;
    border-right: 10px solid transparent;
    border-radius: 6px;
    &--right {
      top: -4px;
      left: 33px;
      @include prefixes(transform, rotate(-83deg));
    }
    &--left {
      top: -6px;
      left: -3px;
      @include prefixes(transform, rotate(90deg));
    }
  }
  &__face {
    position: absolute;
    width: 50px;
    height: 45px;
    border-radius: 18px;
    background-color: $CAT_COLOR;
    top: 8px;
    left: 0;
    @include animation(cat-face 0.2s linear alternate infinite);
  }
  &__beard {
    position: absolute;
    top: 15px;
    width: 9px;
    height: 1px;
    background-color: $BLACK_COLOR;
    &:before {
      width: 9px;
      height: 1px;
      background-color: $BLACK_COLOR;
      top: 2px;
    }
    &:after {
      width: 9px;
      height: 1px;
      background-color: $BLACK_COLOR;
      top: 4px;
    }
    &--right {
      top: 24px;
      right: 4px;
      @include prefixes(transform, rotate(5deg));
    }
    &--left {
      top: 21px;
      left: -3px;
      @include prefixes(transform, rotate(6deg));
    }
  }
  &__eye {
    position: absolute;
    top: 13px;
    left: 18px;
    &:before,
    &:after {
      top: 0;
      background: $BLACK_COLOR;
      width: 4px;
      height: 5px;
      border-radius: 50%;
    }
    &:before {
      left: 11px;
    }
    &:after {
      left: -11px;
    }
  }
  &__nose {
    position: absolute;
    border-radius: 50%;
    width: 7px;
    height: 4px;
    background-color: #ffb6b6;
    top: 22px;
    left: 15px;
  }
}

.pc {
  position: absolute;
  top: 9px;
  left: -88px;
  width: 158px;
  height: 80px;
  &__icon {
    position: absolute;
    top: 28px;
    left: 27px;
    width: 11px;
    height: 9px;
    border-radius: 50% 50% 20% 20%;
    background: $PC_ICON_COLOR;
    z-index: 2;
  }
  &__icon-dot {
    position: absolute;
    top: -7px;
    left: 3px;
    width: 4px;
    height: 4px;
    background: $PC_ICON_COLOR;
    border-radius: 50%;
    &:before,
    &:after {
      width: 4px;
      height: 4px;
      background: $PC_ICON_COLOR;
      border-radius: 50%;
    }
    &:before {
      top: 3px;
      left: -6px;
    }
    &:after {
      top: 3px;
      left: 6px;
    }
  }
  &__huta {
    position: absolute;
    width: 80px;
    height: 70px;
    background: $PC_COLOR;
    border-radius: 5px;
    border: 1px solid $PC_COLOR;
    z-index: 1;
    @include prefixes(transform, skew(10deg));
  }
  &__bottom {
    position: absolute;
    top: 55px;
    left: 33px;
    width: 88px;
    height: 20px;
    background: $PC_COLOR;
    border-radius: 10px;
    border: 1px solid $PC_COLOR;
    @include prefixes(transform, skew(-72deg));
    &:after {
      top: 3px;
      left: -12px;
      width: 88px;
      height: 20px;
      background: $PC_ICON_COLOR;
    }
  }
}

.dango {
  position: absolute;
  top: 169px;
  right: 17px;
  width: 50px;
  height: 50px;
  border-left: 2px solid #333;
  @include prefixes(transform, rotate(-45deg));

  &__part {
    position: absolute;
    top: 16px;
    left: -7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fcf7bb;
    &:before,
    &:after {
      width: 12px;
      height: 12px;
      border-radius: 50%;
    }
    &:before {
      top: -12px;
      background: #f19292;
    }
    &:after {
      top: 12px;
      background: #cbe2b0;
    }
  }
}

@mixin sakura-animation($duration, $delay) {
  @include animation(#{$duration}s ease-in-out #{$delay}s infinite sakura);
}

.sakura-wrapper {
  width: 100%;
  height: 100%;
  .sakura {
    @include sakura-animation(10, 0);
    &:nth-of-type(2n) {
      @include sakura-animation(8, 2);
    }
    &:nth-of-type(3n) {
      @include sakura-animation(6, 1);
    }
    &:nth-of-type(4n) {
      @include sakura-animation(7, 3);
    }
    &:nth-of-type(5n) {
      @include sakura-animation(9, 6);
    }
    &:nth-of-type(6n) {
      @include sakura-animation(11, 4);
    }
    &:nth-of-type(7n) {
      @include sakura-animation(8, 5);
    }
    &:nth-of-type(8n) {
      @include sakura-animation(9, 8);
    }
    &:nth-of-type(9n) {
      @include sakura-animation(8, 7);
    }
  }
}

.sakura {
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid $SAKURA_COLOR;
  border-radius: 15px;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  opacity: 0.8;
  @include prefixes(transform, scale(0.5) translateY(-10px));

  &:after {
    display: block;
    top: -7px;
    left: -7px;
    height: 0;
    width: 0;
    border: 10px solid $SAKURA_COLOR;
    border-radius: 15px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    @include prefixes(transform, rotate(15deg));
  }
}

.cherry-tree {
  position: absolute;
  top: -40px;
  right: -58px;
  width: 200px;
  height: 500px;
  &__cherry {
    position: absolute;
    top: -45px;
    left: -75px;
    width: 312px;
    height: 270px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
  }
  &__tree {
    position: absolute;
    right: 50px;
    bottom: 85px;
    width: 100px;
    height: 200px;
    background: brown;
    z-index: 0;
    &:after {
      right: 58px;
      top: -39px;
      width: 100px;
      height: 200px;
      background: #fff;
      border-radius: 50%;
      @include prefixes(transform, rotate(18deg));
    }
  }
  &:nth-of-type(2) {
    top: -20px;
    left: -58px;
    @include prefixes(transform, rotateY(180deg));
  }
}

@include keyframes(cat-face) {
  0% {
    @include prefixes(transform, rotate(0));
  }
  100% {
    @include prefixes(transform, rotate(-10deg));
  }
}

@include keyframes(cat-hand) {
  0% {
    @include prefixes(transform, rotate(50deg));
  }
  100% {
    @include prefixes(transform, rotate(70deg));
  }
}

@include keyframes(cat-tail) {
  0% {
    @include prefixes(transform, rotate(-85deg));
  }
  100% {
    @include prefixes(transform, rotate(-105deg));
  }
}

@include keyframes(sakura) {
  0% {
    @include prefixes(transform, scale(0.5) translateY(-10px) rotateY(0deg));
  }
  50% {
    @include prefixes(transform, scale(0.5) translateY(220px) rotateY(90deg));
  }
  100% {
    @include prefixes(transform, scale(0.5) translateY(600px) rotateY(180deg));
  }
}

// base
html, body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: $BG_COLOR;
  overflow: hidden;
}

* {
  &:before,
  &:after {
    content: "";
    position: absolute;
  }
}
              
            
!

JS

              
                // (`・ω・´)
// No images, just CSS.
// Chrome recommended.
// twitter.com/study_dedede
              
            
!
999px

Console