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

              
                <!--- this is the videoPanel area i am concered with -->

<div class="video-panel relative order-1 w-full h-screen bg-black anim overflow-hidden">

    <div class="absolute z-10 flex items-center justify-center w-full h-screen">
        <h1 id="title" class="text-white text-6xl relative top-0 origin-top uppercase bold">Website title</h1>
    </div>


    <div class="absolute w-full h-screen z-9"><video src="http://learn.shayhowe.com/assets/misc/courses/html-css/adding-media/earth.mp4" class="object-cover w-full h-screen" autoplay loop muted></video></div>
</div>

<!--- // end videoPanel -->



<!--- a panel like the below will really be present underneath videoPanel on the actual site/page  -->
<section class="px-16 py-40 bg-gray-200">

    <h2 class="uppercase font-display">About us</h2>
    <h3 class="w-9/12 pt-4 pb-8 font-serif text-6xl leading-tight tracking-wide">Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur excepturi quo quos dolor cumque adipisci, hic in.</h3>
    <a href="/about" class="pillBtn">Explore</a>

</section>


<!--- the below is just filler to make page scroll  -->
<div class="text-xl p-16" style="min-height:1000px">
  
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus, voluptates! Qui repudiandae inventore impedit odio dicta suscipit aut eos fugit illo reiciendis! Ipsa alias aperiam, quisquam aut consequatur pariatur optio!</p>
    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus, voluptates! Qui repudiandae inventore impedit odio dicta suscipit aut eos fugit illo reiciendis! Ipsa alias aperiam, quisquam aut consequatur pariatur optio!</p>
    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus, voluptates! Qui repudiandae inventore impedit odio dicta suscipit aut eos fugit illo reiciendis! Ipsa alias aperiam, quisquam aut consequatur pariatur optio!</p>
    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus, voluptates! Qui repudiandae inventore impedit odio dicta suscipit aut eos fugit illo reiciendis! Ipsa alias aperiam, quisquam aut consequatur pariatur optio!</p>
  
</div>
              
            
!

CSS

              
                * { margin:0; padding:0; }


#title { 
  transform: translateY(0);
}
              
            
!

JS

              
                

var anim = gsap.to("#title", { 
              y: () => { return window.innerHeight * 0.75 }, ease: "none",
              scrollTrigger: {
                trigger: '.video-panel',
                start: () => 'top top',
                end: () => "+=" + ( window.innerHeight * 0.75 ),
                // scrub: true,
                scrub: 0.0,
                invalidateOnRefresh: true,
              }          
           })



// var tl = new TimelineMax({paused:true})
// var scrollDistance = window.innerHeight / 1.5;
// var winScrollY = window.scrollY / 2;
// 
// tl.to("#title", {y: scrollDistance})
// 
// window.addEventListener("scroll", function() {
//   winScrollY = window.scrollY / 2;
//   tl.progress(winScrollY / scrollDistance);
// });
              
            
!
999px

Console