versoly / taos

A simple and small (600 bytes) library to help animate elements while scrolling using responsive Tailwind CSS JIT utility classes.
MIT License
229 stars 8 forks source link

Add support for turbo-rails #11

Closed Ancez closed 9 months ago

Ancez commented 9 months ago

At the moment, visits through turbo do not refresh the animations so the animations completely disappear. This fixes it.

Ref: https://turbo.hotwired.dev/reference/events

volkandkaya commented 9 months ago

Hey, I won't be merging that. I might look at ways of hooking into or refreshing it but TAOS is built to be as small as possible.

Ancez commented 9 months ago

Hey, I won't be merging that. I might look at ways of hooking into or refreshing it but TAOS is built to be as small as possible.

No worries, I don't want this merged. Would love to discuss this before coding anything.

How should I handle DOM mutations while using this package? Any ideas?

What do you think about converting how TAOS initialises so I can initialise it on specific elements manually? (through JS) That way events won't be a problem... This would have knock-on effects so do you have any other suggestions? Thanks

I might just go with a fork that'll work with StimulusJS

volkandkaya commented 9 months ago

You could just paste the code into an event listener, or if you want to use CDN create a function to create a script tag after loading.

For page speed could use prelink on that CDN link.

volkandkaya commented 9 months ago

I might have a solution in the future will ship "taos-core" that you can then use to manually add stuff.

Vite has made it much easier to reason about multiple packages.