Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .block.block0
.block.block1
.block.block2
.block.block3
.block.block4
.block.block5
.block.block6
.block.block7
.block.block8
.block.block9
.block.block10
.block.block11
.block.block12
              
            
!

CSS

              
                // 原理: 背景是漸層(linear gradient)的時候,可以給%數指定漸層起始位置
//如果漸層%數一樣、或是後者小於前者,就會變成色塊(沒有中間漸變)
//這時配合background-size,指定一個小方塊重複之後,就可以構成各種網點效果了

html,body
  width: 100%
  height: 100%
  margin: 0

.block
  width: 200px
  height: 200px
  display: inline-block
  
//最原始漸層色塊的效果
.block0
  background: linear-gradient(#000 50%,#fff 50%)
  
.block1
  background: radial-gradient(#000 50%,#fff 50%)
  background-size: 5px 5px
  // animation: bscale 10s infinite linear
  
.block2
  background: radial-gradient(#000 20%,#fff 20%)
  background-size: 10px 10px
  animation: bscale 10s infinite linear
  
.block3
  background: radial-gradient(#000 10%,#fff 10%)
  background-size: 15px 15px
  animation: bscale 10s infinite linear
  
.block4
  background: linear-gradient(0deg,#000 30%,#fff 30%)
  background-size: 15px 15px
  animation: bscale 10s infinite linear
  
.block5
  background: linear-gradient(45deg,#fff 45%,#000 45%,#000 55%,#fff 55%)
  background-size: 5px 5px
  animation: bscale 10s infinite linear
  
.block6
  background: linear-gradient(45deg,#fff 45%,#000 55%) 
  background-size: 10px 10px
  animation: bscale 10s infinite linear
  
.block7
  background: radial-gradient(#000 60%,#fff 60%)
  background-size: 3px 3px
  animation: bscale 10s infinite linear
  
.block8
  background: linear-gradient(#000 60%,#fff 60%)
  background-size: 3px 3px
  animation: bscale 10s infinite linear
  
.block9
  background: radial-gradient(#000 30%,#fff 30%)
  background-size: 5px 5px
  animation: bscale 10s infinite linear

@keyframes bscale
  0%
    background-position: 0px 0px
  100%
    background-position: 100% 100%
  
  

//codepen預覽圖調整
@media screen and (max-width: 900px)
  .block0
    display: none
  .block
    width: 175px
    height: 175px
              
            
!

JS

              
                
              
            
!
999px

Console