J
J
Junior2019-03-01 15:24:11
css
Junior, 2019-03-01 15:24:11

How to make a similar effect on the site or what is the name of such an effect?

How to make an effect like in this picture (Where the line is formed)?
Or what is this effect called?
(Gif from an article on Habré)
wevjlg0qmxqqrzkaw3cgr9ctsds.gif

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2019-03-01
@IT-Programmer

A line is just a block with dimensions and a black background.
To achieve this effect, it is enough to use the properties
position: absolute; left:N; top: N; - to remove it from the screen
transform: rotate(45deg); - to rotate it to the desired angle (45 degrees in this case)
transition: 2s width; - to animate the change in width
And after loading the page, run a js script that will set a new width of the line, such that it crawls out of the screen border

window.onload = function () {
  var line = document.querySelector('#line');
  if (line) {
    line.style.width = '100px';
  }
}

Using this, it will be quite easy to complicate the animation the way you want.

S
Samuello, 2019-03-01
@Samuello

Not exactly the same, but still https://github.com/michalsnik/aos

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question