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

              
                <main>
  <div class="outer-glow"></div>
  <div class="circle-line"></div>
  <div class="inner">
    <span>
      <div class="particles-wrapper">
  <div class="particle particle-1"></div>
  <div class="particle particle-2"></div>
  <div class="particle particle-3"></div>
</div>
    </span>
    <input type="range" min=0 max=100 value=0>
    <output data-value="0">0</output>
    <div class="halo-inner"></div>
    <div class="halo-outer">
    </div>
  </di>
</main>

<div id="info-box" data-info-chrome="āœ… Rendering perfectly in Chrome" data-info-safari="āŒ Rendering broken in Safari" data-info-firefox="āŒ Rendering broken in Firefox" data-presentation-width="80vw" data-presentation-height="80vh" data-inspiration="https://dribbble.com/shots/7887362-Black-Magic-Mode"></div>
<svg>
  <defs>
    <filter id="turbulence" x="0" y="0" width="100%" height="100%">
    <feGaussianBlur in="SourceGraphic" stdDeviation="10"></feGaussianBlur>
    <feTurbulence id="liquid-filter" numOctaves="31" seed="50" baseFrequency="1.02 0.05"></feTurbulence>
    <feDisplacementMap xChannelSelector="G" yChannelSelector="B" scale="30" in="SourceGraphic"></feDisplacementMap>
    <feGaussianBlur stdDeviation="0.8"></feGaussianBlur>
    <animate xlink:href="#liquid-filter" attributeName="baseFrequency" dur="60s" keyTimes="0;0.5;1" values="0.01 0.06;0.04 0.09;0.02 0.04" repeatCount="indefinite"></animate>
  </filter>
  </defs>
</svg>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Sora:wght@200;400;500&display=swap");


@layer properties {
  @property --value {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
  }
}

:root {
  --bg-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  --bg-color: hsl(229deg 29% 10%);


  --glow-color-opacity: 0;
  --glow-color: oklch(82.6% 0.185 76.24 / calc(var(--glow-color-opacity) * 1%));
}

@supports (color: color(display-p3 0 0 0)) {
  :root {
    // --glow-color-p3: 0.04 1 0.62;
    // --glow-color-p3: 0.23 0.07 0.99;
    // --glow-color-p3: 0.7 0.09 0.2;

    --glow-color-opacity: 100;
    --glow-color-luminance: 10;
    --glow-color-p3: 0.99 0.71 0.18;
    --glow-color: color-mix(
      in lch,
      color(
        display-p3 var(--glow-color-p3) / calc(var(--glow-color-opacity) * 1%)
      ),
      white calc(var(--glow-color-luminance) * 1%)
    );
  }
}

*,
*:before,
*:after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(ellipse at 50% 0%, white, rgb(0 0 0 / 40%)),
    repeating-radial-gradient(
      circle at center,
      rgb(0 0 0 / 60%),
      rgb(0 0 0 / 60%) 14px,
      rgb(255 255 255 / 0%) 18px,
      rgb(255 255 255 / 30%) 18px,
      rgb(0 0 0 / 60%) 21px
    );
  font-family: "Sora", sans-serif;
  background-blend-mode: soft-light;
  background-size: 100% 100%;

  display: grid;
  place-items: center;
  
  &:before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 50%, hsl(233.56 57% 6% / 60%));
  }

  &:after {
    position: absolute;
    display: block;
    content: "";
    width: 100%;
    height: 100%;
    background: var(--bg-grain) repeat top left / 300px;
    z-index: 10;
    opacity: 0.15;
    mix-blend-mode: color-dodge;
    pointer-events: none;
  }
}


