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

              
                input(type='checkbox' id="kirbymove")
label(for="kirbymove") ここを押してね!
.kirby_content
  .kirby_inner
    .eye
      .dark
    .eye.two
      .dark
    .mouth
    .cheek
    .cheek.two
    .hand
    .hand.two
  .foot
  .foot.two
  .comment HI!
              
            
!

CSS

              
                $red: #af2d13;
$dark_red_two: #752b42;
$white: #ffffff;
$black: #000000;
$pink: #ff9db5;
$dark_pink: #d77584;
$dark_pink_two: #f0608b;
$blue: #4b4796;
$dark_blue: #2b3e5a;

@mixin pseudos () {
  content: "";
}
@mixin d-none () {
  display: none;
}
div, input, label {
  font-family: "Open Sans", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}
input[type="checkbox"] {
  @include d-none;
}
input[type="checkbox"] + label {
  text-align: center;
  display: inline-block;
  border-radius: 1vw;
  background-color: $red;
  box-sizing: border-box;
  box-shadow: .5vw .5vw 0 0 $dark_red_two;
  padding: 1.5vw 3.0vw;
  line-height: 1em;
  color: $white;
  font-size: 2vw;
  font-weight: normal;
  cursor: pointer;
}
.kirby_content {
  position: absolute;
  transform: translateX(-50%) translateY(-50%);
  top: 50%;
  left: 50%;
  width: 50%;
  height: auto;
  animation: kirbymove 2s ease-in-out infinite alternate;
  animation-duration: 1.1s;
  .kirby_inner {
    background: linear-gradient(135deg, $pink 70%, $dark_pink);
    border-radius: 50%;
    width: 100%;
    padding: 100% 0 0;
    box-shadow: 0 0 0 0.2vw black;
    .eye, .mouth, .cheek, .hand, foot {
      position: absolute;
    }
    .eye {
        width: 10%;
        padding: 30% 0 0;
        background: $black;
        border-radius: 44%;
        top: 15%;
        left: 30%;
      &:after, &:before {
        @include pseudos;
      }
      &:before {
        background-color: $white;
        position: absolute;
        width: 60%;
        height: 45%;
        border-radius: 44%;
        top: 3%;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;
      }
      &.two {
        left: 60%;
      }
      .dark {
        position: absolute;
        width: 59%;
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        &:before, &:after {
          @include pseudos;
        }
        &:before {
          background-color: black;
          position: absolute;
          width: 100%;
          height: 38%;
          border-radius: 44%;
          top: 47%;
          left: 50%;
          transform: translateX(-50%);
          z-index: 1;
        }
        &:after {
          background-color: $blue;
          position: absolute;
          width: 100%;
          height: 50%;
          border-radius: 44%;
          bottom: 3%;
          left: 50%;
          transform: translateX(-50%);
        }
      }
    }
    .mouth {
      width: 15%;
      height: 8%;
      box-shadow: 0 0.3vw 0 0 $black;
      border-radius: 50%;
      position: absolute;
      top: 50%;
      left: 50%;
      z-index: 50;
      transform: translateX(-50%);
      &:before {
        @include pseudos;
      }
    }
    .cheek {
      background-color: $dark_pink_two;
      position: absolute;
      top: 50%;
      left:10%;
      filter: blur(0.1vw);
      width: 20%;
      height: 10%;
      border-radius: 50%;
      transform: rotate(-10deg);
      z-index: 3;
      &.two {
        left: auto;
        right: 13%;
        transform: rotate(10deg);
      }
    }
    .hand {
      position: absolute;
      top: 40%;
      left: -15%;
      background: linear-gradient(-155deg,$pink 70%,$dark_pink);
      border-radius: 60% 40% 40% 60% / 60% 40% 60% 40%;
      width: 30%;
      padding: 30% 0 0;
      box-shadow: 0 0 0 .2vw $black;
      &:after {
        @include pseudos;
        background: $pink;
        width: 50%;
        height: 100%;
        position: absolute;
        top: 0;
        right: -20%;
        transform: rotate(-3deg);
      }
      &.two {
        top: 20%;
        left: auto;
        right: -14%;
        background: linear-gradient(-35deg,$pink 60%,$dark_pink);
        transform: rotate(165deg);
        box-shadow: 0 0 0 .2vw $black;
        &:after {
          @include pseudos;
          right: -20%;
          transform: rotate(11deg);
        }
      }
    }
  }
  .foot {
    width: 50%;
    height: 30%;
    position: absolute;
    background: $red;
    bottom: -2%;
    border-radius: 50% 40%;
    left: -5%;
    z-index: -1;
    box-shadow: inset 2vw -1vw 0 0 $dark_red_two, 0 0 0 0.2vw $black;
    transform: rotate(-45deg);
    &.two {
     left: auto;
     right: -5%;
     z-index: 1;
    }
  } 
}
.comment {
  font-size: 2.0vw;
  position: absolute;
  top: -10%;
  right: -25%;
  width: 20%;
  height: 0%;
  padding: 12% 10%;
  background: $blue;
  border-radius: 50%;
  text-align: center;
  line-height: 0;
  color: $white;
  font-weight: bold;
  opacity: 0;
  transition: opacity .2s ease;
  box-shadow: 0.5vw 0.5vw 0 0 $dark_blue;
  &:before {
    @include pseudos;
    position: absolute;
    left: 5%;
    bottom: 11%;
    width: 0;
    height: 0;
    margin-bottom: 0;
    border-left: 2vw solid $blue;
    border-top: 3vw solid transparent;
    transform: rotate(-14deg);
    box-shadow: 0 0.5vw 0 0 $dark_blue;
  }
}
input[type="checkbox"]:checked ~ .kirby_content {
  .eye {
    left: 27.5%;
    background: transparent;
    box-shadow: 0 -0.3vw 0 0;
    top: 29%;
    padding: 8% 0 0;
    width: 15%;
    &.two {
      left: 57.5%;
    }
    &:before {
      content: none;
    }
    .dark {
      @include d-none;
    }
  }
  .mouth {
    height: 12%;
    width: 15%;
    border-radius: 40% 40% 50% 50% / 30% 30% 70% 70%;
    background: $dark_red_two;
    &:before {
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 50%;
      height: 50%;
      border-radius: 40% 40% 50% 50% / 30% 30% 70% 70%;
      background: $dark_pink_two;
      display: block;
      position: absolute;
    }
  }
  .comment {
    opacity: 1;
    transition: opacity .2s ease;
  }
}
@keyframes kirbymove{
  0%{
    transform: translateX(-50%) translateY(-50%);
  }
  50%{
    transform: translateX(-50%) translateY(-48%);
  }
  100%{
    transform: translateX(-50%) translateY(-50%);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console