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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                -20.times do
 .hover
#kaleidoscope
 %div
  -2.times do
   .wrap
    .mask
     .inner
      -16.times do
       .cell
      
%svg
 %filter#pixelate{:x => "0", :y => "0"}
  %feflood{:height => "2", :width => "2", :x => "4", :y => "4"}
  %fecomposite{:height => "5", :width => "5"}
  %fetile{:result => "a"}
  %fecomposite{:in => "SourceGraphic", :in2 => "a", :operator => "in"}
  %femorphology{:operator => "dilate", :radius => "5"}
              
            
!

CSS

              
                body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #000;
  overflow: hidden;
  --offset: 0s;
  .hover {
    position: absolute;
    z-index: 999;
    width: 100vw;
    height: 5vh;
    top: 0;
    left: 0;
    @for $i from 1 through 20 {
      &:nth-of-type(#{$i}) {
        top: #{($i - 1) * 5%};
        &:hover {
          & ~ #kaleidoscope {
            --offset: #{$i/-10}s;
          }
        }
      }
    }
  }
  &:before,
  &:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 50%;
    top: calc(50% + 75px);
    z-index: 10;
    backdrop-filter: blur(5px);
  }
  &:after {
    backdrop-filter: none;
    height: 100%;
    top: 0;
    background: linear-gradient(
      to right,
      #000 calc(50% - 180px),
      transparent calc(50% - 180px),
      transparent calc(50% + 180px),
      #000 calc(50% + 180px)
    );
  }
  #svg {
    position: absolute;
  }
  #kaleidoscope {
    width: 500px;
    height: 400px;
    position: absolute;
    top: calc(50% - 325px);
    -webkit-box-reflect: below -0px linear-gradient(rgba(0, 0, 0, 0.25) 50%, rgba(0, 0, 0, 0.05));
    overflow: hidden;
  }
  #kaleidoscope > div {
    filter: url(#pixelate);
    width: 300px;
    height: 600px;
    position: absolute;
    overflow: hidden;
    left: 50%;
    background: linear-gradient(
      to right,
      #03001e,
      #7303c0,
      #ec38bc,
      #fdeff9,
      #ec38bc,
      #7303c0,
      #03001e
    );
    -webkit-box-reflect: left;
    transform: scale(0.75);
    transform-origin: left;
    top: 35px;
    &:before,
    &:after {
      content: "";
      position: absolute;
      width: 100%;
      height: 100%;
      background: #000;
      z-index: 9;
      border-radius: 0 500px 500px 0;
      -webkit-mask: linear-gradient(57.5deg, transparent 50%, #000 50%) 0% -100px /
          95% 115%,
        linear-gradient(to left, #000 25px, transparent 25px),
        linear-gradient(to top, #000 175px, transparent 100px);
    }
    &:after {
      mask: none;
      background: transparent;
      box-shadow: 0 0 0 150px #000;
      transform: scale(0.99);
      transform-origin: left;
    }
  }
  #kaleidoscope .wrap {
    width: 600px;
    height: 300px;
    left: calc(50% - 450px);
    top: calc(50% - 300px);
    position: absolute;
    transform-origin: 50% 100%;
    animation: spin2 10s ease-in-out infinite alternate;
    @keyframes spin2 {
      to {
        transform: rotate(180deg);
      }
    }
    -webkit-box-reflect: below;
    &:nth-of-type(2) {
      .mask {
        -webkit-mask: conic-gradient(
          from -98.5deg at 50% 100%,
          #000 5%,
          transparent 5%,
          transparent 10%,
          #000 10%,
          #000 15%,
          transparent 15%,
          transparent 20%,
          #000 20%,
          #000 25%,
          transparent 25%,
          transparent 30%,
          #000 30%,
          #000 35%,
          transparent 35%,
          transparent 40%,
          #000 40%,
          #000 45%,
          transparent 45%,
          transparent 50%,
          #000 50%,
          #000 55%
        );
        .inner {
          animation-direction: reverse;
          .cell {
            &:before {
              border-radius: 100%;
            }
          }
        }
      }
    }
    .mask {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      -webkit-mask: conic-gradient(
        from -98.5deg at 50% 100%,
        transparent 4%,
        #000 4%,
        #000 11%,
        transparent 10%,
        transparent 14%,
        #000 14%,
        #000 21%,
        transparent 20%,
        transparent 24%,
        #000 24%,
        #000 31%,
        transparent 30%,
        transparent 34%,
        #000 34%,
        #000 42%,
        transparent 40%,
        transparent 44%,
        #000 44%,
        #000 51%,
        transparent 50%,
        transparent 55%
      );
      .inner {
        position: absolute;
        width: 100%;
        height: 200%;
        border-radius: 100%;
        top: 0;
        left: 0;
        overflow: hidden;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        animation: spin 20s linear infinite;
        @keyframes spin {
          to {
            transform: rotate(360deg);
          }
        }
        .cell {
          position: relative;
          @for $i from 1 through 16 {
            &:nth-of-type(#{$i}) {
              &:before {
                animation-delay: calc(#{$i/-5.5}s + var(--offset));
              }
            }
          }
          &:before {
            content: "";
            position: absolute;
            width: 200%;
            height: 200%;
            left: -50%;
            top: -50%;
            background: linear-gradient(
              to right,
              #03001e,
              #7303c0,
              #ec38bc,
              #fdeff9,
              #ec38bc,
              #7303c0,
              #03001e
            );
            animation: spin3 10s ease-in-out infinite alternate;
            @keyframes spin3 {
              to {
                transform: rotate(360deg);
              }
            }
          }
        }
      }
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console