Code Monkey home page Code Monkey logo

Comments (13)

coderitual avatar coderitual commented on May 11, 2024

Hi @francesco-incomedia. Yea this is sort of known bug. It's due to the fact draw area of svg crops everything which not belongs to it. I will look later if there is some workaround.

https://slides.com/coderitual/odoo-js#/26

The solution is to extend svg area to allow filters (like shadow) expand but the tricky part is that I don't know what kind of filters user may apply.

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

Thanks! svg width seems to solve the problem on the last character. What about the shadow on non-digit characters ("€" in my example)?

Thanks

from bounty.

coderitual avatar coderitual commented on May 11, 2024

I need to check whether it is caused by not enough width of non digit character or rather being covered by an adjacent neighbor.

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

Ok, I hope it could be fixed.
The problem on the last character should be solved with a workaroud adding an empty space at the end of the animated text.

from bounty.

coderitual avatar coderitual commented on May 11, 2024

yea, but the problem is how big this space should be. Normally you don't want the library to occupy space which is not necessary. It depends of parameters of the filter you may use.

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

@coderitual The text-shadow issue on non-digit characters seems to be caused from the applied filter.
It seems that can be solved editing this code

const createCharacter = (svg, el, fontSize) =>
svg
::append('g')
::append('text')
::style('filter', url(#createShadowFailFilter))
::text(el);

into this:

const createCharacter = (svg, el, fontSize) =>
svg
::append('g')
::append('text')
::text(el);

What do you think about it?

from bounty.

coderitual avatar coderitual commented on May 11, 2024

Thanks for the investigation! I forgot back then I had some shadow issue on some browsers. Could you please create PR for this? I will test on different browsers if it works.

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

Ok, done. Tried on Chrome, Firefox and Safari on iPhone and seems to worls fine.

from bounty.

coderitual avatar coderitual commented on May 11, 2024

Cool. Could you please remove definition of createShadowFailFilter. I think it will no longer be needed. One thing I am worried is safari browser (on ios and mac os).

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

Yes, I've updated the pull request. I can check on Safari (Mac) later.
On Edge there are no text-shadow effects visible (nor with this update and with your original code).

Francesco

from bounty.

francesco-incomedia avatar francesco-incomedia commented on May 11, 2024

On Safari seems to be ok too...

from bounty.

coderitual avatar coderitual commented on May 11, 2024

Thanks for the effort :)

from bounty.

coderitual avatar coderitual commented on May 11, 2024

It's published as 1.2.1. Thanks @francesco-incomedia for the contribution!

from bounty.

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.