-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcardAnimation.html
More file actions
131 lines (103 loc) · 2.77 KB
/
cardAnimation.html
File metadata and controls
131 lines (103 loc) · 2.77 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
:root {
--clr-div: rgb(37, 37, 37);
--bg-main: #161313;
--card1-bg: tomato;
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
background: var(--bg-main);
gap: 5vw;
flex-wrap: wrap;
}
.animated_card,
.animated_card2 {
display: grid;
height: 50vh;
background-color: var(--clr-div);
place-items: center;
position: relative;
aspect-ratio: 5/7;
border-radius: 15px;
cursor: pointer;
}
span {
color: var(--clr-div);
font-size: 10em;
z-index: 10;
}
.animated_card::before {
position: absolute;
content: '';
aspect-ratio: 5/7;
/* height: 500px;
width: 350px; */
background-color: var(--card1-bg);
border-radius: 1.5em;
z-index: -1;
transition: 0.2s;
animation: animate 2s linear infinite;
}
.animated_card:hover::before {
height: calc(55vh - 15px);
/* height: 512px;
width: 362px; */
}
@keyframes animate {
50% {
filter: hue-rotate(350deg);
}
}
.animated_card2 {
overflow: hidden;
}
.animated_card2::before {
position: absolute;
content: '';
width: 50%;
height: 150%;
background: lime;
animation: animate2 5s linear infinite;
}
@keyframes animate2 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.animated_card2::after {
position: absolute;
content: '';
inset: 7px;
background: #222;
border-radius: 8px;
}
</style>
</head>
<body>
<div class="animated_card">
<span class="fa-paper-plane fa-regular"></span>
</div>
<div class="animated_card2">
<span class="fa-brands fa-codepen"></span>
</div>
</body>
</html>