Closed stroborobo closed 5 years ago
hi @stroborobo,
I can definitely support object syntax which aligns with <Animate />
.
for at: 0
, you can use Object.entity to get the key and value.
hey @pangpang1987,
Did you have the capacity to convert object into a string for AnimateKeyFrames?
basically, support
<AnimateKeyframes
play
delay={1}
duration={10}
iterationCount={3}
direction="alternative"
keyframes={[
{transform: 'translateY(0)'},
{transform: 'translateY(10px)'},
]}
>
currently, we support only string:
<AnimateKeyframes
play
delay={1}
duration={10}
iterationCount={3}
direction="alternative"
keyframes={[
'transform: translateY(0)',
'transform: translateY(10px)',
]}
>
@bluebill1049
for at: 0, you can use Object.entity to get the key and value
Object.entries? Absolutely, at
was a brain fart anyway, I could just use maps or tuple lists instead m( But thanks for considering the main part of this request :)
haha no worries @stroborobo , either @pangpang1987 or I will work on that feature.
@bluebill1049 I can work on this. Keep the styles object.
thanks, heaps @pangpang1987 legend.
thanks, heaps @pangpang1987 legend.
Do you want to reimplement the two step senerario to use from to? Or keep the existing one?
i think it's better to support both, then it's not a breaking change @pangpang1987
@pangpang1987 I have tested the feature branch works great 👍
however this is not workingkeyframes={[{ 0: {opacity: 0}}, {100: {opacity: 1}}]}
I will publish what you got with a minor update first, we can patch in the next release
Looks like the above use is low. Going to close it for now
Is your feature request related to a problem? Please describe. The API to define styles is different in
AnimateKeyframes
compared toAnimate
. WhileAnimate
supports an object with key/value as styles,AnimateKeyframes
only seems to support a string, making it harder to compute and manipulate.Describe the solution you'd like It would be nice if
AnimateKeyframes
would support the style object, too.Perhaps keyframes could look like this:
Additional context Putting the animation index (%) into a property instead of being the object key itself would help interoperability from other languages that compile to JS, but aren't as dynamic.