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

              
                <canvas></canvas>

  <div class="container">

    <div class="falcon-container">

      <div class="back-effects">
        <div class="circle"></div>
        <a class="text" href="https://manz.dev/">MANZ.DEV</a>
      </div>

      <div class="falcon-bottom-container">
        <div class="escape-pod-shape">
          <div class="escape-pod-container left">
            <div class="escape-pod">
              <div class="dot"></div>
              <div class="dot"></div>
              <div class="dot"></div>
            </div>
          </div>
        </div>
        <div class="escape-pod-shape">
          <div class="escape-pod-container right">
            <div class="escape-pod">
              <div class="dot"></div>
            </div>
          </div>
        </div>
      </div>

      <div class="falcon-shape-container">
        <div class="mandibles left">
          <div class="hole hole-1"></div>
          <div class="hole hole-2"></div>
        </div>
        <div class="mandibles right">
          <div class="hole hole-1"></div>
          <div class="hole hole-2"></div>
        </div>
        <div class="circle">
          <div class="core">
            <div class="turret"></div>
          </div>
        </div>
        <div class="engines"></div>
      </div>

      <div class="falcon-top-container">
        <div class="missile-tubes-container">
          <div class="missile-tubes"></div>
        </div>
        <div class="top-part">
          <div class="antenna">
            <div class="core">
              <div class="neck"></div>
            </div>
            <div class="parabolic"></div>
          </div>
          <div class="hole"></div>
          <div class="arm-cabin-container">
            <div class="top-cabin"></div>
            <div class="central-cabin"></div>
            <div class="bottom-cabin"></div>
          </div>
        </div>
        <div class="bottom-part">
          <div class="left armor"></div>
          <div class="holes-container">
            <div class="hole hole-1"></div>
            <div class="hole hole-2"></div>
            <div class="hole hole-3"></div>
            <div class="hole hole-4"></div>
            <div class="hole hole-5"></div>
            <div class="hole hole-6"></div>
          </div>
          <div class="right armor"></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

              
                @import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
@use postcss-nested;

:root {
  --falcon-light-color: #e8e8e8;
  --falcon-medium-color: #adadad;
  --falcon-medium-dark-color: #858585;
  --falcon-dark-color: #4c4c4c;
  --falcon-border-color: #050505;
  --falcon-border-filter:
    drop-shadow(-5px 0 0 var(--falcon-border-color))
    drop-shadow(0 -5px 0 var(--falcon-border-color))
    drop-shadow(5px 0 0 var(--falcon-border-color))
    drop-shadow(0 5px 0 var(--falcon-border-color));
}

