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

              
                <div id="magic"></div>
              
            
!

CSS

              
                // #divtober 21: Magic
// a.singlediv.com/divtober2021

white(alpha)
  rgba(255,255,255,alpha)
  
body
  min-height: 400px
  height: 100vh
  position: relative
  background-color: #bbb
  overflow: hidden
  font-size: 10px

div
  position: absolute
  left: 50%
  top: 50%

  &:before,
  &:after
    display: block
    content: ''
    position: absolute   

#magic
  width: 50%
  height: 240px
  left: -1em
  bottom: 0
  top: auto
  background-repeat: no-repeat
  background-image: radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%)
  background-size: .5em .5em,
                   .6em .6em,
                   1em 1em,
                   .6em .6em,
                   .7em .7em
  background-position: right  6em  top 6em,
                       right 12em  top 8em,
                       right  2em  top 8em,
                       right  4em  top 10em,
                       right 2.4em top 13em
  border-top-right-radius: 25em 10em
  box-shadow: 1em  -2em 0 crimson,
              1em  -4em 0 orange,
              1em  -6em 0 gold,
              1em  -8em 0 seagreen,
              1em -10em 0 cornflowerblue,
              1em -12em 0 rebeccapurple

  &:before
    width: 100%
    height: 100%
    left: auto
    right: calc((100% + 2em) * -1)
    bottom: 0
    background-repeat: no-repeat
    background-image: radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%)
    background-size: 1em 1em,
                     .5em .5em,
                     .6em .6em,
                     .6em .6em,
                     .7em .7em,
                     .5em .5em
    background-position:  6em  6em,
                         10em  9em,
                          2em  8em,
                          8em  12em,
                         2.2em 15em,
                         15em 3em
    border-top-left-radius: 25em 10em
    box-shadow: -1em  -2em 0 crimson,
                -1em  -4em 0 orange,
                -1em  -6em 0 gold,
                -1em  -8em 0 seagreen,
                -1em -10em 0 cornflowerblue,
                -1em -12em 0 rebeccapurple

  &:after
    width: 24em
    height: 24em
    right: -13em
    bottom: -7em
    border-radius: 50%
    background-repeat: no-repeat
    background-image: linear-gradient(to right, #ddd 40%, white 40%),
                      linear-gradient(to right, #222 40%, #444 40%),
                      linear-gradient(white, white),
                      linear-gradient(white, white),
                      linear-gradient(white, white),
                      linear-gradient(white, white),
                      radial-gradient(circle, white 50%, white(0) 51%),
                      radial-gradient(circle, white 50%, white(0) 51%)
    background-size: 3em 4em,
                     3em 15em,
                     1.5em .3em,
                     .3em 1.5em,
                     1.5em .3em,
                     .3em 1.5em,
                     .6em .6em,
                     1em 1em
    background-position: 50% calc(50% - 5.5em),
                         50% 50%,
                         5em 9em,
                         5.6em 8.4em,
                         right 6em top 4em,
                         right 6.6em top 3.4em,
                         49% 7%,
                         51% 12%
    box-shadow:  2.3em -13.6em 0 -11.7em white,
                 0.3em -15.6em 0 -11.5em white,
                 5.0em -15.5em 0 -11.8em white,
                 3.0em -16.5em 0 -11.8em white,
                 8.0em -19.5em 0 -11.8em white,
                 3.3em -20.0em 0 -11.6em white,
                 6.2em -22.5em 0 -11.8em white,
                 2.2em -22.2em 0 -11.8em white,
                12.2em -22.2em 0 -11.8em white,
                20.0em -25.7em 0 -11.8em white,
                 0.5em -25.5em 0 -11.7em white,
                 -3.0em -14.6em 0 -11.7em white,
                 -1.0em -19.6em 0 -11.7em white,
                 -4.4em -23.6em 0 -11.7em white,
                 -5.4em -20.2em 0 -11.8em white,
                -10.4em -20.2em 0 -11.6em white,
                 -8.4em -27.1em 0 -11.8em white,
                -20.4em -27.7em 0 -11.8em white
              
            
!

JS

              
                // @lynnandtonic
// a.singlediv.com

              
            
!
999px

Console