-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimation.html
More file actions
96 lines (79 loc) · 1.55 KB
/
Copy pathAnimation.html
File metadata and controls
96 lines (79 loc) · 1.55 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Animation Scene</title>
<style>
/* PAGE STYLING */
body {
background: linear-gradient(to right, #d9c6ff, #f3e8ff);
font-family: Arial, sans-serif;
overflow: hidden;
}
/* TITLE */
h1 {
text-align: center;
margin-top: 20px;
transition: all 3s ease-in;
}
/* HOVER EFFECT (REQUIRED) */
h1:hover {
color: #6a0dad;
text-shadow: 5px 5px 10px rgba(0,0,0,0.5);
}
/* ANIMATED OBJECT */
.box {
width: 100px;
height: 100px;
background: #7b2cbf;
position: absolute;
top: 50%;
left: 0;
border-radius: 10px;
animation: moveBox 12s infinite;
}
/* KEYFRAMES (REQUIRED %) */
@keyframes moveBox {
0% {
left: 0;
top: 50%;
background: #7b2cbf;
transform: scale(1);
border-radius: 10px;
}
25% {
left: 25%;
top: 20%;
background: #9d4edd;
transform: scale(1.2) rotate(45deg);
border-radius: 50%;
}
50% {
left: 50%;
top: 70%;
background: #c77dff;
transform: scale(1.4) rotate(90deg);
border-radius: 0;
}
75% {
left: 75%;
top: 30%;
background: #e0aaff;
transform: scale(1.2) rotate(180deg);
border-radius: 20px;
}
100% {
left: 100%;
top: 50%;
background: #7b2cbf;
transform: scale(1) rotate(360deg);
border-radius: 10px;
}
}
</style>
</head>
<body>
<h1>My CSS Animation Scene</h1>
<div class="box"></div>
</body>
</html>