-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimate.html
56 lines (49 loc) · 1.41 KB
/
animate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<title>Animate</title>
<style>
@keyframes zahid{
from{font-size: 20px;left:0%;}
to {font-size: 100px; left:50%;}
}
h1{
position:relative;
animation-name: zahid;
animation-duration: 4s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
}
h2{
position:relative;
animation-name: zahidul;
animation-duration: 4s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
}
@keyframes zahidul{
0%{font-size: 20px;left:0%;}
100% {font-size: 100px; left:50%; color: brown;}
}
</style>
<script>
document.addEventListener('DOMContentLoaded',function(){
const h1= document.querySelector('h1');
h1.style.animationPlayState='paused';
document.querySelector('button').onclick=()=>{
if(h1.style.animationPlayState=='paused'){
h1.style.animationPlayState= 'running';
}
else{
h1.style.animationPlayState='paused';
}
}
});
</script>
</head>
<body>
<button> click here</button>
<h1 >welcome</h1>
<h2 > zahidul</h2>
</body>
</html>