-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbook-header.css
74 lines (65 loc) · 1.64 KB
/
book-header.css
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
@keyframes shiftGradient {
0% {
background-position: 0% 50%;
}
100% {
background-position: 100% 50%;
}
}
@keyframes shiftGradientBack {
0% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
header {
background-color: var(--bg);
position: relative;
border-radius: 60% 0 0 0;
padding-top: 4rem;
}
header::after {
--accent: #98E6B5ff;
--shadow: #0000003b;
}
@media (prefers-color-scheme: dark) {
header::after {
--accent: #98E6B5ff;
--shadow: #ffffff3b;
}
}
@media (min-width: 600px) {
header {
padding-top: 6rem !important;
}
header::after {
content: '';
position: absolute;
width: 100%;
/* Match the width of the h1 */
height: 100%;
/* Match the height of the h1 */
left: 1.6rem;
/* Horizontal position of the shadow */
top: -2.1rem;
/* Vertical position of the shadow */
background:
/* Gradient from shadow color to accent color */
linear-gradient(to right, var(--shadow) 50%, var(--accent));
background-size: 250% 100%;
/* Make the gradient larger than the element */
filter: blur(8px);
/* Blur effect for the shadow */
z-index: -1;
/* Ensure the shadow is behind the text */
border-radius: 60% 0 0 0;
/* Match the border-radius of the h1 */
transition: all 0.3s ease-in-out;
animation: shiftGradientBack 0.8s ease forwards;
}
header:hover::after {
animation: shiftGradient 0.8s ease forwards;
}
}