|
1 | 1 | .interactive-container { |
2 | | - // Tạo không gian để cuộn, chiều cao gấp 3 lần màn hình |
3 | | - height: 200vh; |
| 2 | + height: 150vh; |
4 | 3 | position: relative; |
5 | | - background-color: #0a0a1a; // Nền tối để nổi bật animation |
| 4 | + overflow: hidden; |
| 5 | + |
| 6 | + background-image: |
| 7 | + /* lớp overlay đen fade trong suốt ở trên/dưới */ linear-gradient( |
| 8 | + to bottom, |
| 9 | + rgba(0, 0, 0, 0) 0%, |
| 10 | + rgba(0, 0, 0, 0.6) 20%, |
| 11 | + rgba(0, 0, 0, 0.6) 80%, |
| 12 | + rgba(0, 0, 0, 0) 100% |
| 13 | + ), |
| 14 | + /* lớp ảnh vũ trụ có gradient để mờ dần */ |
| 15 | + linear-gradient( |
| 16 | + to bottom, |
| 17 | + rgba(0, 0, 0, 0.6) 0%, |
| 18 | + rgba(0, 0, 0, 0) 20%, |
| 19 | + rgba(0, 0, 0, 0) 80%, |
| 20 | + rgba(0, 0, 0, 0.6) 100% |
| 21 | + ), |
| 22 | + url("../../../../../../public/assets/background/vutru.svg"); |
| 23 | + |
| 24 | + background-size: cover; |
| 25 | + background-position: center; |
| 26 | + background-repeat: no-repeat; |
| 27 | + |
| 28 | + .parallax, |
| 29 | + .sticky-wrapper { |
| 30 | + position: relative; |
| 31 | + z-index: 1; |
| 32 | + } |
| 33 | + |
| 34 | + .parallax { |
| 35 | + position: absolute; |
| 36 | + background-repeat: no-repeat; |
| 37 | + background-size: contain; |
| 38 | + background-position: center; |
| 39 | + will-change: transform; |
| 40 | + } |
| 41 | + |
| 42 | + .parallax-earth { |
| 43 | + top: 50%; |
| 44 | + left: 50%; |
| 45 | + width: 60vw; |
| 46 | + height: 60vh; |
| 47 | + transform: translate(-50%, -50%); |
| 48 | + position: absolute; |
| 49 | + z-index: 1; |
| 50 | + |
| 51 | + background: url("../../../../../../public/assets/background/traidat.png") |
| 52 | + center/contain no-repeat; |
| 53 | + |
| 54 | + -webkit-mask-image: url("../../../../../../public/assets/background/traidat.png"); |
| 55 | + -webkit-mask-repeat: no-repeat; |
| 56 | + -webkit-mask-position: center; |
| 57 | + -webkit-mask-size: contain; |
| 58 | + mask-image: url("../../../../../../public/assets/background/traidat.png"); |
| 59 | + mask-repeat: no-repeat; |
| 60 | + mask-position: center; |
| 61 | + mask-size: contain; |
| 62 | + |
| 63 | + &::before { |
| 64 | + content: ""; |
| 65 | + position: absolute; |
| 66 | + inset: 0; |
| 67 | + background: linear-gradient( |
| 68 | + 135deg, |
| 69 | + rgba(255, 255, 249, 0.6), |
| 70 | + rgba(3, 18, 181, 0.6) |
| 71 | + ); |
| 72 | + opacity: 0.6; |
| 73 | + pointer-events: none; |
| 74 | + |
| 75 | + -webkit-mask-image: url("../../../../../../public/assets/background/traidat.png"); |
| 76 | + -webkit-mask-repeat: no-repeat; |
| 77 | + -webkit-mask-position: center; |
| 78 | + -webkit-mask-size: contain; |
| 79 | + mask-image: url("../../../../../../public/assets/background/traidat.png"); |
| 80 | + mask-repeat: no-repeat; |
| 81 | + mask-position: center; |
| 82 | + mask-size: contain; |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + /* Gom cụm về góc dưới bên phải */ |
| 87 | + .parallax-laptop, |
| 88 | + .parallax-kinhlup, |
| 89 | + .parallax-tham, |
| 90 | + .parallax-vo, |
| 91 | + .parallax-vi { |
| 92 | + position: absolute; |
| 93 | + top: auto; |
| 94 | + left: auto; |
| 95 | + bottom: 0; |
| 96 | + right: -20%; |
| 97 | + transform: translate(-50%, -50%); |
| 98 | + background-repeat: no-repeat; |
| 99 | + background-size: contain; |
| 100 | + will-change: transform; |
| 101 | + |
| 102 | + /* overlay sáng giống parallax-earth */ |
| 103 | + &::before { |
| 104 | + content: ""; |
| 105 | + position: absolute; |
| 106 | + inset: 0; |
| 107 | + background: linear-gradient( |
| 108 | + 135deg, |
| 109 | + rgba(255, 241, 241, 0.4), |
| 110 | + rgba(26, 5, 118, 0.5) |
| 111 | + ); |
| 112 | + pointer-events: none; |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + /* Laptop chính, to và nghiêng nhẹ */ |
| 117 | + .parallax-laptop { |
| 118 | + width: 65vw; |
| 119 | + height: 65vh; |
| 120 | + background-image: url("../../../../../../public/assets/background/laptop.png"); |
| 121 | + transform: translate(-50%, -50%) rotate(-20deg); |
| 122 | + top: 70%; |
| 123 | + bottom: 10%; |
| 124 | + z-index: 5; |
| 125 | + |
| 126 | + &::before { |
| 127 | + -webkit-mask-image: url("../../../../../../public/assets/background/laptop.png"); |
| 128 | + -webkit-mask-repeat: no-repeat; |
| 129 | + -webkit-mask-position: center; |
| 130 | + -webkit-mask-size: contain; |
| 131 | + mask-image: url("../../../../../../public/assets/background/laptop.png"); |
| 132 | + mask-repeat: no-repeat; |
| 133 | + mask-position: center; |
| 134 | + mask-size: contain; |
| 135 | + } |
| 136 | + } |
| 137 | + |
| 138 | + .parallax-vo { |
| 139 | + width: 55vw; |
| 140 | + height: 50vh; |
| 141 | + background-image: url("../../../../../../public/assets/background/vo.png"); |
| 142 | + bottom: 55%; |
| 143 | + right: 50%; |
| 144 | + z-index: 4; |
| 145 | + |
| 146 | + &::before { |
| 147 | + -webkit-mask-image: url("../../../../../../public/assets/background/vo.png"); |
| 148 | + -webkit-mask-repeat: no-repeat; |
| 149 | + -webkit-mask-position: center; |
| 150 | + -webkit-mask-size: contain; |
| 151 | + mask-image: url("../../../../../../public/assets/background/vo.png"); |
| 152 | + mask-repeat: no-repeat; |
| 153 | + mask-position: center; |
| 154 | + mask-size: contain; |
| 155 | + } |
| 156 | + } |
| 157 | + |
| 158 | + .parallax-tham { |
| 159 | + width: 55vw; |
| 160 | + height: 40vh; |
| 161 | + background-image: url("../../../../../../public/assets/background/tham.png"); |
| 162 | + bottom: 10%; |
| 163 | + right: 40%; |
| 164 | + z-index: 3; |
| 165 | + |
| 166 | + &::before { |
| 167 | + -webkit-mask-image: url("../../../../../../public/assets/background/tham.png"); |
| 168 | + -webkit-mask-repeat: no-repeat; |
| 169 | + -webkit-mask-position: center; |
| 170 | + -webkit-mask-size: contain; |
| 171 | + mask-image: url("../../../../../../public/assets/background/tham.png"); |
| 172 | + mask-repeat: no-repeat; |
| 173 | + mask-position: center; |
| 174 | + mask-size: contain; |
| 175 | + } |
| 176 | + } |
| 177 | + |
| 178 | + .parallax-kinhlup { |
| 179 | + width: 28vw; |
| 180 | + height: 28vh; |
| 181 | + background-image: url("../../../../../../public/assets/background/kinhlup.png"); |
| 182 | + bottom: 80%; |
| 183 | + right: 0; |
| 184 | + z-index: 6; |
| 185 | + |
| 186 | + &::before { |
| 187 | + -webkit-mask-image: url("../../../../../../public/assets/background/kinhlup.png"); |
| 188 | + -webkit-mask-repeat: no-repeat; |
| 189 | + -webkit-mask-position: center; |
| 190 | + -webkit-mask-size: contain; |
| 191 | + mask-image: url("../../../../../../public/assets/background/kinhlup.png"); |
| 192 | + mask-repeat: no-repeat; |
| 193 | + mask-position: center; |
| 194 | + mask-size: contain; |
| 195 | + } |
| 196 | + } |
| 197 | + |
| 198 | + .parallax-vi { |
| 199 | + width: 38vw; |
| 200 | + height: 32vh; |
| 201 | + background-image: url("../../../../../../public/assets/background/vi.png"); |
| 202 | + bottom: 40%; |
| 203 | + right: -10%; |
| 204 | + z-index: 4; |
| 205 | + |
| 206 | + &::before { |
| 207 | + -webkit-mask-image: url("../../../../../../public/assets/background/vi.png"); |
| 208 | + -webkit-mask-repeat: no-repeat; |
| 209 | + -webkit-mask-position: center; |
| 210 | + -webkit-mask-size: contain; |
| 211 | + mask-image: url("../../../../../../public/assets/background/vi.png"); |
| 212 | + mask-repeat: no-repeat; |
| 213 | + mask-position: center; |
| 214 | + mask-size: contain; |
| 215 | + } |
| 216 | + } |
6 | 217 |
|
7 | 218 | .sticky-wrapper { |
8 | 219 | position: sticky; |
|
11 | 222 | width: 100%; |
12 | 223 | display: flex; |
13 | 224 | justify-content: center; |
14 | | - align-items: center; |
15 | | - overflow: hidden; |
16 | | - z-index: 1; |
17 | | - |
18 | | - canvas { |
19 | | - width: 80%; |
20 | | - height: 80%; |
21 | | - object-fit: contain; |
22 | | - } |
| 225 | + align-items: flex-start; |
| 226 | + z-index: 3; |
23 | 227 |
|
24 | 228 | .overlay-text { |
25 | 229 | position: absolute; |
26 | 230 | color: white; |
27 | 231 | text-align: center; |
28 | 232 | max-width: 600px; |
29 | | - // Hiệu ứng chữ mờ dần khi cuộn |
30 | | - opacity: 1; |
31 | | - transition: opacity 0.5s ease; |
| 233 | + transition: opacity 0.5s ease, transform 0.5s ease; |
32 | 234 | } |
33 | 235 | } |
34 | 236 | } |
0 commit comments