-
Notifications
You must be signed in to change notification settings - Fork 1
/
rainbow_card.html
98 lines (79 loc) · 2.13 KB
/
rainbow_card.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">
<title>Document</title>
<style>
.card {
background-color: var(--background);
display: block;
width: 300px;
min-height: 90px;
border: 3px solid var(--primary);
padding: 15px;
margin: calc(50vh - 30px) auto 0 auto;
box-shadow: 10px -10px 0 -3px var(--background), 10px -10px var(--green),
20px -20px 0 -3px var(--background), 20px -20px var(--yellow),
30px -30px 0 -3px var(--background), 30px -30px var(--orange),
40px -40px 0 -3px var(--background), 40px -40px var(--red);
transition: box-shadow 1s, top 1s, left 1s;
position: relative;
top: 0;
left: 0;
cursor: pointer;
}
.card:hover {
top: -40px;
left: 40px;
box-shadow: 0 0 0 -3px var(--background), 0 0 0 0 var(--green),
0 0 0 -3px var(--background), 0 0 0 0 var(--yellow),
0 0 0 -3px var(--background), 0 0 0 0 var(--orange),
0 0 0 -3px var(--background), 0 0 0 0 var(--red);
}
:root {
--primary: #555BFF;
--secondary: #22D2A0;
--background: white;
--green: #1FC11B;
--yellow: #FFD913;
--orange: #FF9C55;
--red: #FF5555;
}
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background-image: radial-gradient(var(--secondary) 30%, var(--background) 30%);
background-size: 2px 3px;
font-family: "Archivo", sans-serif;
color: var(--primary);
}
.card p {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 10px;
}
.card h2 {
font-size: 14px;
font-family: "Archivo Black", "Archivo", sans-serif;
font-weight: normal;
}
</style>
</head>
<body>
<link href="https://fonts.googleapis.com/css?family=Archivo+Black&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Archivo:700&display=swap" rel="stylesheet">
<div class="card">
<p>
Similar post
</p>
<h2>
How I recreated a Polaroid camera with CSS gradients only
</h2>
</div>
</body>
</html>