Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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

Save Automatically?

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="container">
    <div class="casio-fx39">

      <div class="brand-container">
        <div class="brand">
          <div class="text">
            <span class="brand-text">CASIO</span> <span class="model-text">fx-39</span>
          </div>
          <div class="sub-text">SCIENTIFIC CALCULATOR</div>
        </div>
      </div>

      <div class="screen">
        <div class="lcd-container">
          <div class="lcd-background">888888888</div>
          <div class="lcd">42</div>
        </div>
      </div>

      <div class="scientific-keypad keypad">
        <div>
          <div class="button-top">
            <span class="secondary">INV</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">1/x</span>
            <span class="secondary">x!</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">√</span>
            <span class="secondary">x²</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">log</span>
            <span class="secondary">10<sup>x</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">ln</span>
            <span class="secondary">e<sup>x</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">x<sup>y</sup></span>
            <span class="secondary">x<sup>1/y</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">+/-</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary" data-secondary="←">º ' "</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">hyp</span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">sin<sup class="secondary">-1</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">cos<sup class="secondary">-1</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">tan<sup class="secondary">-1</sup></span>
          </div>
          <button></button>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">a<sup>b/c</sup></span>
          </div>
          <button></button>
          <div><span>∑x²</span></div>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">X↔Y·</span>
            <span class="secondary">M</span>
          </div>
          <button></button>
          <div><span>∑x</span></div>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">[(···</span>
          </div>
          <button></button>
          <div class="six">6</div>
          <div><span class="italic">n</span></div>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">···)]</span>
          </div>
          <button></button>
          <div><span>X̅</span></div>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">M in</span>
          </div>
          <button></button>
          <div><span>σ</span><span class="italic">n</span></div>
        </div>
        <div>
          <div class="button-top">
            <span class="primary">MR</span>
          </div>
          <button></button>
          <div><span>σ</span><span class="italic">n</span><span>-1</span></div>
        </div>
      </div>

      <div class="normal-keypad keypad">
        <div><button class="dark">7</button></div>
        <div><button class="dark">8</button></div>
        <div><button class="dark">9</button></div>
        <div><button class="clear">C</button></div>
        <div>
          <button class="clear">AC</button>
          <span class="color abs">SAC</span>
        </div>
        <div><button class="dark">4</button></div>
        <div><button class="dark">5</button></div>
        <div><button class="dark">6</button></div>
        <div><button class="light big">×</button></div>
        <div><button class="light big fix">÷</button></div>
        <div><button class="dark">1</button></div>
        <div><button class="dark">2</button></div>
        <div><button class="dark">3</button></div>
        <div><button class="light big">+</button></div>
        <div><button class="light big">—</button></div>
        <div><button class="dark">0</button></div>
        <div><button class="dark">·</button></div>
        <div>
          <button class="light">EXP</button>
          <span>π</span>
        </div>
        <div><button class="light big">=</button></div>
        <div>
          <button class="light">M+</button>
          <div>
            <span class="color">x</span>
            <span class="highlight">DEL</span>
          </div>
        </div>
      </div>

      <div class="mode-selector">
        <input id="deg" type="radio" name="mode" value="deg">
        <label for="deg"></label>

        <input id="rad" type="radio" name="mode" value="rad">
        <label for="rad"></label>

        <input id="gra" type="radio" name="mode" value="gra" checked>
        <label for="gra"></label>

        <input id="sd" type="radio" name="mode" value="sd" checked>
        <label for="sd"></label>
      </div>

      <div class="mode-text">
        <div class="option">DEG—</div>
        <div class="option">RAD—</div>
        <div class="option">GRA—</div>
        <div class="option color">S D —</div>
      </div>

      <div class="casio-bottom"></div>

    </div>
  </div>

<div class="created">
  <span>Created by</span>
  <a href="https://manz.dev/"><h2>Manz.dev</h2></a>
  <p>on <a href="https://twitch.tv/ManzDev">Twitch</a> / <a href="https://youtube.com/c/ManzDev/videos">Youtube</a></p>
</div>
              
            
!

CSS

              
                @use postcss-nested;

