-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimatedGradients.html
98 lines (83 loc) · 2.24 KB
/
animatedGradients.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
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
97
98
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
:root{
--graident : linear-gradient(45deg,
#845ec2,
#d65db1,
#ff6f91,
#ff9671,
#ffc75f,
#f9f871
);
}
body {
margin : 0;
padding : 0;
min-height : 100vh;
width : 100%;
display : flex;
justify-content: center;
align-items: center;
font-size : 1.125em;
line-height: 1.6;
color : #333;
background : #ddd;
background-size : 300%;
background-image : var(--graident);
animation : bg-animation 5s infinite alternate; /* importante alternate */
}
@keyframes bg-animation {
0%{
background-position: left;
}
100%{
background-position: right ;
}
}
.container{
width : 70vw;
background : wheat;
padding : 3em;
box-shadow : 0 0 3em rgba(0,0,0,.15);
}
.fun {
border : 0;
padding : 0.5em 1.5em;
font-size : 2rem;
background-image : var(--graident);
background-size : 300%; /* importante */
background-position: left; /* importante */
transition: background-position 1s; /* importante */
}
.fun:hover{
background-position: right;
}
.title{
margin : 0 0 0.5em;
text-transform: uppercase;
font-weight: 900;
font-style: italic;
font-size: 6rem;
color : #ee6352;
line-height: 0.8;
margin: 0;
background-image : var(--graident);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
}
</style>
</head>
<body>
<div class="container">
<h1 class="title"> Animating Gradients </h1>
<button class="fun">hover me</button>
</div>
</body>
</html>