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

              
                <div class="content">
  <div class="wrap">
    <div class="item1"></div>
    <div class="item2"></div>
    
  </div>
  <div class="wrap">
    <div class="item3"></div>
    <div class="item4">
      <!-- 遗迹石方块 -->
      <div class="it"></div>
      <div class="it"></div>
      <div class="it"></div>
      <div class="it"></div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html, body
  height: 100%
  background-image: linear-gradient(to top, #dfe9f3 0%, white 100%)
  overflow: hidden

p2r(size)
  unit(size, px)  

.content
  position: absolute
  top: 50%
  left: 50%
  transform: translate(-50%, -50%)

.wrap
  font-size 0
  text-align center
  &>div
    position relative
    display: inline-block
    $w = p2r(200)
    width: $w
    height: $w
    border-radius 0%
    margin p2r(15)
    &::before
        content ""
        position absolute
        top 5%
        left 5%
        width 100%
        height 100%
        background-color inherit
        border-radius inherit
        transform scale(.95)
        filter blur(10px) brightness(80%) opacity(.8)
        z-index -1

.item1
  background-color: #1160d3
  $line_c1 = #428bf3
  $line_c2 = #3478d8
  background-image: 
    linear-gradient(90deg, $line_c1 1px, transparent 1px),
    linear-gradient($line_c1 1px, transparent 1px),
    repeating-linear-gradient(45deg, $line_c2, $line_c2 1px, transparent 1px, transparent 6.25%)
  $w = 50
  background-size: p2r($w) p2r($w)

.item2
  background-color:#ffe42e
  $circle_c = #f6b914
  $r = 16
  $step1 = unit($r,'%')
  $step2 = unit($r+1,'%')
  background-image: 
      radial-gradient($circle_c $step1, transparent $step2),
      radial-gradient($circle_c $step1, transparent $step2),
      radial-gradient($circle_c $step1, transparent $step2),
      radial-gradient($circle_c $step1, transparent $step2)
  $w = 30
  background-size: p2r($w) p2r($w)
  background-position: 0 0, p2r($w / 2) 0, p2r($w / 4) p2r($w / 2), p2r($w / 4 * 3) p2r($w / 2)

.item3
    background-color:#fc7a65
    $line_c = #fc846f
    // 角度值
    $angle = 60deg
    // 比例
    $w1 = 2
    $w2 = 3
    // $p必须是100的公因数
    $p = 10
    // 线条所占百分比
    $p1 = unit($p*($w1/($w1+$w2)),'%')
    $p2 = unit($p,'%')
    background-image: 
      repeating-linear-gradient($angle, $line_c, $line_c $p1, transparent $p1, transparent $p2)
    $h = 100
    background-size: p2r($h/tan(abs($angle))) p2r($h)
    background-position: 0 0
 
bp($W)
    $s = ''
    for i in (1..8)
        if(i != 8)
            $s = $s + '0' + ' ' + p2r(0.125 * (i - 1) * $W) + ','
        else
            $s = $s + '0' + ' ' + p2r(0.125 * (i - 1) * $W)
    return unquote($s)

.item4
    $c1 = #738073
    background-color $c1
    $c2 = #747475
    white-space normal
    vertical-align top
    .it
        width 50%
        height 50%
        display inline-block
        $W = 100
        border-top-left-radius inherit
        background-image linear-gradient(90deg, $c2 37.5%, $c1 37.5%, $c1 50%, $c2 50%, $c2 62.5%, $c1 62.5%, $c1 75%, $c2 75%, $c2 87.5%, $c1 87.5%, $c1 100%),
                        linear-gradient(90deg, $c2 37.5%, $c1 37.5%, $c1 50%, $c2 50%, $c2 62.5%, $c1 62.5%, $c1 75%, $c2 75%, $c2 100%),
                        linear-gradient(90deg, $c2 25%, $c1 25%, $c1 37.5%, $c2 37.5%, $c2 62.5%, $c1 62.5%),
                        linear-gradient(90deg, $c1 25%, $c2 25%, $c2 50%, $c1 50%, $c1 62.5%, $c2 62.5%),
                        linear-gradient(90deg, $c2 37.5%, $c1 37.5%, $c1 50%, $c2 50%, $c2 75%, $c1 75%),
                        linear-gradient(90deg, $c1 37.5%, $c2 37.5%, $c2 62.5%, $c1 62.5%, $c1 75%, $c2 75%),
                        linear-gradient(90deg, $c2 25%, $c1 25%, $c1 37.5%, $c2 37.5%, $c2 50%, $c1 50%, $c1 62.5%, $c2 62.5%, $c2 100%),
                        linear-gradient(90deg, $c1 12.5%, $c2 12.5%, $c2 25%, $c1 25%, $c1 37.5%, $c2 37.5%, $c2 50%, $c1 50%, $c1 62.5%, $c2 62.5%)
        background-size p2r($W) p2r(0.125*$W)
        background-position bp($W)
        background-repeat no-repeat
        &:nth-child(2)
            transform rotateZ(90deg)
        &:nth-child(3)
            transform rotateZ(270deg)
        &:nth-child(4)
            transform rotateZ(540deg)
              
            
!

JS

              
                
              
            
!
999px

Console