0
I wanted to do an effect with the Animation or Transition CSS3 that when the red square passes, the background appears (the yellow background with the texts) and then erases immediately after the red square has finished passing.
Below is as much as I could do, I could not finish this effect at all. Is that possible? Thanks in advance!
I put an effect in the background using the mouse event Hover, I want this same effect, but not with the mouse but with the red square passing.
<!doctype html>
<html>
<head>
<style>
#yellow {
background-color: yellow;
}
#shadow {
background-color: black;
width: 100%;
height: 2048px;
position:absolute;
left:1px;
top:1px;
transition: all 3s ease;
}
#shadow:hover {
opacity: 0;
}
#square {
margin-top: 10px;
width: 20px;
height: 20px;
background: red;
position: relative;
-webkit-animation: mymove 10s infinite;
}
@-webkit-keyframes mymove {
from {left: 0px;}
to {left: 600px;}
}
</style>
</head>
<body id="yellow">
<h1>Estou aqui!</h1><br><br>
<h4>Texto teste</h4>
<div id="shadow"></div>
<div id="square"></div>
</body>
</html>
Okay, a question, if it was an infinite loop and that square was rotating in circles with a certain circumference, or even in an infinite line, would it be possible to make it fade away where it went and illuminate only where it is? Thank you for now, that’s about it, I didn’t express myself correctly.
– BamDev
You should be able to make this circle effect with some image, see this answer, I believe it will help a lot: https://stackoverflow.com/questions/8286550/transparent-hollow-or-cut-out-circle
– Wictor Chaves
I managed to find a way here. Thank you!
– BamDev