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="testcard-container">
      <div class="testcard"></div>
      <div class="orangebox-container">
        <div class="orangebox"></div>
      </div>
      <div class="circlecard-container">
        <div class="circlecard">
          <div class="blocks">
            <div class="title block">
              <span class="text">Manz.dev</span>
            </div>
            <div class="primary-color group">
              <div class="yellow block"></div>
              <div class="cyan block square"></div>
              <div class="green block square"></div>
              <div class="pink block square"></div>
              <div class="red block square"></div>
              <div class="blue block"></div>
            </div>
            <div class="grayscale-color group">
              <div class="black block"></div>
              <div class="black-100 block square"></div>
              <div class="black-200 block square"></div>
              <div class="white-200 block square"></div>
              <div class="white-100 block square"></div>
              <div class="white block"></div>
            </div>
            <div class="gradient group">
              <div class="black block square"></div>
              <div class="grad-1 block square"></div>
              <div class="grad-2 block square"></div>
              <div class="grad-3 block square"></div>
              <div class="grad-4 block square"></div>
              <div class="grad-5 block square"></div>
              <div class="white block square"></div>
            </div>
            <div class="black-white group">
              <div class="black layer">
                <div class="black cell"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="cross-container">
        <div class="cross-inner-container">
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="cross"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="cross"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="cross"></div>
          <div class="empty"></div>
          <div class="empty"></div>
          <div class="empty"></div>
        </div>
      </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: "Bebas Neue";
  src:
    url(https://manz.dev/assets/fonts/bebas-neue.woff2) format("woff2"),
    url(https://manz.dev/assets/fonts/bebas-neue.woff) format("woff");
}

:root {
  --fancy-color1: #884ced;
  --fancy-color2: #ec1cce;
}

body {
  background: black;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 95vw;
  height: 95vh;
}

.testcard-container {
  --width: calc(var(--height) / 0.75);
  --height: 500px;
  --cell-width: calc(var(--width) / 20);
  --cell-height: calc(var(--height) / 16);

  width: var(--width, 900px);
  height: var(--height);
  background: #fff;
  clip-path: inset(10px 5px 10px 5px);
  position: relative;

  & .testcard {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(16, 1fr);
    gap: 2px;

    & .cell {
      background: #808080;

      --color1: black;
      --color2: white;

      &.top { background: linear-gradient(to top, var(--color1) 25%, var(--color2) 25% 100%); }
      &.left { background: linear-gradient(to left, var(--color1) 25%, var(--color2) 25% 100%); }
      &.right { background: linear-gradient(to right, var(--color1) 25%, var(--color2) 25% 100%); }
      &.bottom { background: linear-gradient(to bottom, var(--color1) 25%, var(--color2) 25% 100%); }

      &.invert {
        --color1: white;
        --color2: black;
      }

      /* Limit case */
      &:nth-child(320) {
        --color1: black;
        --color2: white;

        transform: rotate(270deg) scaleX(-1);
      }

      &:nth-child(263) { grid-column-start: span 4; }
      &:nth-child(272) { grid-column-start: span 4; }

      &:nth-child(273),
      &:nth-child(274),
      &:nth-child(275),
      &:nth-child(276),
      &:nth-child(277),
      &:nth-child(278) {
        display: none;
      }
    }
  }

  & .orangebox-container {
    width: var(--width);
    height: var(--height);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    & .orangebox {
      width: calc(var(--width) * 0.6999);
      height: calc(var(--height) * 0.623);
      background: #ff7f00;
    }
  }

  & .circlecard-container {
    width: var(--width);
    height: var(--height);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    & .circlecard {
      width: calc(var(--width) * 0.64);
      height: calc(var(--height) * 0.82);
      border-radius: 50%;
      overflow: hidden;
      background: var(--fancy-color1);

      & .blocks {
        & .title.block {
          width: 100%;
          height: calc(var(--height) * 0.2855);
          background: var(--fancy-color1);
          display: flex;
          justify-content: center;
          align-items: flex-end;

          & .text {
            font-family: "Bebas Neue", sans-serif;
            font-size: calc(var(--width) * 0.13);
            color: #fff;
            filter: drop-shadow(0 1px 2px #000a);
            transform: translateY(calc(var(--height) * 0.036));
          }
        }

        & .group {
          display: flex;
        }

        & .primary-color {
          width: 100%;
          height: calc(var(--cell-height) * 2);
        }

        & .grayscale-color {
          width: 100%;
          height: calc(var(--cell-height) * 2);
          background: blue;
        }

        & .gradient {
          width: 100%;
          height: calc(var(--cell-height) * 2);
          background: green;
        }

        & .black-white {
          width: 100%;
          height: var(--cell-height);
          background: white;
          display: flex;
          justify-content: center;
        }

        & .block {
          background: var(--bgcolor);
          width: 100%;
          height: 100%;

          &.square { width: 85%; }

          &.yellow { --bgcolor: #dfdf1f; }
          &.cyan { --bgcolor: #1fe0df; }
          &.green { --bgcolor: #20df20; }
          &.pink { --bgcolor: #df20df; }
          &.red { --bgcolor: #de2020; }
          &.blue { --bgcolor: #2021de; }
          &.black { --bgcolor: #000; }
          &.black-100 { --bgcolor: #323232; }
          &.black-200 { --bgcolor: #656565; }
          &.white { --bgcolor: #fff; }
          &.white-100 { --bgcolor: #ccc; }
          &.white-200 { --bgcolor: #989898; }
          &.grad-1 { --bgcolor: repeating-linear-gradient(to right, #000 0, #fff 4px, #000 8px); }
          &.grad-2 { --bgcolor: repeating-linear-gradient(to right, #000 0, #fff 4px, #000 5px); }
          &.grad-3 { --bgcolor: repeating-linear-gradient(to right, #000 0, #fff 2px, #000 4px); }
          &.grad-4 { --bgcolor: repeating-linear-gradient(to right, #000 0, #fff 1px, #000 3px); }
          &.grad-5 { --bgcolor: repeating-linear-gradient(to right, #000 0, #fff 2px); }
        }

        & .layer {
          width: 100%;

          &.black {
            width: 48%;
            background: black;

            & .cell {
              width: var(--cell-width);
              height: 100%;
              border-right: 1px solid #fff;
            }
          }
        }
      }
    }
  }

  & .cross-container {
    width: var(--width);
    height: var(--height);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    & .cross-inner-container {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      grid-template-rows: repeat(3, 1fr);
      width: calc(var(--width) * 0.335);
      height: calc(var(--width) * 0.128);

      & .cross {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;

        &::before {
          content: "";
          display: block;
          width: 1px;
          height: 100%;
          background: #fff;
          position: absolute;
        }

        &::after {
          content: "";
          display: block;
          width: 100%;
          height: 1px;
          background: #fff;
          position: absolute;
        }
      }
    }
  }
}

.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

              
                const testcardContainer = document.querySelector(".testcard-container");
const testcard = document.querySelector(".testcard");

const addCell = (cellNumber) => {
  const cell = document.createElement("div");
  cell.classList.add("cell");

  const isTopCell = (cellNumber > 0 && cellNumber < 19);
  const isBottomCell = (cellNumber > 300 && cellNumber < 319);
  const isInvertCell = cellNumber % 2 === 0;

  if (isTopCell) {
    cell.classList.add("top");
    isInvertCell && cell.classList.add("invert");
  }
  if (isBottomCell) {
    cell.classList.add("bottom");
    isInvertCell && cell.classList.add("invert");
  }

  const isLeftCell = (cellNumber % 20 === 0);
  const isRightCell = (cellNumber % 20 === 19);
  const isInvertLeftCell = cellNumber % 40 === 0;
  const isInvertRightCell = cellNumber % 40 === 39;

  if (isLeftCell) {
    cell.classList.add("left");
    isInvertLeftCell && cell.classList.add("invert");
  }
  if (isRightCell) {
    cell.classList.add("right");
    isInvertRightCell && cell.classList.add("invert");
  }

  testcard.appendChild(cell);
};

for (let i = 0; i < 320; i++) {
  addCell(i);
}

testcardContainer.style.setProperty("--height", `${innerHeight - 20}px`);
              
            
!
999px

Console