Gordijn-reveal
Two bars part like a curtain to expose fullscreen media.
scroll ↓
How to use it
- Paste the HTML where the scroll effects should appear. Include the script tags at the top once per page.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Gordijn-reveal · NedDev · eigen werk. -->
<!-- benodigd, één keer per pagina: -->
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>
<div class="jouw-container">
<div class="scurt-root"><div class="scurt-media"></div><div class="scurt-c scurt-top"></div><div class="scurt-c scurt-bot"></div><div class="scurt-hint">scroll ↓</div></div>
</div>/* Gordijn-reveal · NedDev · eigen werk. */
.scurt-root{position:absolute;inset:0;overflow:hidden}
.scurt-media{position:absolute;inset:0;background:linear-gradient(135deg,#222,#F5480F);transform-origin:center}
.scurt-c{position:absolute;left:0;right:0;height:50%;background:#F5480F;z-index:3}.scurt-top{top:0}.scurt-bot{bottom:0}
.scurt-hint{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:5;font:10px 'JetBrains Mono',monospace;letter-spacing:.14em;color:#fff;text-transform:uppercase;opacity:.7}// Gordijn-reveal · NedDev · eigen werk.
// root = het element waarin de HTML staat
function init(root){
if(!window.gsap)return;gsap.timeline({scrollTrigger:{trigger:root,start:'top 90%',end:'bottom 40%',scrub:1}}).to(root.querySelector('.scurt-top'),{yPercent:-100},0).to(root.querySelector('.scurt-bot'),{yPercent:100},0).from(root.querySelector('.scurt-media'),{scale:.45,borderRadius:'24px'},0);
}
init(document.querySelector('.jouw-container'));
More scroll effects
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →