Giter VIP home page Giter VIP logo

Comments (2)

maxwellito avatar maxwellito commented on August 20, 2024

Hi there,
First, thanks for these kind words :) It's sweet to start an issue with this message.

About your problem. I kept thinking about a hack since this morning and there's no magic solution. I have different ones:

  1. Find a way on your SVG editor to ask him to export the path points in the reverse order. Like <path d="4-3-2-1"/> to <path d="1-2-3-4"/>. But I have no idea how to do that, even manually :-/ (I tried but I gave up).
  2. Have a custom version of Vivus which allow you to go use negative values in animation timing function.

In vivus.js line 635. Change

progress = this.pathTimingFunction(Math.max(0, Math.min(1, progress)));

to

progress = this.pathTimingFunction(progress);

Then you will be able to use function (x) {return -x} as animTimingFunction.
Check the result on http://maxwellito.github.io/drafts/vivus-issue-66/ (and the code)

Bottom note
I find it curious that your SVG editor exported your path with the points defined in the opposite order of your drawing. Which software do you use?

from vivus.

smitterko avatar smitterko commented on August 20, 2024

I had the same problem! I had an SVG where one of the lines was drawing in the correct direction but the other two weren't. I figured it had to be something defined in the SVG file somehow when I exported from Illustrator.

It turns out at least in Illustrator 2024, there's an option to reverse path direction.

Select the path with the regular Selection tool. Then Object menu > Path > Reverse Path Direction. Worked like a charm!!
Screenshot 2023-12-13 at 3 52 56 PM

Thank you for this awesome library!

from vivus.

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.