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

CSS

              
                /* colors */
$white: #FFFFFF;

$gray: #D9D9D9;

$yellow: #CAC65D;
$red: #CA5D5D;
$blue: #5D75CA;
$green: #60CA5D;

$light-blue1: #DEF9F1;
$light-blue2: #C1EFE1;

/*dimensions */
$full: 100vh;

/* Presets */

*, *:before, *:after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  perspective-origin: 25% 75%;
  background: linear-gradient(187.47deg, $light-blue1 15%, $light-blue2 100%);
  perspective: 700px;
  perspective-origin: 50% 50%;
}

div:before, div:after {
  display: block;
  content: '';
  position: absolute;
}

div.game {
    width: 100vw;
    height: 100vh;
    margin-top: -30vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotateX(15deg);
    background:
      
    /* cable */ linear-gradient(90deg, darken($gray, 35%) 0vh, darken($gray, 65%) 100vh, transparent 3vh) 57.5vh 0vh / 1.5vh 50vh no-repeat,    /* cable-stop */ linear-gradient( darken($gray, 35%) 10vh, darken($gray, 35%) 10vh, transparent 3vh) 53vh 48vh / 11vh 2vh no-repeat,

    /* atop */ linear-gradient( darken($gray, 5%) 10vh, darken($gray, 5%) 10vh, transparent 3vh) 51vh 52vh / 15vh 7vh no-repeat,
      
     /* LEFT SIDE */ 
      
    /* up-tri-l */ linear-gradient(-55deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 38.5vh 57vh / 1.5vh 1.5vh no-repeat,
    /* up-tri-r */ linear-gradient(55deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 40vh 57vh / 1.5vh 1.5vh no-repeat,
    /* up */ linear-gradient( darken($gray, 65%) 10vh, darken($gray, 65%) 10vh, transparent 3vh) 37.5vh 56vh / 5vh 7vh no-repeat,

    /* down-tri-l */ linear-gradient(-125deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 38.5vh 67vh / 1.5vh 1.5vh no-repeat,
    /* down-tri-r */ linear-gradient(125deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 40vh 67vh / 1.5vh 1.5vh no-repeat,
    /* down */ linear-gradient( darken($gray, 65%) 10vh, darken($gray, 65%) 10vh, transparent 3vh) 37.5vh 63vh / 5vh 7vh no-repeat,
      
    /* depth-b */ linear-gradient(-115deg, darken($gray, 85%) 1vh, transparent 1vh) 37.5vh 69.75vh / 1vh 1vh no-repeat,
    /* depth-b */ linear-gradient(115deg, darken($gray, 70%) 1vh, transparent 1vh) 41.5vh 69.75vh / 1vh 1vh no-repeat,
    /* depth-b */ linear-gradient( darken($gray, 70%) 10vh, darken($gray, 70%) 10vh, transparent 3vh) 38vh 69.75vh / 4vh 1vh no-repeat,
      
      
      
    /* left-tri-l */ linear-gradient(-145deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 34vh 62.25vh / 1.5vh 1.5vh no-repeat,
    /* left-tri-r */ linear-gradient(-35deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 34vh 60.75vh / 1.5vh 1.5vh no-repeat,
    /* left */ linear-gradient( darken($gray, 65%) 10vh, darken($gray, 65%) 10vh, transparent 3vh) 33vh 60vh / 7vh 5vh no-repeat,
    /* left */ linear-gradient(-115deg, darken($gray, 85%) 1vh, transparent 1vh) 33.1vh 64.75vh / 1vh 1vh no-repeat,
    /* left */ linear-gradient( darken($gray, 70%) 10vh, darken($gray, 70%) 10vh, transparent 3vh) 34vh 63.75vh / 8vh 2vh no-repeat,
      
    /* right-tri-l */ linear-gradient(145deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 44.5vh 62.25vh / 1.5vh 1.5vh no-repeat,
    /* right-tri-r */ linear-gradient(35deg, darken($white, 20%), 0.75vh, transparent 0.75vh) 44.5vh 60.75vh / 1.5vh 1.5vh no-repeat,
    /* right */ linear-gradient( darken($gray, 65%) 10vh, darken($gray, 65%) 10vh, transparent 3vh) 40vh 60vh / 7vh 5vh no-repeat,
    /* depth-r */ linear-gradient(115deg, darken($gray, 70%) 1vh, transparent 1vh) 46vh 64.75vh / 1vh 1vh no-repeat,
    /* depth-r */ linear-gradient( darken($gray, 70%) 10vh, darken($gray, 70%) 10vh, transparent 3vh) 40vh 63.75vh / 6vh 2vh no-repeat,

    /* l */radial-gradient(circle, $white 10vh, transparent 10vh)  15vh 38vh / 50vh 50vh no-repeat,
    /* l */radial-gradient(circle, $gray 13vh, transparent 13vh)  15vh 38vh / 50vh 50vh no-repeat,
      
      
     /* RIGHT SIDE */ 
      
    /* red */radial-gradient(circle, $red 2.5vh, transparent 2.5vh) 80vh 60vh / 5vh 5vh no-repeat,
    /* red */radial-gradient(circle, darken($red, 15%) 2.5vh, transparent 2.5vh) 80vh 60.5vh / 5vh 5vh no-repeat,
    /* green */radial-gradient(circle, $green 2.5vh, transparent 2.5vh) 75vh 65vh / 5vh 5vh no-repeat,
    /* green */radial-gradient(circle, darken($green, 15%) 2.5vh, transparent 2.5vh) 75vh 65.5vh / 5vh 5vh no-repeat,
    /* blue */radial-gradient(circle, $blue 2.5vh, transparent 2.5vh) 70vh 60vh / 5vh 5vh no-repeat,
    /* depth-blue */radial-gradient(circle, darken($blue, 15%) 2.5vh, transparent 2.5vh) 70vh 60.5vh / 5vh 5vh no-repeat,
    /* yellow */radial-gradient(circle, $yellow 2.5vh, transparent 2.5vh) 75vh 55vh / 5vh 5vh no-repeat,
    /* depth-yellow */radial-gradient(circle, darken($yellow, 15%) 2.5vh, transparent 2.5vh) 75vh 55.5vh / 5vh 5vh no-repeat,
      
    /* r */radial-gradient(circle, $white 10vh, transparent 10vh) 52vh 38vh / 50vh 50vh no-repeat,
    /* r */radial-gradient(circle, $gray 13vh, transparent 13vh) 52vh 38vh / 50vh 50vh no-repeat,
      
      
      
     /* CENTER SIDE */ 

    /* select */radial-gradient(ellipse, darken($gray, 45%) 2vh, transparent 2vh) 55vh 60vh / 3vh 5vh no-repeat,
    /* select */radial-gradient(ellipse, darken($gray, 55%) 2vh, transparent 2vh) 55vh 60.75vh / 3vh 5vh no-repeat,
      
    /* start */radial-gradient(ellipse, darken($gray, 45%) 2vh, transparent 2vh) 59vh 60vh / 3vh 5vh no-repeat,
    /* start */radial-gradient(ellipse, darken($gray, 55%) 2vh, transparent 2vh) 59vh 60.75vh / 3vh 5vh no-repeat,
      
      
    /* base */ linear-gradient( $gray 30vh, $gray 30vh, transparent 3vh) 38vh 50vh / 40vh 17vh no-repeat,
  
  
     /* CENTER SIDE */ 

    /* yellow */radial-gradient(ellipse, darken($gray, 45%) 2vh, transparent 2vh) 55vh 60vh / 3vh 5vh no-repeat,
    /* yellow */radial-gradient(ellipse, darken($gray, 45%) 2vh, transparent 2vh) 59vh 60vh / 3vh 5vh no-repeat,
      
      
      
     /* DEPTH SIDE */ 
      
    /* base */ linear-gradient( darken($gray, 10%)  30vh, darken($gray, 10%) 30vh, transparent 3vh) 50vh 63vh / 15vh 7vh no-repeat,
    /* depth-l */radial-gradient(circle, darken($gray, 10%) 13vh, transparent 13vh) 14.5vh 41vh / 52vh 50vh no-repeat,
    /* depth-r */radial-gradient(circle, darken($gray, 10%) 13vh, transparent 13vh) 50.5vh 41vh / 52vh 50vh no-repeat;
}


              
            
!

JS

              
                /* This entry was an attempt at trying to do something simple but polished, a respite from some of the complex versions I have been working on the first week of divtober. Still couldn't help trying to figure out perspective again.  There is a time-lapse video of making this piece at https://youtu.be/88fKEUnMgNs */
              
            
!
999px

Console