Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
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';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question