|
1 | | - |
2 | | -.slick-dots li button { |
3 | | - position: relative; |
4 | | - border-radius: 50%; |
5 | | -} |
6 | | - |
7 | | -.slick-dots li button:focus, |
8 | 1 | .slick-dots li button:focus-visible { |
9 | 2 | outline: none; |
10 | 3 | box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.8); |
11 | 4 | } |
12 | 5 |
|
| 6 | +.slick-dots li { |
| 7 | + margin: 0 !important; |
| 8 | +} |
| 9 | + |
13 | 10 | .hero-slider { |
14 | 11 | --dot-size: 1rem; |
15 | | - --dot-active-inner-size: 0.75rem; |
16 | | - --header-height: 4rem; |
| 12 | + --dot-gap: 0.75rem; |
| 13 | + --animation-duration: 12s; |
| 14 | + --dot-color: white; |
| 15 | + --dot-bottom-min: 1rem; |
| 16 | + --dot-bottom-max: 4.5rem; |
17 | 17 |
|
18 | 18 | height: auto; |
19 | | - max-height: calc(100vh - var(--header-height)); |
| 19 | + max-height: calc(100vh - 4rem); |
| 20 | + container-type: inline-size; |
20 | 21 | } |
21 | 22 |
|
22 | | -/* Height constraints for slider internals */ |
23 | 23 | .hero-slider .slick-list, |
24 | | -.hero-slider .slick-track { |
25 | | - height: auto; |
26 | | - max-height: calc(100vh - var(--header-height)); |
27 | | -} |
28 | | - |
| 24 | +.hero-slider .slick-track, |
29 | 25 | .hero-slider .slick-slide, |
30 | 26 | .hero-slider .slick-slide > div, |
31 | 27 | .hero-slider .slick-slide > div > div { |
32 | | - width: 100%; |
33 | 28 | height: auto; |
34 | | - max-height: calc(100vh - var(--header-height)); |
| 29 | + max-height: calc(100vh - 4rem); |
35 | 30 | } |
36 | 31 |
|
37 | 32 | .hero-slider .slick-dots { |
38 | 33 | position: absolute; |
39 | | - bottom: 1.5rem; |
| 34 | + inset-block-end: clamp(var(--dot-bottom-min), 5vw, var(--dot-bottom-max)); |
40 | 35 | z-index: 1; |
| 36 | + display: flex !important; |
| 37 | + gap: var(--dot-gap); |
| 38 | + justify-content: center; |
| 39 | + width: 100%; |
41 | 40 | } |
42 | 41 |
|
43 | | -@media (min-width: 640px) { |
44 | | - .hero-slider .slick-dots { |
45 | | - bottom: 0.5rem; |
46 | | - } |
| 42 | +.hero-slider .slick-dots li { |
| 43 | + width: var(--dot-size); |
| 44 | + height: var(--dot-size); |
| 45 | + aspect-ratio: 1; |
| 46 | + border-radius: 50%; |
47 | 47 | } |
48 | 48 |
|
49 | 49 | .hero-slider .slick-dots li button { |
50 | | - width: var(--dot-size); |
51 | | - height: var(--dot-size); |
| 50 | + position: relative; |
| 51 | + width: 100%; |
| 52 | + height: 100%; |
| 53 | + border: none; |
| 54 | + background: none; |
| 55 | + cursor: pointer; |
52 | 56 | } |
53 | 57 |
|
54 | 58 | .hero-slider .slick-dots li button:before { |
55 | 59 | content: ''; |
56 | 60 | position: absolute; |
57 | | - top: 50%; |
58 | | - left: 50%; |
59 | | - transform: translate(-50%, -50%); |
60 | | - width: var(--dot-size); |
61 | | - height: var(--dot-size); |
| 61 | + inset-block-start: 0; |
| 62 | + inset-inline-start: 0; |
| 63 | + width: 100%; |
| 64 | + height: 100%; |
62 | 65 | border-radius: 50%; |
63 | | - background-color: white; |
| 66 | + background-color: var(--dot-color); |
64 | 67 | opacity: 1; |
| 68 | + transition: all 0.2s ease; |
65 | 69 | } |
66 | 70 |
|
67 | 71 | .hero-slider .slick-dots li.slick-active button:before { |
68 | | - background-color: transparent !important; |
69 | | - border: 2px solid white; |
70 | | - overflow: hidden; |
| 72 | + background-color: transparent; |
| 73 | + border: 1px solid white; |
71 | 74 | } |
72 | 75 |
|
73 | 76 | .hero-slider .slick-dots li.slick-active button:after { |
74 | 77 | content: ''; |
75 | 78 | position: absolute; |
76 | | - top: 50%; |
77 | | - left: 50%; |
78 | | - transform: translate(-50%, -50%); |
| 79 | + inset-block-start: 0; |
| 80 | + inset-inline-start: 0; |
| 81 | + width: 100%; |
| 82 | + height: 100%; |
79 | 83 | border-radius: 50%; |
80 | | - background-color: white; |
81 | | - animation: dotGrow 5s ease-out forwards; |
82 | | - will-change: width, height; |
| 84 | + background-color: var(--dot-color); |
| 85 | + transform: scale(0); |
| 86 | + animation: simpleGrow var(--animation-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; |
83 | 87 | } |
84 | 88 |
|
85 | | -@keyframes dotGrow { |
86 | | - 0% { |
87 | | - width: 0; |
88 | | - height: 0; |
89 | | - opacity: 0.8; |
90 | | - } |
91 | | - 5% { |
92 | | - opacity: 1; |
| 89 | +.hero-slider .slick-dots li button:hover:before { |
| 90 | + transform: scale(1.2); |
| 91 | + box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); |
| 92 | +} |
| 93 | + |
| 94 | +@keyframes simpleGrow { |
| 95 | + 0% { |
| 96 | + transform: scale(0); |
93 | 97 | } |
94 | | - 100% { |
95 | | - width: var(--dot-active-inner-size); |
96 | | - height: var(--dot-active-inner-size); |
97 | | - opacity: 1; |
| 98 | + 100% { |
| 99 | + transform: scale(1); |
98 | 100 | } |
99 | 101 | } |
0 commit comments