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="nostalgia"></div>
              
            
!

CSS

              
                // #divtober 19: Nostalgia
// a.singlediv.com/divtober2021

black(alpha)
  rgba(0,0,0,alpha)

white(alpha)
  rgba(255,255,255,alpha)

$cracker-dot = radial-gradient(circle, saddlebrown 20%, alpha(saddlebrown,0) 40%),
               radial-gradient(circle, white(.35) 50%, white(0) 100%),
               radial-gradient(circle, alpha(peru,.2) 40%, alpha(peru,0) 100%)
$cracker-dot-size = 1em 1em, 1em 1em, 1em 1em
  
body
  min-height: 325tive
  background-color: rebeccapurple

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

  &:before,
  &:after
    display: block
    content: ''
    position: absolute
    
  @media (max-width: 400px)
    transform: scale(.8)

#nostalgia
  box-sizing: border-box
  font-size: 10px
  width: 35em
  height: 12em
  margin-left: -(@width/2)
  margin-top: -(@height/2)
  background-repeat: no-repeat
  background-image: linear-gradient(80deg, white(.2) 20%, white(0) 40%),
                    linear-gradient(to bottom, white(0), white(.2),
                                               white(.2), white(0)),
                    linear-gradient(to bottom, white(0), white(.2),
                                               white(.2), white(0)),
                    linear-gradient(to right, white(0), white(.2),
                                              white(.2), white(0)),
                    linear-gradient(to right, white(0), white(.2),
                                              white(.2), white(0)),
                    linear-gradient(to bottom, white(.25) 40%, white(.15) 50%),
                    linear-gradient(to right, alpha(rebeccapurple,0),
                                              darken(rebeccapurple,10),
                                              darken(rebeccapurple,10),
                                              alpha(rebeccapurple,0)),
                    linear-gradient(to right, alpha(rebeccapurple,0),
                                              darken(rebeccapurple,12),
                                              darken(rebeccapurple,12),
                                              alpha(rebeccapurple,0))
  background-size: 5% 20%,
                   .2em 40%,
                   .2em 40%,
                   20% .2em,
                   20% .2em,
                   100% 100%,
                   30% 50%,
                   40% 50%
  background-position: 1% 97%,
                       0 40%,
                       100% 0,
                       10% 0,
                       95% 100%,
                       0 0,
                       90% 0,
                       60% 100%
  box-shadow: 0 2em 0 -1em black(.2)

  &:before,
  &:after
    height: 10em
    top: 1em
    background-repeat: no-repeat
    border-radius: 2em

  &:before
    width: 9em
    left: 1em
    background-color: gold
    background-image: radial-gradient(circle, gold 50%, alpha(gold,0) 60%),
                      radial-gradient(circle, white(.5) 50%, white(0) 60%)
    background-size: 8em 8em,
                     5em 5em
    background-position: 70% 70%,
                         85% 85%
    box-shadow: inset 0 .3em .2em 0 white(.6),
                inset -.4em -.4em 0 black(.4),
                inset 0 0 0 .5em rebeccapurple,
                inset 1.2em 1.2em .4em black(.15)

  &:after
    width: 22.5em
    right: 1.5em
    background-color: rebeccapurple
    background-image: linear-gradient(90deg, crimson, lighten(crimson,10), crimson),
                      linear-gradient(darken(crimson,10), darken(crimson,10)),
                      $cracker-dot, $cracker-dot, $cracker-dot,
                      $cracker-dot, $cracker-dot, $cracker-dot,
                      $cracker-dot, $cracker-dot,
                      linear-gradient(to right, alpha(peru,.4),
                                                alpha(peru,0) 8%),
                      linear-gradient(to left, alpha(peru,.4),
                                                alpha(peru,0) 8%),
                      linear-gradient(to top, alpha(peru,.4),
                                                alpha(peru,0) 14%),
                      linear-gradient(-60deg, alpha(peru,.3), alpha(peru,0)),
                      linear-gradient(wheat, wheat),
                      repeating-linear-gradient(to bottom, darken(wheat,10),
                                                           darken(wheat,10) .4em,
                                                           transparent .4em,
                                                           transparent .8em),
                      repeating-linear-gradient(to right,  darken(wheat,10),
                                                           darken(wheat,10) .4em,
                                                           transparent .4em,
                                                           transparent .8em),
                      linear-gradient(darken(wheat,40), darken(wheat,40)),
                      repeating-linear-gradient(to bottom, darken(wheat,50),
                                                           darken(wheat,50) .4em,
                                                           transparent .4em,
                                                           transparent .8em),
                      repeating-linear-gradient(to right,  darken(wheat,50),
                                                           darken(wheat,50) .3em,
                                                           transparent .3em,
                                                           transparent .6em),
                      linear-gradient(20deg, black(.6) 0%,
                                             black(.4) 20%,
                                             black(.4) 50%,
                                             black(0) 60%),
                      linear-gradient(50deg, black(0) 70%, black(.3) 90%),
                      linear-gradient(white(.1), white(.1))
    background-size: 15em 3em,
                     15em 3.4em,
                     $cracker-dot-size, $cracker-dot-size, $cracker-dot-size,
                     $cracker-dot-size, $cracker-dot-size, $cracker-dot-size,
                     $cracker-dot-size, $cracker-dot-size,
                     18em 7em,
                     18em 7em,
                     18em 7em,
                     18em 7em,
                     18em 7em,
                     18.2em 7em,
                     18em 7.2em,
                     18em 7em,
                     18.4em 7em,
                     18em 7.2em,
                     100% 100%,
                     100% 100%,
                     100% 100%
    background-position: right 2.7em bottom 2.4em,
                         right 2.7em bottom 2em,
                         15% 25%, 14% 28%, 17% 25%,
                         15% 50%, 14% 53%, 17% 50%,
                         15% 75%, 14% 78%, 17% 75%,
                         29% 25%, 28% 28%, 31% 25%,
                         43% 25%, 41% 28%, 45% 25%,
                         57% 25%, 56% 28%, 59% 25%,
                         71% 25%, 70% 28%, 73% 25%,
                         85% 25%, 84% 28%, 87% 25%,
                         2.2em 50%,
                         2.2em 50%,
                         2.2em 50%,
                         2.2em 50%,
                         2.2em 50%,
                         2.1em 50%,
                         2.2em 50%,
                         1.8em 60%,
                         1.7em 60%,
                         1.8em 60%,
                         0 0,
                         0 0,
                         0 0
    box-shadow: inset .2em -.1em .1em .3em darken(rebeccapurple,5),
                inset -.1em .1em .1em .3em white(.6),
                inset .6em .1em .2em .3em white(.2),
                inset 0 -.5em .1em 0 white(.4),
                .5em 0 0 0 rebeccapurple
              
            
!

JS

              
                // @lynnandtonic
// a.singlediv.com

              
            
!
999px

Console