@font-face {
  font-family: "Michroma";
  src:
    url(https://manzdev.github.io/twitch-casio-fx39/michroma.woff2) format("woff2"),
    url(https://manzdev.github.io/twitch-casio-fx39/michroma.woff) format("woff");
  font-display: swap;
}

@font-face {
  font-family: "DSEG7";
  src:
    url(https://manzdev.github.io/twitch-casio-fx39/dseg7.woff2) format("woff2"),
    url(https://manzdev.github.io/twitch-casio-fx39/dseg7.woff) format("woff");
  font-display: swap;
}

body {
  background: steelblue;
}

.container {
  display: flex;
  justify-content: center;
}

.casio-fx39 {
  --casio-font: "Michroma", sans-serif;
  --scientific-font: monospace;
  --lcd-font: "DSEG7", monospace;
  --width: 350px;
  --height: 640px;

  display: flex;
  flex-direction: column;
  width: var(--width);
  height: var(--height);
  position: relative;

  & .brand-container {
    height: 100px;
    background: #271923;
    background-image:
      linear-gradient(90deg, #737376 0 1%, #111 2% 4%, transparent 10% 100%),
      linear-gradient(
        to left,
        #8f929c 0 1%,
        #494650 1.5% 2%,
        transparent 2.25% 100%
      ),
      linear-gradient(300deg, #494650 0% 3%, transparent 8% 100%),
      linear-gradient(
        to right,
        #271923 0 10%,
        #3e3942 20% 46%,
        #32252d 48% 50%,
        #3e3942 52% 80%,
        #8f929c 84% 100%
      );
    display: flex;
    justify-content: center;
    border-top: 1px solid #aaa;
    border-radius: 10px 10px 0 0;

    & .brand {
      background: #fefefe;
      background-image: linear-gradient(-300deg, #888, #fff);
      border-radius: 0 0 4px 4px;
      width: 290px;
      height: 80px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      box-shadow:
        1px 1px 1px 1px #2228,
        -3px -3px 10px #aaa inset;

      & .brand-text {
        font-family: var(--casio-font);
        font-size: 16px;
        font-weight: bold;
        text-shadow:
          0.75px 0 0 #0005,
          -0.75px 0 0 #0005,
          0 0.75px 0 #0005,
          0 -0.75px 0 #0005;
      }

      & .model-text {
        font-family: var(--scientific-font);
        font-size: 18px;
        font-style: italic;
        color: #444;
      }

      & .sub-text {
        font-family: var(--casio-font);
        text-align: center;
        font-size: 6px;
        color: #333;
        text-shadow: 0 0 2px #888;
        margin-bottom: 2.5em;
      }
    }
  }

  & .screen {
    height: 140px;
    background: #000;
    box-shadow: 0 0 4px #000;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
      linear-gradient(
        to right,
        transparent 0 1%,
        #a7b3b9 1% 1.25%,
        transparent 1.75% 100%
      ),
      linear-gradient(
        to left,
        transparent 0 1%,
        #a7b3b9 1% 1.25%,
        transparent 1.75% 100%
      );
    position: relative;

    & .lcd-container {
      font-family: var(--lcd-font);
      font-size: 32px;
      position: relative;
      width: 67%;
      height: 32px;
      display: flex;
      justify-content: center;

      & .lcd-background {
        color: #142525;
        position: absolute;
        right: 0;
      }

      & .lcd {
        color: #09d2bc;
        text-shadow:
          0 0 1px #0b6b60aa,
          0 0 2px #3aa399aa,
          0 0 3px #66b1a8aa,
          0 0 4px #1b887baa;
        position: absolute;
        right: 0;
      }
    }

    &::after {
      content: "";
      display: block;
      width: 100%;
      height: 100%;
      position: absolute;
      background: linear-gradient(-25deg, transparent 0 35%, #fff2 48% 53%, transparent 63% 100%);
    }
  }

  & .keypad {
    background: #efeeef;
    background-image:
      linear-gradient(
        to right,
        #9e9492 0 1%,
        transparent 2.5% 91%,
        #fff 96% 98.5%,
        #aaa 99.5% 100%
      );
    padding: 10px 40px 10px 20px;
  }

  & .scientific-keypad {
    height: 150px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);

    & > div {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      border: 1px solid #333;
      border-top: 0;
      border-right: 0;
      position: relative;

      &:nth-child(1),
      &:nth-child(7),
      &:nth-child(13) {
        border-left: 0;
      }
      
      &:nth-child(14) {
        letter-spacing: -1.5px;
      }

      &:nth-child(16) {
        border-left: 0;
      }

      &:nth-child(n+13) div:last-child span {
        color: #14afc7;
        font-size: 12px;
        font-weight: bold;
      }

      &:nth-child(n+13) button {
        margin-bottom: 0;
      }

      & .six {
        position: absolute;
        transform: translate(24px, -18px);
        font-family: var(--casio-font);
        font-weight: bold;
        font-size: 8px;
      }

      & .button-top {
        & .primary {
          font-family: var(--casio-font);
          font-weight: bold;
          font-size: 9px;

          &[data-secondary]::before {
            display: flex;
            position: absolute;
            transform: translate(5px, -5px);
            content: attr(data-secondary);
            color: #924f2e;
            line-height: 175%;
          }
        }

        & .secondary {
          font-family: var(--casio-font);
          font-weight: bold;
          font-size: 9px;
          color: #924f2e;
        }
      }

      & button {
        width: 28px;
        height: 20px;
        background: #b6b1aa;
        border-bottom: 2px solid #4f4239;
        border-top: 1px solid #d0cec8;
        border-right: 1px solid ##CBC9C1;
        border-left: 1px solid #4f4239;
        border-radius: 2px;
        box-shadow: 0 0 1px 2px #222;
        margin-bottom: 8px;

        &:active {
          background: #7e7c7b;
          border-top-color: #464545;
          border-bottom: 0;
        }
      }
    }

    & .color {
      color: #14afc7;
    }

    & .italic {
      font-style: italic;
    }
  }

  & .normal-keypad {
    height: 200px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-left: 15px;
    padding-right: 40px;

    & :nth-child(18) > button {
      font-size: 8px;
    }

    & > div {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    & button {
      width: 38px;
      height: 30px;
      color: #fff;
      border-bottom: 2px solid #4f4239;
      border-top: 1px solid #d0cec8;
      border-left: 1px solid #4f4239;
      border-radius: 2px;
      box-shadow: 0 1px 1px 2px #222;
      font-family: var(--casio-font);
      font-weight: bold;
      font-size: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      &:active {
        color: #aaa;
      }

      &.big {
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 2px;
      }

      &.fix {
        padding-bottom: 8px;
      }

      &.dark {
        background: #111;
        border-bottom-color: #000;
        border-left-color: #000;
        border-top-color: #444;
        border-right-color: #999;

        &:active {
          background: #000;
          border-top-color: #222;
          border-right-color: #000;
          border-bottom: 0;
        }
      }

      &.clear {
        background: #f67801;
        border-top-color: #f59533;
        border-right-color: #f59533;
        border-bottom-color: #cf4500;

        &:active {
          background: #e86929;
          border-top-color: #a55200;
          border-right-color: #cf4500;
          border-bottom: 0;
        }
      }

      &.light {
        background: #62676a;
        border-top-color: #7c8085;
        border-right-color: #7c8085;
        border-bottom-color: #424246;

        &:active {
          background: #444;
          border-top-color: #788;
          border-right-color: #444;
          border-bottom: 0;
        }
      }
    }

    & .color {
      color: #14afc7;
      font-family: var(--casio-font);
      font-weight: bold;
      font-size: 9px;
    }

    & .highlight {
      color: #924f2e;
      font-family: var(--casio-font);
      font-weight: bold;
      font-size: 9px;
    }

    & .abs {
      position: absolute;
      transform: translateY(31px);
      font-size: 7px;

      &::before,
      &::after {
        color: #444;
        font-size: 9px;
      }

      &::before {
        content: "⌞";
      }

      &::after {
        content: "⌟";
      }
    }
  }

  & .mode-text {
    font-family: var(--scientific-font);
    font-weight: bold;
    font-size: 10px;
    color: #555;
    position: absolute;
    right: 0;
    bottom: 270px;
    width: 40px;
    transform: translate(4px, 40px);
    z-index: 0;

    & .option {
      margin-bottom: 10px;
    }

    & .color {
      color: #14afc7;
      letter-spacing: -2px;
    }
  }

  & .mode-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    right: 0;
    top: 300px;
    border-radius: 2px 4px 2px 4px;
    border: 2px solid #333;
    border-right: 0;
    border-bottom: 0;
    border-top: 0;
    background: linear-gradient(to right, #555 0 50%, #999 60% 61%, #666 65% 100%);
    box-shadow: 2px 4px 5px #111 inset;
    z-index: 2;

    & input[name="mode"] {
      display: none;
    }

    & input + label {
      display: block;
      width: 12px;
      height: 25px;
    }

    & input:checked + label {
      background:
        radial-gradient(ellipse 180% 30%, #555 0 20%, #222 20% 28%, transparent 30% 35%),
        repeating-linear-gradient(to bottom, #111 0 1px, #444 1px 2px);
      box-shadow: 0 0 2px 1px #111;
      height: 42px;
      border-radius: 1px;
      border-bottom: 2px solid #111;
    }
  }

  & .casio-bottom {
    height: 35px;
    background: #000;
    border-radius: 0 0 10px 10px / 0 0 30px 30px;
  }
}

.created {
  background: 
    url(https://assets.codepen.io/154065/internal/avatars/users/default.png),
    linear-gradient(to bottom, #884ced, #ec1cce);
  background-size: 75px 75px, cover;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 2em;
  
  & span,
  & h2,
  & p,
  & a {
    font-family: Montserrat;
    margin: 0;
  }
  
  & a,
  & p,
  & span {
    color: #fff;    
  }
  
  & h2 {
    font-weight: 700;
    transform: translate(0, -4px);    
  }
  
  & a {
    text-decoration-color: rgba(255,255,255,0.4);
  }
  
  & a:hover {
    color: #e6e82a;
  }
}
              
            
!

JS

              
                /* Look mom, without JS */
              
            
!
999px

Console