Looking to add a cool animation to an image that gradually enlarges it by 10% until it reaches its original size (100%). The animation starts with the image being small and then expands as its top, left, bottom, and right properties increase. Let me know if you need further clarification!
Check out my HTML code:
<!DOCtype html>
<html>
<head>
<meta charset="UTF-8">
<title> Interactive Webpage Practice - 1 </title>
<link rel="stylesheet" href="mystyle1.css"/>
</head>
<body>
<span>
<i> Your webpage is loading...</i><br>
</span>
<img src="welcome.png" alt="Lenny face"/>
</body>
</html>
And here's the CSS code:
* {
padding: 0px;
margin:0px;
}
body {
background-color: white;
}
span {
margin-top: 10px;
top: 100%;
text-align: center;
font-size: 30px;
color: rgb(18, 149, 216);
}
img {
margin-top: 200px;
margin-left: 500px;
-webkit-animation-name: welcome_visitor;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: 1;
animation-name: welcome_visitor;
animation-duration: 2s;
animation-delay: 1s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
@-webkit-keyframes welcome_visitor {
visibility: visible;
0% {top: 0px; left: 0px; bottom: 0px; right: 0px;}
10% {top: 5px; left: 5px; bottom: 5px; right: 5px; }
20% {top: 10px; left: 10px; bottom: 10px; right: 10px; }
30% {top: 15px; left: 15px; bottom: 15px; right: 15px; }
40% {top: 20px; left: 20px; bottom: 20px; right: 20px; }
50% {top: 25px; left: 25px; bottom: 25px; right: 25px; }
60% {top: 30px; left: 30px; bottom: 30px; right: 30px; }
70% {top: 40px; left: 40px; bottom: 40px; right: 40px; }
80% {top: 50px; left: 50px; bottom: 50px; right: 50px; }
90% {top: 60px; left: 60px; bottom: 60px; right: 60px; }
100% {top: 70px; left: 70px; bottom: 70px; right: 70px; }
}
@keyframes welcome_visitor {
visibility: visible;
10% {top: 5px; left: 5px; bottom: 5px; right: 5px; }
20% {top: 10px; left: 10px; bottom: 10px; right: 10px; }
30% {top: 15px; left: 15px; bottom: 15px; right: 15px; }
40% {top: 20px; left: 20px; bottom: 20px; right: 20px; }
50% {top: 25px; left: 25px; bottom: 25px; right: 25px; }
60% {top: 30px; left: 30px; bottom: 30px; right: 30px; }
70% {top: 40px; left: 40px; bottom: 40px; right: 40px; }
80% {top: 50px; left: 50px; bottom: 50px; right: 50px; }
90% {top: 60px; left: 60px; bottom: 60px; right: 60px; }
100% {top: 70px; left: 70px; bottom: 70px; right: 70px; }
}
https://i.sstatic.net/NVwzK.png
^That's the image used in the HTML page.