|
1 | 1 | <!doctype html> |
2 | | -<html> |
| 2 | +<html style="width: 408px; min-width: 408px; max-width: 408px; height: 520px; min-height: 520px; max-height: 520px;"> |
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8" /> |
5 | 5 | <title>Maple Bookmarks</title> |
6 | 6 | <script src="height-init.js"></script> |
7 | 7 | <style> |
| 8 | + html { |
| 9 | + width: 408px; |
| 10 | + min-width: 408px; |
| 11 | + max-width: 408px; |
| 12 | + height: 520px; |
| 13 | + min-height: 520px; |
| 14 | + max-height: 520px; |
| 15 | + } |
| 16 | + |
8 | 17 | body { |
9 | 18 | margin: 0; |
10 | 19 | padding: 8px 0 12px 12px; |
11 | 20 | width: 408px; |
12 | | - height: var(--popup-height, 400px); /* 使用动态计算的高度变量 */ |
13 | | - min-height: 200px; |
14 | | - max-height: 618px; |
| 21 | + min-width: 408px; |
| 22 | + max-width: 408px; |
| 23 | + height: 520px; |
| 24 | + min-height: 520px; |
| 25 | + max-height: 520px; |
15 | 26 | box-sizing: border-box; |
16 | | - /* 模仿Chrome原生popup的顺滑效果 */ |
17 | | - opacity: 0; |
18 | | - transform: scale(0.98) translateY(-4px); |
19 | | - animation: popupFadeIn 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; |
20 | | - /* 添加轻微的深度效果 */ |
21 | | - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
22 | | - border-radius: 6px; |
| 27 | + overflow-x: hidden; |
| 28 | + overflow-y: auto; |
23 | 29 | background-color: #ffffff; |
24 | 30 | } |
25 | 31 |
|
26 | | - /* Chrome风格的顺滑弹窗动画 */ |
27 | | - @keyframes popupFadeIn { |
28 | | - 0% { |
29 | | - opacity: 0; |
30 | | - transform: scale(0.98) translateY(-4px); |
31 | | - } |
32 | | - 100% { |
33 | | - opacity: 1; |
34 | | - transform: scale(1) translateY(0); |
35 | | - } |
36 | | - } |
37 | | - |
38 | 32 | #hot-area { |
39 | 33 | position: absolute; |
40 | 34 | top: 0; |
|
128 | 122 | line-height: 1.8; |
129 | 123 | } |
130 | 124 |
|
| 125 | + .loading-state { |
| 126 | + width: 100%; |
| 127 | + padding-right: 12px; |
| 128 | + box-sizing: border-box; |
| 129 | + } |
| 130 | + |
| 131 | + body.popup-loading #search-wrapper, |
| 132 | + body.popup-loading #hot-area, |
| 133 | + body.popup-loading #notification-container, |
| 134 | + body.popup-loading .settings-wrapper { |
| 135 | + visibility: hidden; |
| 136 | + } |
| 137 | + |
| 138 | + .loading-title { |
| 139 | + width: 170px; |
| 140 | + height: 16px; |
| 141 | + border-radius: 8px; |
| 142 | + background: linear-gradient(90deg, #efefef 25%, #e4e4e4 37%, #efefef 63%); |
| 143 | + background-size: 400% 100%; |
| 144 | + margin: 10px 0 14px 2px; |
| 145 | + animation: mapleSkeleton 1.2s ease-in-out infinite; |
| 146 | + } |
| 147 | + |
| 148 | + .loading-grid { |
| 149 | + display: flex; |
| 150 | + flex-wrap: wrap; |
| 151 | + } |
| 152 | + |
| 153 | + .loading-card { |
| 154 | + width: 120px; |
| 155 | + height: 42px; |
| 156 | + box-sizing: border-box; |
| 157 | + border-radius: 5px; |
| 158 | + background: linear-gradient(90deg, #f4f4f4 25%, #ececec 37%, #f4f4f4 63%); |
| 159 | + background-size: 400% 100%; |
| 160 | + margin-bottom: 12px; |
| 161 | + margin-right: 12px; |
| 162 | + animation: mapleSkeleton 1.2s ease-in-out infinite; |
| 163 | + } |
| 164 | + |
| 165 | + @keyframes mapleSkeleton { |
| 166 | + 0% { |
| 167 | + background-position: 100% 50%; |
| 168 | + } |
| 169 | + 100% { |
| 170 | + background-position: 0 50%; |
| 171 | + } |
| 172 | + } |
| 173 | + |
131 | 174 | .childContainer { |
132 | 175 | display: flex; |
133 | 176 | flex-wrap: wrap; |
|
139 | 182 | position: relative; |
140 | 183 | margin-top: -30px; |
141 | 184 | transform: translateY(-105%); |
| 185 | + transition: none; |
| 186 | + } |
| 187 | + |
| 188 | + body.popup-interactive #search-wrapper { |
142 | 189 | transition: all 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94); |
143 | 190 | } |
144 | 191 |
|
|
173 | 220 | display: inline-block; |
174 | 221 | padding: 4px; |
175 | 222 | transform: rotate(45deg); |
176 | | - transition: all 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94); |
| 223 | + transition: none; |
177 | 224 | cursor: pointer; |
178 | 225 | } |
179 | 226 |
|
| 227 | + body.popup-interactive #search-wrapper .arrow { |
| 228 | + transition: all 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94); |
| 229 | + } |
| 230 | + |
180 | 231 | #search-wrapper .arrow::after { |
181 | 232 | content: ""; |
182 | 233 | display: inline-block; |
|
237 | 288 | background-color: transparent; |
238 | 289 | } |
239 | 290 |
|
| 291 | + #bookmarks { |
| 292 | + min-height: 420px; |
| 293 | + } |
| 294 | + |
240 | 295 | #searchInput { |
241 | 296 | width: 100%; |
242 | 297 | padding: 10px 12px; |
|
259 | 314 | body { |
260 | 315 | background-color: #2a2a2a; |
261 | 316 | color: #f1f1f1; |
262 | | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); |
263 | 317 | } |
264 | 318 |
|
265 | 319 | #notification-container { |
|
369 | 423 | } |
370 | 424 | </style> |
371 | 425 | </head> |
372 | | - <body> |
| 426 | + <body |
| 427 | + class="popup-loading" |
| 428 | + style="width: 408px; min-width: 408px; max-width: 408px; height: 520px; min-height: 520px; max-height: 520px;" |
| 429 | + > |
373 | 430 | <div class="settings-wrapper"> |
374 | 431 | <button class="settings-btn" id="settingsBtn" title="">⚙️</button> |
375 | 432 | </div> |
|
384 | 441 | <i class="arrow"></i> |
385 | 442 | </div> |
386 | 443 | </div> |
387 | | - <div id="bookmarks"></div> |
| 444 | + <div id="bookmarks"> |
| 445 | + <div class="loading-state" data-loading="true" aria-label="Loading bookmarks"> |
| 446 | + <div class="loading-title"></div> |
| 447 | + <div class="loading-grid"> |
| 448 | + <div class="loading-card"></div> |
| 449 | + <div class="loading-card"></div> |
| 450 | + <div class="loading-card"></div> |
| 451 | + <div class="loading-card"></div> |
| 452 | + <div class="loading-card"></div> |
| 453 | + <div class="loading-card"></div> |
| 454 | + <div class="loading-card"></div> |
| 455 | + <div class="loading-card"></div> |
| 456 | + <div class="loading-card"></div> |
| 457 | + </div> |
| 458 | + </div> |
| 459 | + </div> |
388 | 460 | <script type="module" src="popup.js"></script> |
389 | 461 | </body> |
390 | 462 | </html> |
0 commit comments