- From: Yehonatan Daniv via GitHub <sysbot+gh@w3.org>
- Date: Fri, 27 Sep 2024 19:01:02 +0000
- To: public-css-archive@w3.org
> In the case of a pointer animation, if we will use this % for the element itself, or for something inside this element, we have some avenues to transform it into a coordinate for its background-position, or a nested element that will know the container's dimensions. Well if you really wanted you could add these offsets to the range start/end. > Example: if we’d want to have a tooltip that is initially positioned near a button, but then we want it to follow the cursor while the cursor is inside the button, we can’t use the button’s timeline. Of course you can, I'm not really following your question. Do you mean that you want it to jump next to the cursor once you hover the button and follow it, but otherwise jump back to its place? Of course you can do that, with `:hover` you can change the position, and then use an animation to transform it to the sides, and use `fill: none` so it jumps back as you hover out. > Quick demo: https://codepen.io/kizu/pen/xxvGRKo (look in Chrome, as it uses scroll-driven animations and anchor positioning). Sorry, using Chrome 128 I don't see anything happening. Plus there's no scroll there, so not clear what you intended to show ): > While, theoretically, we could use anchor() with a percentage for an inset-inline-start there, it would be less performant than a transform(), and would still be rather cumbersome. I think my answer above still addresses this, but yeah, you could animate layout for specific cases, if that's what you wanted. > I do not know if there is a viable solution, but I would be happy if we could somehow get not just the percentage value of some timeline, but the exact coordinate of it in its range. Getting this as a <length> would be useful for many cases. I think you're mixing up the model and the animated properties here. At the end the actual position has to be normalized into a progress of `[0, 1]` to reason about it. If it helps, I can link here to the library we use to "polyfill" this for users: https://github.com/wix-incubator/kuliso Maybe it will helps web developers to reason about this better. > I do not know if there is a viable solution, but I would be happy if we could somehow get not just the percentage value of some timeline, but the exact coordinate of it in its range. Getting this as a <length> would be useful for many cases. I guess just like you can't get the scrolling position from the animation, but you can specify start/end ranges with `<length>`. I guess what you're asking for is a whole different and API that currently doesn't exist. -- GitHub Notification of comment by ydaniv Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10574#issuecomment-2379885412 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 27 September 2024 19:01:03 UTC