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

              
                <body>
<!--   https://robbowen.digital/wrote-about/css-blend-mode-shaders/ -->
  <h1>Scroll for Shiny</h1>
  <h1>No effect | Foil Effect</h1>
  
  <div class="compare">
    <div>
      <img src="https://i.imgur.com/qt4ouwL.jpg" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/qt4ouwL.jpg" alt="">
      <div class="foil__layer specular">
        <div class="foil__layer">
        </div>
      </div>
    </div>
  </div>  
  <h2>.specular + No Mask</h2>
  
  
  <div class="compare">
    <div>
      <img src="https://i.imgur.com/qt4ouwL.jpg" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/qt4ouwL.jpg" alt="">
      <div class="foil__layer specular">
        <div class="foil__layer butterfly_mask">
        </div>
      </div>
    </div>
  </div>  
  <h2>.specular + General Mask</h2>
  
  
    <div class="compare">
    <div>
      <img src="https://i.imgur.com/odcbhlX.jpg" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/odcbhlX.jpg" alt="">
      <div class="foil__layer garden-glow">
        <div class="foil__layer self-mask">
        </div>
      </div>
    </div>
  </div>  
  <h2>.garden-glow + Same Image Mask</h2>
  
  
  <div class="compare">
    <div>
      <img src="https://i.imgur.com/SGQAZSt.png" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/SGQAZSt.png" alt="">
      <div class="foil__layer specular">
        <div class="foil__layer mattb_mask-halftone">
        </div>
      </div>
    </div>
  </div>
  <h2>.specular + Halftone Mask</h2>
  
  
  
   <div class="compare">
    <div>
      <img src="https://i.imgur.com/WY4OSxQ.png" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/WY4OSxQ.png" alt="">
      <div class="foil__layer lightleak">
        <div class="foil__layer presentation_mask-inverted">
        </div>
      </div>
    </div>
  </div>
  <h2>.lightleak + Inverted/Blurred Mask</h2>
  
  
  
   <div class="compare">
    <div>
      <img src="https://i.imgur.com/jtFCIi0.png" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/jtFCIi0.png" alt="">
      <div class="foil__layer ibec-cool">
        <div class="foil__layer ibec_masc-effect">
        </div>
      </div>
    </div>
  </div>
  <h2>.ibec-cool + bubble effect</h2>
  
  
   <div class="compare">
    <div>
      <img src="https://i.imgur.com/OamMLw5.jpg" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/OamMLw5.jpg" alt="">
      <div class="foil__layer ring_sparkle">
        <div class="foil__layer ring_masc-effect">
        </div>
      </div>
    </div>
  </div>
  <h2>.ring_sparkle + Sparkle Effect mask</h2>
  
  
  <div class="compare">
    <div>
      <img src="https://i.imgur.com/3QvFAl3.jpg" />
    </div>
    <div class="foil">
      <img src="https://i.imgur.com/3QvFAl3.jpg" alt="">
      <div class="foil__layer glass_sparkle">
        <div class="foil__layer glass_mask">
        </div>
      </div>
    </div>
  </div>
  <h2>.drink_sparkle + drink sunburst effect</h2>
    
</body>

              
            
!

CSS

              
                /*  Base Containers */

.foil {
   position: relative;
   overflow: hidden;
   backface-visibility: hidden;
}

.foil__layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-size: 100%;
}

/* foil colors / designs */

.specular {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(180deg, black 20%, #3c5e6d 35%, #f4310e, #f58308 80%, black);
}

.lightleak {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(179deg,#000 40%,red,orange,#fff 60%,#000 80%);
}

.ibec-cool {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(9,9,121,1) 14%, rgba(0,212,255,1) 36%, rgba(184,0,255,1) 60%, rgba(250,142,242,1) 80%, rgba(0,0,0,1) 100%);
}

.garden-glow {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 21%, rgba(241,165,237,1) 58%, rgba(218,241,5,1) 73%, rgba(14,209,237,1) 89%, rgba(0,0,0,1) 100%);
}

.ring_sparkle {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(30deg, rgba(0,0,0,1) 23%, rgba(62,125,239,1) 43%, rgba(255,188,0,1) 49%, rgba(62,125,239,1) 55%, rgba(0,0,0,1) 79%);
}

.glass_sparkle {
  mix-blend-mode: color-dodge;
  background-attachment: fixed;
  background-image: linear-gradient(30deg, rgba(0,0,0,1) 59%, rgba(62,125,239,1) 65%, rgba(255,188,0,1) 66%, rgba(62,125,239,1) 69%, rgba(0,0,0,1) 74%);
}

/* Masks for specific images */

.butterfly_mask { 
  mix-blend-mode: multiply;
  background-image: url(https://i.imgur.com/VBkCg0L.jpg);
}

.self-mask { 
  mix-blend-mode: multiply;
  background-image: url(https://i.imgur.com/odcbhlX.jpg);
}

.mattb_mask-halftone {
  mix-blend-mode: multiply;
  background-image: url(https://i.imgur.com/cU3XYzy.png);
}

.presentation_mask-inverted {
  mix-blend-mode: multiply;
  background-image: url(https://i.imgur.com/HDNX6y7.png);
}

.ibec_masc-effect {
  mix-blend-mode: multiply;
  background-image: url(https://i.imgur.com/4sQCisH.jpg);
}

.ring_masc-effect {
  mix-blend-mode: multiply;
/*   opacity:.5; */
  background-image: url(https://i.imgur.com/5WXEMti.jpg);
}

.glass_mask {
  mix-blend-mode: multiply;
/*   opacity:.5; */
  background-image: url(https://i.imgur.com/YzatTLG.jpg);
}

/* CSS relating to codepen display, not the effect */

body {
  background: black;
  scroll-behavior: smooth;

  padding-bottom: 100vh;
  display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
}

h1 {
  height: 100px;
  margin-top: 300px;
  color: white;
  font-family: monospace;
  font-size: xxx-large;
}

h2 {
  height: 100px;
  color: white;
  font-family: monospace;
  font-size: xx-large;
}

.compare {
  display:flex;
  max-width: 100%;
}

.compare>div {
  width: 50%;
}

img {
  width: 100%;
  height: auto;
}
              
            
!

JS

              
                
              
            
!
999px

Console