bounty icon indicating copy to clipboard operation
bounty copied to clipboard

Pale text rendering in iOS

Open genericmilk opened this issue 6 years ago • 8 comments

Hi there!

HUGE fan of this script and use it in a lot of my projects, It's fab!

I have a slight issue with rendering on iOS, The colour of the font appears pale, As if it were semi transparent. I'm using this to init bounty;

bounty.default({ el: '.RevivedRev h1', value: '$' + $('.RevivedRev h1').attr('data-rev'), initialValue: '$0.00', lineHeight: 1, animationDelay: 1000, letterSpacing: 0.1, });

Is this a potential issue with a recent rendering change of svg in iOS? Can offer screenshots of issue if needed.

Cheers!

genericmilk avatar Apr 29 '19 09:04 genericmilk

On closer inspection it seems to be an issue with the style filter: url("#motionFilter-x-xxxxxxxxx"); - Safari in general (macOS too) doesn't seem to dump this filter on callback and leaves it enabled resulting in semi transparent text

genericmilk avatar May 23 '19 22:05 genericmilk

Hi, thanks for the feedback. Yea there is a lot of issues related to filters across different browsers. Could attach some screenshots with the issue?

coderitual avatar May 24 '19 13:05 coderitual

Of course! The first screenshot has the issue after the animation, This is Safari 12.1.1 (14607.2.6.1.1) and appears to share the same issue with iOS

Screenshot 2019-05-24 at 14 24 21

After removing the motionfilter from the element for the figure it seems to correct itself (See number 5) Screenshot 2019-05-24 at 14 24 35

Thanks so much again :D

genericmilk avatar May 24 '19 13:05 genericmilk

Uh oh, you are right. I think I saw this before. The solution might be to remove filters after animation finishes. Are you ok to work on a PR fixing this?

coderitual avatar May 24 '19 14:05 coderitual

Sure, I'll see what I can do 👍 Cheers!

genericmilk avatar May 25 '19 13:05 genericmilk

Hey there,

Great script, thanks for sharing!! I'm having the same issue with the Pale colors, but not entirely sure what you mean by

removing the motionfilter from the element for the figure

Could you please elaborate on how I can fix this, or where to look?

Thanks!

tylerdcorwin avatar Jun 10 '19 17:06 tylerdcorwin

Hi @tylerdcorwin During animation there are filters applied to all elements which are being moved around (motion blur). This is done by setting specific filter id on particular element https://github.com/coderitual/bounty/blob/44a3735a945b22b1ae307833a58247789a1790d4/src/bounty.js#L13

Value of the motion filter is set to 0 after digit reaches destination (we don’t need motion blur when there is no motion). The filter is still applied though which causes issue. We can remove it from digit entirely (by resetting filter attr) after animation ends.

coderitual avatar Jun 10 '19 17:06 coderitual

Ah Gotcha I'll try resetting the filter attribute after the animation completes, Thanks for the quick reply @coderitual, and thanks again for the great script!

tylerdcorwin avatar Jun 10 '19 17:06 tylerdcorwin