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

              
                <article id="artboard" class="wall" role="img" role="img" aria-labelledby="image-alt" aria-describedby="image-info">
  <header>
    <h1 id="image-alt">Single Pole Switch - EFAPEL - LOGUS 90 - ANIMATO Laranja/Gelo | JG</h1>
    <p id="image-info">
      <address> 
        Created by 
        <a href="https://twitter.com/ricksdev">
          Ricardo Ferreira
        </a>
      </address>
      on
      <time datetime="2023-02-09">Fabruary 9th, 2023</time>
    </p>
  </header>
  <!-- HTML of the image -->
  <div class="grid-place">
      <label class="efapel-logus90">
      <input type="checkbox" id="lights" />
        <div class="switch" id="switch">
          <div class="esp laranja"> 
            <div class="fil">
              <div class="tcl"></div>
              <div class="on-off"></div>
              <div class="logo roboto">EFAPEL</div>
            </div>
          </div>
        </div>
    </label>
  </div>
</article>
              
            
!

CSS

              
                html,body{
  height:100%;
}
*{
  margin: 0;
}

header{
  padding: 5%;
  display: none;
  h1{
    margin-bottom: 3px;
  }
}

/* Similar font logo */ 
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;1,700&display=swap');
.roboto{
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-style: italic;
  span{
    font-weight: 300;
    font-style: normal;
  }
}
  
.wall{
  width: 100%;
  height: 100%;
  background: #eee;
  display: flex;
  flex-direction: column;
}
.grid-place{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.efapel-logus90{
  position: relative;
  width: 100%;
  max-width: 500px;
  &:after {
    content: "";
    display: block;
    padding-bottom: 100%;
  }
  input[type="checkbox"] {
    display: none;
    &:checked + .switch{
      .esp{
        &:after{
          content:"";
          position: fixed;
          width: 100vw;
          height: 100vh;
          background: rgb(255,255,255);
background: linear-gradient(188deg, rgba(255,237,170,0.20) 5%, rgba(252,222,157,0.06) 100%);
          top: 0;
          left: 0;
          z-index: 99999;
        }
        .fil{
          .tcl{
            box-shadow: -5px 3px 25px -8px rgb(0 0 0 / 45%);
background: linear-gradient(160deg, #d5d5d5 0%, #F0F0F0 100%);
            box-sizing: border-box;
            border: 2px solid #777;
            border-top-width: 3px;
            border-bottom-width: 1px;
          }
          .on-off {
              box-shadow: -8px -6px 35px 0px rgb(0 0 0 / 15%);
          }
        }
      }
    }
  }
  .switch{
      position: absolute;
      width: 100%;
      height: 100%;
    .esp{
      width: 100%;
      height: 100%;
      background: #222;
      box-shadow: -1px 2px 3px -1px rgba(0,0,0,0.75);
      border-radius:2px;
      position: relative;
      display: flex;
      &.laranja{
        background: rgb(155,68,2);
background: linear-gradient(45deg, rgba(155,68,2,1) 0%, rgba(213,111,37,1) 100%);
      }
      .fil{
        width: 68%;
        height: 68%;
        margin: 16%;
        background: #fff;
        position: relative;
        box-shadow: -1px 2px 10px -2px rgb(0 0 0 / 75%);
        border-radius: 4px;
        background: rgb(155,68,2);
        display: flex;
background: linear-gradient(45deg, #E1E1E1 0%, #F1F0ED 100%);
        .tcl{
          width: 84%;
          height: 84%;
          margin: 8%;
          background: rgb(155,68,2);
          position: relative;
          border-radius: 4px;
          box-shadow: -4px 7px 18px -3px rgb(0 0 0 / 55%);
background: linear-gradient(20deg, #E0E0E0 0%, #F0F0F0 100%);
          box-sizing: border-box;
          border: 2px solid #777;
          border-top-width: 1px;
          border-bottom-width: 3px;
        }
        .on-off{
          position:absolute;
          width: 84%;
          height: 84%;
          margin: 8%;
          box-shadow: -8px 25px 35px 0px rgba(0,0,0,0.15);
        }
        .logo{
          position: absolute;
          bottom: 1%;
          right: 8%;
          font-size: min(1.8vw, 20px);
          color: #ddd;
          letter-spacing: 0.03em;
          text-shadow: -2px 1px 2px rgb(0 0 0 / 45%), 1px 0px 3px rgb(255 255 255 / 90%);
        }
      }
    }
  }
}

              
            
!

JS

              
                /* js just for scaling and make it kind of responsive */
let outer = document.getElementById('switch'),
    wrapper = document.getElementById('artboard'),
    maxWidth  = outer.clientWidth+100,
    maxHeight = outer.clientHeight+100;
window.addEventListener("resize", resize); 
resize();
function resize(){let scale,
    width = window.innerWidth,
  height = window.innerHeight,
  isMax = width >= maxWidth && height >= maxHeight;
    scale = Math.min(width/maxWidth, height/maxHeight);
    outer.style.transform = isMax?'':'scale(' + (scale) + ')';
    wrapper.style.width = isMax?'':maxWidth * (scale);
    wrapper.style.height = isMax?'':maxHeight * (scale);
} 
              
            
!
999px

Console