Skip to content

Commit 65c1407

Browse files
committed
style: 實現 iOS Safari 風格的 glassmorphism 關閉按鈕
- 使用 backdrop-filter 實現毛玻璃效果 - 配色和樣式完全符合 iOS Safari 設計語言 - 30x30px 圓形按鈕,半透明灰色背景 - hover 和 active 狀態動畫優化 - 響應式設計支援行動裝置
1 parent 2420836 commit 65c1407

1 file changed

Lines changed: 27 additions & 36 deletions

File tree

index.html

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -308,58 +308,53 @@
308308
position: fixed;
309309
top: 70px;
310310
right: calc((100% - 900px) / 2 + 30px);
311-
width: 32px;
312-
height: 32px;
311+
width: 30px;
312+
height: 30px;
313313
cursor: pointer;
314-
background: transparent;
315-
border-radius: 50%;
314+
background: rgba(142, 142, 147, 0.12);
315+
backdrop-filter: blur(20px);
316+
-webkit-backdrop-filter: blur(20px);
317+
border-radius: 15px;
316318
display: flex;
317319
align-items: center;
318320
justify-content: center;
319321
z-index: 1001;
320-
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
322+
transition: all 0.2s ease;
321323
border: none;
322324
outline: none;
323325
padding: 0;
324-
opacity: 0.6;
325326
}
326327

327-
.markdown-close::before {
328+
.markdown-close::before,
329+
.markdown-close::after {
328330
content: '';
329331
position: absolute;
330-
width: 40px;
331-
height: 40px;
332-
background: rgba(0, 0, 0, 0.05);
333-
border-radius: 50%;
334-
transform: scale(0);
335-
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
336-
}
337-
338-
.markdown-close svg {
339-
width: 16px;
340-
height: 16px;
341-
stroke: #333;
342-
stroke-width: 2.5;
343-
transition: all 0.2s ease;
344-
position: relative;
345-
z-index: 1;
332+
width: 14px;
333+
height: 1.5px;
334+
background: rgba(60, 60, 67, 0.6);
335+
border-radius: 2px;
346336
}
347337

348-
.markdown-close:hover {
349-
opacity: 1;
338+
.markdown-close::before {
339+
transform: rotate(45deg);
350340
}
351341

352-
.markdown-close:hover::before {
353-
transform: scale(1);
342+
.markdown-close::after {
343+
transform: rotate(-45deg);
344+
}
345+
346+
.markdown-close:hover {
347+
background: rgba(142, 142, 147, 0.2);
354348
}
355349

356-
.markdown-close:hover svg {
357-
stroke: #000;
358-
transform: rotate(90deg);
350+
.markdown-close:hover::before,
351+
.markdown-close:hover::after {
352+
background: rgba(60, 60, 67, 0.8);
359353
}
360354

361355
.markdown-close:active {
362-
transform: scale(0.95);
356+
background: rgba(142, 142, 147, 0.3);
357+
transform: scale(0.96);
363358
}
364359

365360
@media (max-width: 900px) {
@@ -671,11 +666,7 @@ <h2>📚 8 個學習場景</h2>
671666
<!-- Markdown Modal -->
672667
<div id="markdownModal" class="markdown-modal">
673668
<div class="markdown-content">
674-
<button class="markdown-close" onclick="closeMarkdown()" aria-label="關閉">
675-
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
676-
<path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
677-
</svg>
678-
</button>
669+
<button class="markdown-close" onclick="closeMarkdown()" aria-label="關閉"></button>
679670
<div id="markdownBody">
680671
<div class="markdown-loading">📡 載入中...</div>
681672
</div>

0 commit comments

Comments
 (0)