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

              
                <h1>conic-gradient 绘制</h1>
  <h4>三角形</h4>
  <div class="wrap">
    <div class="d d1"></div>
  </div>
  <h4>箭头</h4>
  <div class="wrap">
    <div class="d d2-1"></div>
  </div>
  <h4>河流</h4>
  <div class="wrap">
    <div class="d d2"></div>
  </div>
  <h4>矩形</h4>
  <div class="wrap">
    <div class="d d3"></div>
  </div>
  <h4>角落的点</h4>
  <div class="wrap">
    <div class="d d4-1"></div>
  </div>
  <h4>棋盘</h4>
  <div class="wrap">
    <div class="d d4"></div>
  </div>
  <h4>虚线</h4>
  <div class="wrap">
    <div class="d d5"></div>
  </div>
  <h4>十字线</h4>
  <div class="wrap">
    <div class="d d6"></div>
  </div>
  <h4>角标</h4>
  <div class="wrap">
    <div class="d d7"></div>
  </div>
  <h4>三角角标</h4>
  <div class="wrap">
    <div class="d d8"></div>
  </div>
              
            
!

CSS

              
                html,
body {
  margin: 0;
  /* height: 100%; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: aliceblue;
  gap: 10px;
}
body{
  padding: 50px;
}
.wrap{
  display: flex;
  gap: 10px;
}
.d{
  width: 100px;
  height: 100px;
  outline: 1px dashed;
  overflow: hidden;
  /* resize: horizontal; */
}
.d1{
  --deg: 0deg;
  transition: 3s --deg;
  background: conic-gradient( from -45deg, royalblue 90deg, transparent 0deg);
  /* background: linear-gradient( -45deg, royalblue 50%, transparent 0); */
}
.d2-1{
  background: conic-gradient(from 30deg at 0 50%, transparent 120deg, royalblue 0deg),
    conic-gradient(from 30deg, royalblue 120deg, transparent 0deg);
  background-size: 40px 60px;
  background-position: 20px 50%, -20px 50%;
  background-repeat: repeat-x;
}
.d2{
  background: conic-gradient(from 30deg at 0 50%, transparent 120deg, royalblue 0deg),
    conic-gradient(from 30deg, royalblue 120deg, transparent 0deg);
  background-size: 40px 60px;
  background-position: 20px 50%, -20px 50%;
}
.d3{
  background: conic-gradient(  royalblue 90deg, transparent 0deg);
}
.d4-1{
  background: conic-gradient( from -90deg at 40px 40px, royalblue 90deg, transparent 0deg);
  background-position: -20px -20px;
}
.d4{
  background: conic-gradient(  royalblue 90deg, transparent 0deg 180deg, royalblue 180deg 270deg, transparent 0deg);
  background-size: 20px 20px;
}
.d5{
  background: conic-gradient( from -90deg at 10px 4px,  royalblue 90deg, transparent 0deg);
  background-size: 30px 30px;
}
.d6{
  background: conic-gradient( from -90deg at 10px 4px,  royalblue 90deg, transparent 0deg),
    conic-gradient( from -90deg at 4px 10px,  royalblue 90deg, transparent 0deg);
  background-size: 30px 30px;
  background-position: 0 3px, 3px 0;
}
.d7{
  background: conic-gradient( from -90deg at 20px 8px,  royalblue 90deg, transparent 0deg),
    conic-gradient( from -90deg at 8px 20px,  royalblue 90deg, transparent 0deg);
  background-position: -10px -4px, -4px -10px;
}
.d8{
  background: conic-gradient( from -45deg at 10px 10px,  royalblue 90deg, transparent 0deg),
    conic-gradient( from 135deg at left 10px bottom 10px,  royalblue 90deg, transparent 0deg);
  background-position: -10px 0;
}
              
            
!

JS

              
                
              
            
!
999px

Console