body {
  margin: 0;
  background: linear-gradient(#000, #1c1c50);
  height: 100vh;
  overflow: hidden;
}

.container {
  display: flex;
  justify-content: center;
  margin-top: 5em;
}

.falcon-container {
  --width-size: 275px;

  width: var(--width-size);
  filter: drop-shadow(0 0 5px #fff8);

  & .back-effects .circle {
    width: var(--width-size);
    height: 275px;
    background: #4c9df4;
    border-radius: 50%;
    clip-path: polygon(15% 70%, 85% 70%, 85% 160%, 15% 160%);
    position: absolute;
    transform: translateY(28px);
    filter: blur(2px);
    z-index: 0;
    animation: fireEngine 0.5s ease infinite alternate;
  }
  
  & .text {
    font-family: "Bebas Neue", fantasy;
    color: #fff3;
    z-index: 5;
    font-size: 48px;
    text-align: center;
    display: block;
    transform: translate(0, 425px);
    text-decoration-color: #77c5;
    transition: color 0.25s, text-decoration-color 0.25s;
    
    &:hover {
      color: #fff;
      text-decoration-color: #77c;
    }
  }

  & .falcon-bottom-container {
    display: flex;
    justify-content: center;

    & .escape-pod-shape {
      width: 100px;
      height: 40px;
      position: absolute;
      filter: var(--falcon-border-filter);
    }

    & .escape-pod-container {
      --ty: 118px;

      width: 100px;
      height: 100%;
      background: var(--falcon-medium-color);
      transform: translate(-85px, var(--ty));
      display: flex;
      justify-content: center;
      align-items: center;
      clip-path: polygon(0 20%, 20% 0, 100% 0, 100% 100%, 20% 100%, 0 80%);
      background-image:
        linear-gradient(to right, transparent 20px, #000 20px 28px, transparent 29px),
        linear-gradient(160deg, var(--falcon-light-color) 13px, transparent 14px),
        linear-gradient(to right, #222 20px, transparent 21px),
        linear-gradient(181deg, var(--falcon-light-color) 6px, transparent 7px);

      &.right {
        transform: scaleX(-1) translate(-85px, var(--ty));
      }

      & .escape-pod {
        display: flex;
        width: 50%;
        justify-content: space-between;
        align-items: center;
        margin-left: 25px;

        & .dot {
          --size: 10px;

          width: var(--size);
          height: var(--size);
          border-radius: 50%;
          background: #222;
        }

        & .dot:nth-child(2) { --size: 8px; }
        & .dot:nth-child(3) { --size: 6px; }
      }

      &.right .dot { --size: 8px; }
      &.right .escape-pod { margin-left: 55px; }
    }
  }

  & .falcon-shape-container {
    width: var(--width-size);
    position: relative;
    filter: var(--falcon-border-filter);

    & .mandibles {
      width: 100px;
      height: 185px;
      background: var(--falcon-medium-color);
      background-image:
        linear-gradient(113deg, var(--falcon-light-color) 48%, transparent 49%),
        linear-gradient(180deg, var(--falcon-light-color) 4%, transparent 5%);
      position: absolute;
      clip-path: polygon(0 100%, 80% 0, 100% 0, 100% 100%);
      transform: translate(20px, -115px);

      & .hole-1 { transform: translate(68px, 45px); }
      & .hole-2 { transform: translate(50px, 67px); }

      &.right {
        transform: translate(155px, -115px) scaleX(-1);
      }
    }

    & .circle {
      width: var(--width-size);
      height: 275px;
      background: var(--falcon-medium-color);
      background-image: radial-gradient(circle at 50% 53%, transparent 67%, var(--falcon-light-color) 68%);
      border-radius: 50%;
      clip-path: polygon(0 0, 100% 0, 100% 38%, 62% 42%, 62% 58%, 100% 62%, 100% 100%, 0 100%, 0 62%, 38% 58%, 38% 42%, 0 38%);
      position: absolute;
      z-index: 2;
      display: flex;
      justify-content: center;
      align-items: center;

      &::before,
      &::after {
        content: "";
        display: block;
        width: 4px;
        height: 85%;
        background: var(--falcon-medium-dark-color);
        position: absolute;
        z-index: -1;
      }

      &::before { transform: rotate(45deg); }
      &::after { transform: rotate(-45deg); }

      & .core {
        width: 50px;
        height: 50px;
        border: 4px solid var(--falcon-border-color);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        background-color: var(--falcon-medium-color);
        background-image:
          conic-gradient(var(--falcon-medium-color) 50%, transparent 52% 75%, var(--falcon-medium-color) 77%),
          radial-gradient(transparent 50%, #fff 55% 60%, transparent 64%);

        & .turret {
          width: 20px;
          height: 14px;
          border-radius: 0 0 10px 10px;
          background: var(--falcon-border-color);
          animation: moveTurret 10s linear infinite alternate;

          &::before,
          &::after {
            content: "";
            display: block;
            background: var(--falcon-border-color);
            width: 4px;
            height: 30px;
            transform: translate(4px, -25px);
            position: absolute;
          }

          &::before {
            transform: translate(12px, -25px);
          }
        }
      }
    }

    & .engines {
      width: var(--width-size);
      height: 275px;
      background: var(--falcon-medium-color);
      background-image: radial-gradient(var(--falcon-medium-dark-color) 65%, transparent 66% 68%, var(--falcon-light-color) 69%);
      border-radius: 50%;
      clip-path: polygon(15% 60%, 85% 60%, 85% 100%, 15% 100%);
      position: absolute;
      transform: translateY(15px);
    }
  }

  & .falcon-top-container {
    display: flex;
    flex-direction: column;
    align-items: center;

    & .missile-tubes-container {
      filter: var(--falcon-border-filter);
      width: 40px;

      & .missile-tubes {
        width: 40px;
        height: 125px;
        background: var(--falcon-medium-dark-color);
        background-image: linear-gradient(to bottom, var(--falcon-medium-color) 5%, transparent 6%);
        position: absolute;
        transform: translate(0, -50px);
        clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
      }
    }

    & .top-part {
      width: 200px;
      height: 100px;
      position: absolute;
      z-index: 3;

      & .antenna {
        position: relative;
        transform: translate(14px, 60px) rotate(-30deg);
        transform-origin: 20px 20px;
        animation: moveAntenna 6s linear infinite alternate;

        & .core {
          width: 25px;
          height: 25px;
          background: var(--falcon-dark-color);
          border-radius: 50%;
          border: 4px solid #111;
          position: absolute;
        }

        & .neck {
          width: 10px;
          height: 10px;
          background: #111;
          border-radius: 50%;
          transform: translate(10px, 0);
          position: absolute;
        }

        & .parabolic {
          width: 40px;
          height: 20px;
          background: #eee;
          border-radius: 50%;
          border: 4px solid #111;
          position: absolute;
          transform: rotate(15deg) translate(-5px, -16px);
        }
      }

      & .hole {
        position: absolute;
        right: 40px;
        bottom: 35px;
      }

      & .arm-cabin-container {
        width: 125px;
        height: 125px;
        position: absolute;
        right: -55px;
        bottom: 10px;
        filter: var(--falcon-border-filter);

        & .top-cabin {
          background: var(--falcon-medium-color);
          width: 40px;
          height: 22px;
          border-bottom: 6px solid #111;
          position: absolute;
          right: 0;
          top: 0;
          clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
          display: flex;
          justify-content: center;

          &::before,
          &::after {
            content: "";
            display: block;
            height: 100%;
            width: 5px;
            background: #111;
          }

          &::before {
            transform: translateX(-5px);
          }

          &::after {
            transform: translateX(5px);
          }
        }

        & .central-cabin {
          background: var(--falcon-medium-color);
          background-image: linear-gradient(to right, var(--falcon-light-color) 13%, transparent 14%);
          width: 40px;
          height: 32px;
          position: absolute;
          right: 0;
          top: 28px;
          z-index: 2;
          clip-path: polygon(0 0, 100% 0, 100% 100%, 0 50%);
        }

        & .bottom-cabin {
          background: var(--falcon-medium-color);
          background-image: linear-gradient(177deg, var(--falcon-light-color) 24%, transparent 25%);
          width: 90px;
          height: 40px;
          position: absolute;
          bottom: 0;
          transform: rotate(-45deg) translate(44px, 4px);
          clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
        }
      }
    }

    & .bottom-part {
      width: 190px;
      height: 100px;
      position: absolute;
      display: flex;
      justify-content: space-around;
      align-items: flex-start;
      transform: translate(0, 175px);

      & .armor {
        border-radius: 4px;
        border-bottom: 28px solid #333;
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        width: 12px;
        height: 0;

        &.left { transform: rotate(60deg) translateX(-5px); }
        &.right { transform: rotate(-60deg) translateX(5px); }
      }

      & .holes-container {
        padding-top: 10px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;

        & .hole-2 { transform: translate(0, 6px); }
        & .hole-4 { transform: translate(-6px, 0); }
        & .hole-5 { transform: translate(0, 4px); }
        & .hole-6 { transform: translate(6px, 0); }
      }
    }
  }
}

.hole {
  width: 16px;
  height: 16px;
  background: #000;
  border-radius: 50%;
  border: 5px solid var(--falcon-medium-dark-color);
}

canvas {
  position: absolute;
  z-index: -1;
}

@keyframes moveTurret {
  0%,
  75% { transform: translateY(10px) rotate(-45deg); }

  40%,
  60% { transform: translateY(10px) rotate(0); }

  25%,
  100% { transform: translateY(10px) rotate(45deg); }
}

@keyframes moveAntenna {
  to { transform: translate(14px, 60px) rotate(30deg); }
}

@keyframes fireEngine {
  0% {
    box-shadow: 0 0 40px 45px #4fa4fe;
  }

  100% {
    box-shadow: 0 0 40px 85px #4fa4fe;
  }
}

.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

              
                /* Millennium Falcon with Pure CSS */
/* Starfield with Canvas Javascript */

const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
canvas.width = 1920 - 40;
canvas.height = 1080 - 160;

const MAX_STARS = 250;
const STAR_COLORS = ["#444", "#888", "#FFF"];

class Stars {
  constructor() {
    this.stars = [];
    for (let i = 0; i < MAX_STARS; i++) {
      const x = ~~(Math.random() * canvas.width);
      const y = ~~(Math.random() * canvas.height);
      const speed = ~~(1 + Math.random() * 5);
      const color = ~~(Math.random() * 3);
      this.stars.push({ x, y, speed, color });
    }
  }

  draw() {
    for (let i = 0; i < MAX_STARS; i++) {
      const star = this.stars[i];
      ctx.lineWidth = 1;
      ctx.strokeStyle = STAR_COLORS[this.stars[i].color];
      ctx.strokeRect(star.x, star.y, 1, 1);
    }
  }

  update() {
    for (let i = 0; i < MAX_STARS; i++) {
      this.stars[i].y += this.stars[i].speed;
      const isOutScreen = this.stars[i].y > canvas.height;
      isOutScreen && (this.stars[i].y = 0);
    }
  }
}

const stars = new Stars();

console.log(stars.stars);

const clearScreen = () => (ctx.clearRect(0, 0, canvas.width, canvas.height));

const loop = () => {
  clearScreen();
  requestAnimationFrame(loop);
  stars.update();
  stars.draw();
};

loop();

              
            
!
999px

Console