main {
  width: 500px;
  max-width: 100%;
  aspect-ratio: 1/1;
  border-radius: 10e5px;
  background: radial-gradient(
    ellipse at 50% 0%,
    hsl(274deg 14% 12%),
    hsl(274deg 16% 4%)
  );
  position: relative;
  display: block;
  align-items: center;
  justify-content: center;
  
  // Small trick to smoothen everything
  // Note that you should barely use will-change ( https://developer.mozilla.org/en-US/docs/Web/CSS/will-change )
  // I use it because this demo is visually heavy, and it now GPU accelerated
  // You can now zoom in and inspect this pen without too much visual glitch
  *,*:before,*:after {
    will-change: transform, filter, background;
  }

  &:after {
    content: "";
    position: absolute;
    width: 80%;
    height: 80%;
    background: hsl(240deg 24% 10%);
    display: block;
    border-radius: inherit;
    box-shadow: inset 0 0 26px rgb(0 0 0 / 80%),
      inset 0 -4px 6px -1px rgba(255 255 255 / 10%);
    z-index: inherit;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }

  &:before {
    content: "";
    display: block;
    position: absolute;
    width: 60%;
    aspect-ratio: 1/1;
    box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.3),
      inset 0 -1px 2px rgb(0 0 0 / 0.3), 0 0 20px 2px rgb(0 0 0 / 20%);
    z-index: 11;
    border-radius: 1e5px;
    pointer-events: none;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }

  & .circle-line {
    --glow-color-opacity: calc(var(--value) / 2);
    --glow-color-luminance: 70;
    --glow-color: color-mix(
      in lch,
      color(display-p3 0.99 0.71 0.18 / calc(var(--glow-color-opacity) * 1%)),
      white calc(var(--glow-color-luminance) * 1%)
    );
    position: absolute;
    width: 80.5%;
    height: 80.5%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background: conic-gradient(
      from 0.5turn,
      transparent calc(100% - var(--value) * 1%),
      var(--glow-color) calc(100% - calc(var(--value) * 1%))
    );
     mask-image: conic-gradient(
        from 0.5turn,
        black,
        black,
        transparent
      );
    border-radius: 1e5px;
    transform: rotateY(180deg);
  }

  & .outer-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    transform: rotate(calc(var(--value) * 3.6 * 1deg));

    &:after {
      content: "";
      display: block;
      position: absolute;
      width: 20px;
      height: 50px;
      background: var(--glow-color);
      border-radius: 100%;
      z-index: 0;
      transform: translate(240px, 500px);
      filter: blur(20px);
      mix-blend-mode: plus-lighter;
      opacity: calc(var(--value) / 100);
    }
  }
  & > div.inner {
    width: 300px;
    aspect-ratio: 1/1;
    position: absolute;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    & .halo-outer {
      position: absolute;
      width: 100%;
      height: 100%;
      box-shadow: inset 0 0 16px rgb(0 0 0 / 100%),
        inset 0 0 8px rgb(0 0 0 / 80%), inset 0 0 6px rgb(0 0 0 / 60%);

      border-radius: 1e5px;
      transform: scale(1.66) rotateY(180deg);

      z-index: 5;

      &:before {
        --glow-color-opacity: calc(var(--value) / 2);
        --glow-color-luminance: 10;
        --glow-color: color-mix(
          in lch,
          color(
            display-p3 var(--glow-color-p3) / calc(var(--glow-color-opacity) * 1%)
          ),
          white calc(var(--glow-color-luminance) * 1%)
        );
        content: "";
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        transform: scale(0.6) rotate(calc(calc(var(--value) * 3.6 * -1deg)));
        border-radius: 1e5px;
        background-color: var(--bg-color);
        background-image: radial-gradient(
            ellipse at 50% calc(210% + calc(var(--value)/2 * -1%)),
            var(--glow-color) 30%,
            transparent 40%
          ),
          linear-gradient(
            to bottom right,
            rgb(255 255 255 / 01%) 45%,
            rgb(0 0 0 / 0%) 50%
          );
        z-index: 2;
        backdrop-filter: saturate(1.5);
      }
      &:after {
        content: "";
        display: block;
        position: absolute;
        border-radius: 10e5px;
        width: 100%;
        height: 100%;
        background-image: linear-gradient(
          to bottom,
          rgb(255 255 255 / 80%),
          rgb(0 0 0 / 10%)
        );
        transform: scale(0.6) ;
        z-index: 6;
        mix-blend-mode: soft-light;
      }

      & canvas {
        position: absolute;
        width: 100% !important;
        height: 100% !important;
        border-radius: 10e5px;
        opacity: 0.05;
        pointer-events: none;
        z-index: -1;
      }
    }

    & .halo-inner {
      --glow-color-opacity: var(--value);
      --glow-color: color-mix(
        in lch,
        color(
          display-p3 var(--glow-color-p3) / calc(var(--glow-color-opacity) * 1%)
        ),
        white 20%
      );
      background: conic-gradient(
        from 0.5turn,
        transparent calc(100% - var(--value) * 1%),
        var(--glow-color) calc(100% - var(--value) * 1%)
      );
      /* With all these transforms, I couldn't figure out a better
       * way to fade out the start of the gradient.   
      */
      mask-image: conic-gradient(
        from 0.5turn,
        black,
        black,
        transparent
      );
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 1e5px;
      opacity: 0.7;
      transform: scale(1.66) rotateY(180deg);
      mix-blend-mode: plus-lighter;
      z-index: -1;
      filter: saturate(2);
      overflow: hidden;

      &:after {
        --current-opacity: opacity(calc(var(--value)*0.01));
        content: "";
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        
        background: url(https://assets.codepen.io/64/toppng.com-water-texture-water-1500x1500.png);
        background-size: 80px;
        
        mask-image: conic-gradient(from 0.5turn, transparent calc(100% - var(--value) * 1%), white calc(100% - var(--value) * 1%));
        filter: 
          brightness(3400%) url(#turbulence) var(--current-opacity);
        mix-blend-mode: overlay
      }
    }

    & span {
      display: block;
      position: absolute;
      z-index: 1;
      width: 100%;
      height: 100%;

      position: relative;
      border-radius: 10e5px;
      box-shadow: 0 0 26px rgb(0 0 0 / 80%);
      transform: rotate(calc(var(--value) * 3.6 * 1deg));
      transform-origin: center center;

      &:after {
        content: "";
        display: block;
        position: absolute;
        width: 3px;
        height: 99px;
        background: #fff;
        top: 100%;
        left: 50%;
        border-radius: 0 0 2px 2px;
        z-index: -1;
        box-shadow: 0 0 calc(20px + calc(var(--value) / 10 * 1px))
          calc(5px + calc(var(--value) / 6 * 1px)) var(--glow-color), inset 0 0 1px var(--glow-color), 0 0 2px 1px black;
        transform: translateX(-50%);
        transform-origin: center top;
        animation: reveal 1s ease forwards;
        filter: saturate(200%) ;
        @keyframes reveal {
          from {
        transform: translateX(-50%) scaleY(0);
            
          }
          to {
            
        transform: translateX(-50%) scaleY(1);
          }
        }
      }

      &:before {
        content: "";
        display: block;
        position: absolute;
        width: 3px;
        height: 13%;
        background: #fff;
        top: 105%;
        left: 50%;
        z-index: -1;
        opacity: calc(var(--value) / 5);
        box-shadow: 0 0 calc(20px + calc(var(--value) / 10 * 1px))
          calc(5px + calc(var(--value) / 6 * 1px)) var(--glow-color);
        transform: translateX(calc(-50% + 15px));
        filter: blur(5px) saturate(200%) url(#turbulence) ;
        transform-origin: center left;
      }
    }

    & input {
      //display: none;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: grab;
      z-index: 10;

      &:active {
        cursor: grabbing;
      }
    }

    & output {
      color: var(--glow-color);
      position: relative;
      font-variant-numeric: slashed-zero tabular-nums;
      font-feature-settings: "tnum";
      font-size: 5em;
      font-weight: 500;
      position: absolute;
      user-select: none;
      pointer-events: none;
      position: absolute;
      z-index: 10;
      text-shadow: 0 0 2px black;

      &:after {
        --glow-color-luminance: 80;
        --glow-color: color-mix(
          in lch,
          color(
            display-p3 0.99 0.71 0.18 / calc(var(--glow-color-opacity) * 1%)
          ),
          white calc(var(--glow-color-luminance) * 1%)
        );
        content: attr(data-value);
        position: absolute;
        top: 0;
        left: 0;
        color: var(--glow-color);
        opacity: 1;
        filter: blur(calc(var(--value)/10*1px)) saturate(5);

        user-select: none;
        pointer-events: none;
        mix-blend-mode: plus-lighter;
      }
    }
  }
}
/* Config */
$spacing: 100px;
$time-1: calc(20s / calc(var(--value)/10));
$color: var(--glow-color);
/* Pauls awesome mixin */
@function particles($max) {
   $val: 0px 0px $color;
   @for $i from 1 through $max {
      $val: #{$val},
      random($spacing*1.5)+px random($spacing*1.5)+px $color;
   }
   @return $val;
}

@mixin particles($max) {
   box-shadow: particles($max);
}


.particles-wrapper {
  position: absolute;
  width: 110px;
  height: 110px;
  left: 45%;
  top: 97%;
  overflow: hidden;
  transform: rotate(90deg);
  trasnform-origin: center center;
  mask-image:  radial-gradient(circle, #000, transparent 70%);
  opacity: calc(var(--value)/10);
  filter: brightness(500%);
}

.particle,
.particle:after {
  background: transparent;
}

.particle:after {
  position: absolute;
  content: "";
  top: $spacing;
}
[class*="particle-"] {
  border-radius: 10px;
  filter: blur(0.5px) saturate(200%) contrast(200%);
}
.particle-1 {
  animation: animParticle $time-1 linear infinite;
  @include particles(100);
  height: 1px;
  width: 1px;
}

.particle-1:after {
  @include particles(100);
  height: 1px;
  width: 1px;
}

.particle-2 {
  animation: animParticle $time-1 linear infinite;
  @include particles(100);
  height: 2px;
  width: 2px;
}

.particle-2:after {
  @include particles(100);
  height: 2px;
  width: 2px;
}

.particle-4 {
  animation: animParticle $time-1 linear infinite;
  @include particles(100);
  height: 1px;
  width: 1px;
}

.particle-4:after {
  @include particles(100);
  height: 1px;
  width: 1px;
}

@keyframes animParticle {
  from { transform: translateY(0px); }
  to   { transform: translateY($spacing*2 * -1); }
}

svg {
  position: absolute;
}


              
            
!

JS

              
                
const main = document.querySelector('main');
const rangeInput = document.querySelector('input[type="range"]');
const outputValue = document.querySelector('output[data-value]');

const getRangeValue = () => {
  const value = rangeInput.value;
  outputValue.textContent = value;
  outputValue.dataset.value = value;
  document.body.style.setProperty('--value', value)
}
window.addEventListener('DOMContentLoaded', getRangeValue)
rangeInput.addEventListener('input', getRangeValue);

              
            
!
999px

Console