I'm exploring animations and experimenting with a div containing three box-shadows. My goal is to create a hover effect where the box-shadows fade in one after the other, starting with the closest one to the div. I also want them to fade out in reverse order when the cursor stops hovering over the div. Any suggestions on how to achieve this?
#div2 {
background-color: aquamarine;
box-shadow: 15px 15px 10px blueviolet inset, -15px -15px 10px blueviolet inset;
width: 500px;
height: 200px;
padding: 25px;
padding-left: 50px;
transition: box-shadow 2s ease;
}
#div2:hover {
background-color: aquamarine;
box-shadow: 5px 5px 1px darkblue, 10px 10px 3px blue, 15px 15px 5px lightblue, 15px 15px 10px blueviolet inset, -15px -15px 10px blueviolet inset;
}
<div id="div2">
<p>Lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum</p>
</div>