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

              
                .hatena_container
  .pen_body
    .pen_top_container
      .pen_top
    .pen_bottom
  .handle
              
            
!

CSS

              
                $size: 200px
$color: #2E2E2E
$border_width: $size * 0.08
$pen_body_width: $size * 0.3
$pen_body_height: $size * 0.5
$pen_body_side_width: $size * 0.03
$pen_top_height: $size * 0.3
$pen_top_width: $pen_body_width * 0.1
$pen_top_side_width: (($pen_body_width + ($pen_body_side_width * 2)) - $pen_top_width) / 2 + 0.5 // 少し削れるため、若干はみ出させる
.hatena_container
  position: relative
  height: $size
  width: $size
  border: $border_width solid $color
  border-radius: 50%
  &:after
    position: absolute
    z-index: 3
    display: inline-block
    content: ''
    background-image: radial-gradient(ellipse farthest-corner at 70% 30% , rgba(white, 0.5) 0%, transparent 50%)
    width: 40%
    height: 90%
    top: 5%
    right: 30%
  &:before
    position: absolute
    display: inline-block
    content: ''
    width: $pen_body_width * 1.5
    height: 30%
    left: 28%
    top: 80%
    transform-origin: 100% 100%
    transform: translate(-50%, -50%) rotateZ(15deg)
    background-image: radial-gradient(ellipse farthest-corner at 80% 50% , black 0%, transparent 70%)
  .pen_body
    border-top: $pen_body_height solid $color
    border-left: $pen_body_side_width solid transparent
    border-right: $pen_body_side_width solid transparent
    position: absolute
    top: 62%
    left: 50%
    transform: translate(-50%, -50%)
    width: $pen_body_width
    &:before, &:after
      z-index: 1
      content: ' '
      position: absolute
    &:before
      top: -$pen_top_height - $pen_body_height
      width: $pen_top_width
      left: 50%
      transform: translateX(-50%)
      height: $pen_top_height * 1.4
      background: white
    &:after
      $center_size: $pen_top_width * 3
      bottom: $pen_body_height * 0.7
      left: 50%
      width: $center_size
      height: $center_size
      transform: translate(-50%, 50%)
      background: white
      border-radius: 50%
  .pen_top_container
    position: absolute
    overflow: visible
    bottom: $pen_body_height
    left: 50%
    height: $pen_top_height
    transform: translateX(-50%)
    $width: $pen_top_width * 1.5 // この値を大きくすると、ペン先の曲線が大きくなる
    &:before, &:after
      z-index: 1
      position: absolute
      display: inline-block
      content: ' '
      background: white
      height: $pen_top_height * 1.3
      width: $width
      bottom: 0
      border-radius: 50%
      transform-origin: 50% 100%
    &:before
      left: 0
      bottom: 0
      transform: translate(-70% , 0%) rotateZ(28deg)
    &:after
      bottom: 0
      right: 0
      transform: translate(70% , 0%) rotateZ(-28deg)
    .pen_top
      display: inline-block
      width: $pen_top_width
      border-bottom: $pen_top_height solid $color
      border-left: $pen_top_side_width solid transparent
      border-right: $pen_top_side_width solid transparent
  .pen_bottom
    position: absolute
    top: 100%
    background: $color
    $height: $size * 0.05
    $width: $pen_body_width
    width: $width
    height: $height
    border-radius: 0 0 #{$width / 2} #{$width / 2} / 0 0 #{$height} #{$height}
  .handle
    position: absolute
    background: $color
    width: $border_width * 2
    height: 60%
    left: 84%
    top: 90.38%
    transform-origin: 50% 0
    transform: translateX(-50%) rotate(-40deg)
    border-radius: 0 0 20% 20%
              
            
!

JS

              
                
              
            
!
999px

Console