D
D
Denis Bukreev2016-11-14 00:11:01
css
Denis Bukreev, 2016-11-14 00:11:01

How to properly arrange SVG animation?

So it goes.
There is an SVG on which a gradient is applied (with the help of <defs /><linearGradient />)
And you need to hang an overflow (glare) on the gradient on this SVG.
Now I see one way: to sit and go through each color in the gradient in the keyframe like a dummy and achieve the desired result. But this, in my opinion, is idiotic.
I'm sure there are easier ways.
Maybe someone knows such ways not to sort through each color, but maybe overlay it on top?
Or maybe just the offset of this gradient will pass for overflow - but how to do this from CSS, if the offset attribute is responsible for this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Kokovin, 2016-11-14
@Per_Ardua

Or maybe just the offset of this gradient will pass for overflow - but how to do this from CSS, if the offset attribute is responsible for this?

It will do. You make two identical gradients and animate each like this:
from {
    transform: translateY(-100%);
}
to {
    transform: translateY(100%);
}

Just put a delay on one of them

A
A person from Kazakhstan, 2016-11-14
@LenovoId

codepen.io/Geyan/pen/MbyXmq is the first example without svg
https://developer.mozilla.org/en-US/docs/Web/SVG/E... this is with svg (there is a sandbox with an example)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question