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

CSS

              
                $white: #ffffff;
$black: #444444;
$blue-gray: #b5c4d9;

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


body {
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 1;
  background: linear-gradient(-90deg, lighten($blue-gray, 10%) 15%, lighten($blue-gray, 5%) 100%);
}



div.impossible {
    width: 100vmin;
    height: 100vmin;
    top: -15vmin;
    left: 5vmin;
    //transform-origin: 46% 67%;
    //animation: rotatetriangle 20s linear infinite;
    position: relative;  
    display: flex;
    position: relative; 
    justify-content: center;
    align-items: center; 
    margin: 0 auto;
    background: 

   /* bottom-dark */ linear-gradient(60deg, $black 0vmin, $black 38vmin, transparent 38vmin) 20vmin 77vmin / 80vmin 7.5vmin no-repeat,

   /* bottom-mid */ linear-gradient(-120deg, lighten($black, 40%) 0vmin, lighten($black, 40%) 50vmin, transparent 50vmin) -9.5vmin 84.5vmin / 80vmin 7.5vmin no-repeat,

   /* right-light */ linear-gradient(60deg, transparent 18.5vmin, $white 18.5vmin, $white 25vmin, transparent 25vmin) 50vmin 25vmin / 50vmin 60vmin no-repeat,   
    linear-gradient(120deg, $white 0vmin, $white 3.5vmin, transparent 3.5vmin) 75vmin 85vmin / 10vmin 10vmin no-repeat,
      linear-gradient(-120deg, $white 0vmin, $white 3vmin, transparent 3vmin) 65vmin 85vmin / 10vmin 10vmin no-repeat,

   /* left-light */ linear-gradient(-60deg, transparent 18.5vmin, $white 18.5vmin, $white 25vmin, transparent 25vmin) 0vmin 25vmin / 50vmin 60vmin no-repeat,

    /* left-dark */ linear-gradient(-60deg, transparent 18.5vmin, $black 18.5vmin, $black 32vmin, transparent 32vmin) 0vmin 35vmin / 50vmin 50vmin no-repeat,

    /* right-mid */ linear-gradient(60deg, transparent 18.5vmin, lighten($black, 40%) 18.5vmin, lighten($black, 40%) 25vmin, transparent 25vmin) 46.5vmin 34vmin / 50vmin 58vmin no-repeat;
}

 @keyframes rotatetriangle {
   0% {
     transform: rotate(0deg);
   }
  100% {
     transform: rotate(360deg);
   }
}
              
            
!

JS

              
                /* This entry for #divtober 2023 is for impossible. The Penrose Triangle is an impossible triangle that I first became fascinated by in the works of M. C. Escher.   */
              
            
!
999px

Console