Jump to content
Search Community

gregor

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by gregor

  1. Hi, 

     

    Ah no, I think I didn't explain it well.
    the whole grid can be dragged and the grid items should be animated when they are visible in the viewport.

     

    this is the markup.

    <div 
      ref="el_carsGridWrapper" 
      class="bg-white h-screen relative overflow-hidden"
    >
      <div
        ref="el_carsGrid"
        class="relative grid grid-cols-4 w-[800px] origin-top-left"
      >
        <div
          @click="navigateTo($event)"
          v-for="i in 50"
          class="aspect-square border-r border-b border-white-dirty p-2"
        >
          <img
            class="el_car w-full h-full object-contain"
            :src="carsURL()"
          />
        </div>
      </div>
    </div>

    I will later provide a codepen demo if this is not clear enough.


     

  2. Hi,

     

    I wonder how I could animate elements of a grid that can be dragged in x,y direction.

    $Draggable.create(el_carsGrid.value, {
      bounds: el_carsGridWrapper.value,
      onDrag: function (e) {
        // calculations by my own?
      },
    });

    Should I use the onDragFunction and then check for each element if it is in the viewport or is there already a gsap solution and I didn't find it in the docs?


    ScrollTrigger.batch will not work, because there is no scrollevent...

     

     

  3. Ok, I have a nice self conversation

     

    tl.add() is the better option, the only thing I don't understand is why it jumps from the first tween in the timeline back to opacity 0.5.... when the flip animation is completed...

     

    See the Pen poBjery?editors=1011 by destroy90210 (@destroy90210) on CodePen

     

    Update:  ok I think i got it, i need to add opacity: 1 also to the final state, because this would be used at the end as inlinestyles...

      gsap.set(el_scalingTile, {
        width: "100%",
        height: "100vh",
        top: 0,
        left: 0,
        position: "absolute",
        opacity: 1 // <----
      });





     

  4. I have played around to create a timeline and use call() to start flip, that works.

     

    I just have a problem with the timing, because during the flip the main timeline should be paused. I tried to stop and restart it and set the playhead with seek.... but then the scroll trigger of the main timeline does not work...

     

    Is this generally the right approach? or should adding a flip to a timeline be done completely differently?

     

    See the Pen poBjEvJ?editors=1011 by destroy90210 (@destroy90210) on CodePen



    ok small update I played around with enabling and disabling scrollTrigger but still no success

    See the Pen XWQmNRP?editors=1011 by destroy90210 (@destroy90210) on CodePen

  5. Hello, I have already created the animation with your help (without flip plugin) 

     

    Now I want to use the flip plugin because i've never used it before and wanted to know how easy it is to rewrite it.... but ehm yeah, I don't get it HAHA

     

    That's how far I've come... I'm still struggling with how to apply the flip animation to my existing timeline with a scrollTrigger....

     

    I've tried creating a separate scrollTrigger onStart, but to no success... if anyone can give me a tip on how to recreate this with the flip plugin, I'd be very grateful ;)


    See the Pen ExJjyvg?editors=1011 by destroy90210 (@destroy90210) on CodePen

  6. Sorry to bother you again. But can I ask you if you have any idea why the calculations don't work when I add an animation to the timeline that happens before the image is resized?

    See the Pen LYvPJEv?editors=1011 by destroy90210 (@destroy90210) on CodePen

     

    I played around and got it to work on initial load with when I use a short setTimeout, but resizing is broken again

    See the Pen oNOXNzW?editors=1011 by destroy90210 (@destroy90210) on CodePen

  7. thank you you are my hero;)

    and with your clever calculation, the resizing event is no longer necessary.

     

    the invalidateOnRefresh: true is enough, means that the scrolltrigger already listens to resize events by default?

    But I will definitely give Flip Plugin a try

  8. Hi,

     

    maybe someone has the same problem with nuxtjs. I wanted to shorten the import of gsap and scrolltrigger a bit and used a plugin. It works locally, but when I generate the pages, I just get this error.

    [error] [nuxt] [request error] [unhandled] [500] gsap$2.registerPlugin is not a function

     

    this is the plugin

    import gsap from 'gsap'
    import { ScrollTrigger } from 'gsap/ScrollTrigger'
    
    gsap.registerPlugin(ScrollTrigger)
    
    export default defineNuxtPlugin((nuxtApp) => {
        nuxtApp.vueApp.use(gsap)
        nuxtApp.provide('gsap', gsap)
        nuxtApp.provide('ScrollTrigger', ScrollTrigger)
    })

    now I can use this line to have access to gsap and scrolltrigger

    const { $gsap, $ScrollTrigger } = useNuxtApp()

     

    Does anyone have a idea what is causing the error?

     

     
  9. Hi, I have a problem with colouring my background.


    First the header should change its colour from blue to white, later in the page when a component scrolls in the page should become black, but on leave turn back to white. But in my case it is gets blue again. I thought using toggleActions would be the best option. but it doesn't work because the page turns blue again instead of white...
     

     

     

    See the Pen JjzpKOW?editors=1010 by destroy90210 (@destroy90210) on CodePen

  10. Hi,

     

    I have a simple stack animation for some content. My problem is the animation of the card, which is currently sticky. There should be an overlap between the cards. The animation from card 1 to card 2 is fine, but then card 2 to card 3 there is no overlap anymore.
    My idea was just start both animations at the same time with the "<" and insert the new one some time later

    el_projects.value.forEach((project, index) => {
      if(index > 0){
        gsap.set(project, {y: index * projectHeight})
        tl2.to(project, {y:0, duration:1, ease:"none"})
        tl2.to(lastProject , {opacity: 0, rotation:8, scale:0.8, duration:0.5, ease:"none"},'<0.2')
      }
      lastProject = project
    })

     

    What I'm doing wrong? 

    See the Pen KKEzYzv by destroy90210 (@destroy90210) on CodePen

×
×
  • Create New...