You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the script only creates animations for id selectors, and it requires that every animated element in the document has an id.
Non-id selectors can still be used in the anime.js timeline, eg:
.add({targets: 'g > circle'})
This would successfully select all circle elements that are direct children of g elements:
<g>
<!-- these circles would have a valid CSS animation created for them, as they have ids-->
<circleid="circle-a"/>
<circleid="circle-b"/>
<circleid="circle-c"/>
</g>
<g>
<!-- these circles would _not_ have a valid CSS animation created for them -->
<circle/>
<circle/>
<circle/>
</g>
My current approach could result in needlessly repetitive CSS, eg. if there were many g > circle elements:
My current approach also requires that you go through your document and add ids to every element referenced in the anime.js timeline before running the script, which is a bit of a faff.
The text was updated successfully, but these errors were encountered:
One way of avoiding needlessly repetitive CSS, whether this change is made or not, would be to check if any @keyframes blocks are identical, merge them into one, and update the animation-name references.
Does this check-and-merge happen before converting the targets object into a string for manipulating into CSS syntax? (probably, yes)
What name should be given to the new animation? Something short and meaningless like a-anim, or concatenate something potentially very long like circle-a-circle-b-circle-c-circle-d-circle-e-circle-f-circle-g-circle-h-circle-i-circle-j-anim, or maybe a name created from the animated properties, eg. opacity-transform-scale-anim-a?
Currently the script only creates animations for
id
selectors, and it requires that every animated element in the document has anid
.Non-
id
selectors can still be used in the anime.js timeline, eg:This would successfully select all
circle
elements that are direct children ofg
elements:My current approach could result in needlessly repetitive CSS, eg. if there were many
g > circle
elements:Compared to:
My current approach also requires that you go through your document and add
id
s to every element referenced in the anime.js timeline before running the script, which is a bit of a faff.The text was updated successfully, but these errors were encountered: