Jump to content
Search Community

Thomas Günther

Premium
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Thomas Günther

  1. Not sure if this is related or wether it helps you at all but I've recently encountered a similar Safari glitch when using clip-path.

    Sometimes the browser just ignores the clip-path depending on how big the element is. In my case I hid the menu overlay with a clip-path and on some mobile devices the menu would sometimes appear out of nowhere with no way to close it (great work, Safari).

    I could reproduce this by resizing desktop Safari's window to a very big size so I suspect some performance limitation. What I'm trying to say is Safari is kinda wonky when it comes to clip-path. I personally switched to using a mask-image and animating the mask-size.

    • Like 1
    • Thanks 1
  2. You're absolutely right. It works with padding-left

    It felt a bit weird to add padding to img elements so I tried margininstead. Doesn't work though 😅

     

    I'll just go with padding and a wrapper element because it seems to work just fine. Thank you very much 👏

    • Like 1
  3. Hey there 👋

     

    I'm currently using the great horizontalLoop() helper function in a project. It worked great until I introduced different/variable widths. Now it seems like the gap between the elements is not calculated correctly anymore. I've also attached a screenshot of the different gaps.

     

    To be honest I don't understand 100% of what's going on in the helper function. Is it even possible to use it with variable widths? I've found tons of threads in the forums but none of them have variable widths.

     

    Thanks for a nudge in the right direction,
    Thomas

     

    image.thumb.png.e0fad8ffa0b81f83d94c28dc0f035db4.png

    See the Pen BaVzYNE by medienbaecker (@medienbaecker) on CodePen

  4. Hey Jack,

     

    thanks for your reply. I'll try to explain it better by answering your questions:

     

    28 minutes ago, GreenSock said:

    What do you mean by "limit to a single action"? What are you considering an "action"?

    An action is animating to the previous or next image to me. And I want to limit one drag (user clicks and drags in a direction) to one action. Currently you can just hold the click and the Observer will trigger every time you move the mouse. It even ignores the dragMinimum

     

    28 minutes ago, GreenSock said:

    How exactly can I reproduce the "wonky behavior" and the "sometimes you can get stuck..."? I switched tabs and came back and didn't seem to get stuck. 

    It's hard to reliably reproduce but it happens periodically, especially on my client's website where I also use this slider: https://stjakobi.de/veranstaltungen/harald-welzer-und-das-schreiben-ueber-krisen

    One way to reproduce it is to start dragging, then switching the tab, and then releasing the mouse button. This is of course quite unrealistic and doesn't happen a lot, but similar behavior can get triggered when switching windows, by browser or OS alerts, by scrolling etc.

     

    What I want Observer to do: once it triggers an action, for example animating to the next image, it should consider this drag to be done. I need some way to tell Observer to temporarily stop listening to the pointer event.

  5. I'm still working on my scrollable slider. You can scroll the slider but you can also drag to left/right to move to the next/previous image.

     

    It works quite well already, but I noticed an issue with how Observer observes the pointer action. Sometimes you can get stuck in a click — for example when switching the tab and then coming back to the page. You have to click again so Observer (I guess) can catch the mouseup event. Otherwise you'll find the Observer triggering left/right every time you move the mouse.

     

    That's why I want to limit the Observer to one single action. Once the action (previous/next image) is called, the Observer should reset. I tried to do that with .disable()and .enable() but it resulted in some wonky behavior instead.

     

    Is there some way to do that? Am I missing something? Thanks in advance!

     

    See the Pen qBxMVmB by medienbaecker (@medienbaecker) on CodePen

  6. Heya 👋

     

    I noticed I can not limit an Observer to type: pointer. It will always trigger, also on mobile/touch devices.

     

    While I can use a condition like e.event.type.includes('pointer') I'm wondering if this is a bug.

     

    In this codepen I listen to onLeft and onRight but I don't want this on mobile devices. It will scroll, jump back and then animate the scroll.

    See the Pen qBxMVmB by medienbaecker (@medienbaecker) on CodePen

  7. I'm currently trying to scroll a horizontally overflowing element via vertical scroll. A lot of people don't have a trackpad, horizontal mouse wheel or the knowledge you can hold shift to scroll horizontally. Those that do should however still be able to scroll horizontally.

     

    Now I know you can use something like ScrollTrigger to turn the scrolling into transforms but I'd like to keep the regular scroll behavior, including a scroll bar, the native mobile behavior, etc.

     

    Observer.create({
      target: window,
      type: "wheel",
      onChangeY: (self) => {
        document.documentElement.scrollLeft += self.deltaY;
      }
    });

     

    With a simple Observer I turn the vertical scroll into horizontal scroll but I noticed some issues: the speed seems to be doubled and the scroll doesn't look very smooth.

     

    Maybe somebody has an idea why that is? Thanks in advance!

     

    I created a simplified CodePen that you might want to open in a new tab to test the scrolling:

     

    See the Pen MWQOeWv by medienbaecker (@medienbaecker) on CodePen

    • Like 2
  8. Hey @OSUblake

    Thanks a lot for your solution. This indeed works much better for the CodePen.

    Unfortunately I made the demo a bit too minimal as it seems. On the actual website I have color changer "lines". That's why start and end were both set to top center and I used a reversed timeline. Sorry, should have included that in the initial post/demo.

    I forked the demo and created a new one closer to the actual structure: 

    See the Pen BawyeQz by medienbaecker (@medienbaecker) on CodePen

    Thanks again,

    Thomas

    • Like 1
×
×
  • Create New...