Giter Club home page Giter Club logo

Comments (8)

joshbader avatar joshbader commented on July 21, 2024 2

@gjdipietro Yes this might work, but because the translate property is being used to center the tooltip, it would have to use a different property to enable hardware acceleration. backface-visibility: hidden; seems to work in my testing.

from balloon.css.

kazzkiq avatar kazzkiq commented on July 21, 2024 1

It's been 3 years since this issue and I have not seen it happen anymore in current browsers. v1.0 also is getting different transition/arrow threatment so until v1.0 is released I will treat this as a solved problem.

from balloon.css.

kazzkiq avatar kazzkiq commented on July 21, 2024

@davesnx I went through this issue when building Balloon.css and could not find a solution. There will always be a pixel difference on the transitions. This happens because ::before and ::after are elements with different content animating independently, one may lag more than the other when transitioning, which leads to the "gap" or "stack".

I think there is no much that can be done here, other than removing the tooltip opacity to prevent user from noticing one pseudo-element stacking over other.

from balloon.css.

davesnx avatar davesnx commented on July 21, 2024

I was wondering that is caused by the transition on ::after happens a little bit early than ::before and that causes the 1px of difference.

I figure it out change the easing on the after for match perfecty, but it's pretty hard, tbh, the workarround can be add 1px on positioning and overlapse 1px of black inside the container on the animation (that looks a little bit better), what do you think?

from balloon.css.

kazzkiq avatar kazzkiq commented on July 21, 2024

The other problem is that this "lag" between pseudo-elements happen exclusively because of browser rendering, thus making adjustments on easing itself would only solve the issue on your own machine. Other machines with other hardware could probably lead to different delays.

I think the best solution for this would be overlapping the "arrow" 1px up as you said. However then we will have to remove the opacity of the tooltips (no big deal tho).

from balloon.css.

joshbader avatar joshbader commented on July 21, 2024

I don't think it has anything to do with lag. I think its a sub-pixel interpolation vs. pixel snapping issue. If you slow down the animation, you can see that the edge of the tooltip is using sub-pixels when moving. See attached.

Here is an article from Paul Irish that might help explain it. http://www.paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/

subpixel-interpolation

from balloon.css.

kazzkiq avatar kazzkiq commented on July 21, 2024

@joshbader Interesting. I've replaced the animation with translate() instead of translate3d() and the issue remains. But using margin seems to solve the problem (probably due to margin property using real pixels instead of sub-pixel interpolation).

However as far as I know margin property can't make use of hardware acceleration for animations. Not sure if will-change enables it, but its support is not that good anyways.

For smaller tooltips, using margin animations will probably not have any impact at all.But on bigger ones, with lots of text and/or glyps, the performance may drop, specially on small devices.

from balloon.css.

gjdipietro avatar gjdipietro commented on July 21, 2024

@kazzkiq could you force hardware acceleration on webkit browsers with translate3d(0,0,0) and enable the animation with margin? See more, https://davidwalsh.name/translate3d

from balloon.css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.