Jump to content
Search Community

block--head

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by block--head

  1. Update: looks like scrollTrigger doesn't want to play nice with 'overflow-y: scroll' in the css

     

    I forked my original pen (the first one linked in this post) and commented out that line, now the animation works - but of course no scroll-snapping.

     

    See the Pen WNzWWbZ by block-head (@block-head) on CodePen

     

    Incidentally, the JS for scrollTrigger works fine without needing to call the library since (as I assumed in the first place) they are pre-loaded on codepen anyway.

     

    Obviously, I need to sort out the html and css since the color block is moving with the animation, but apart from that I think I'll try scroll snapping using gsap as outlined here: https://css-tricks.com/going-meta-gsap-the-quest-for-perfect-infinite-scrolling/#aa-scroll-snapping/ - presuming that if I keep things within gsap framework everything should work well together...

     

    rather more than I'd bargained for in a first try, but here goes... :)

    • Like 1
  2. OK... so maybe calling js via script tags wasn't the way to go (at least not on codepen)...

     

    Have created a fork of the GSAP starter project (giving me all the gsap plugins), and now progress is being made:

     

    See the Pen ZExZjrv by block-head (@block-head) on CodePen

     

    I added the "box" class to the first div "HERO (Part ONE)" as well as Part TWO - this shows me that the animation is taking place on page load, NOT when the div comes into the viewport.

     

    An odd side-effect is that the css background color has shrunk on the "box" class elements.

×
×
  • Create New...