Skip to content

Commit 101f727

Browse files
committed
style: 優化關閉按鈕設計為更簡約風格
- 使用更小巧的 SVG 圖示 - 半透明設計,懸停時顯示背景 - 添加旋轉動畫效果
1 parent 470e00c commit 101f727

1 file changed

Lines changed: 41 additions & 26 deletions

File tree

index.html

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -308,53 +308,64 @@
308308
position: fixed;
309309
top: 70px;
310310
right: calc((100% - 900px) / 2 + 30px);
311-
width: 36px;
312-
height: 36px;
311+
width: 32px;
312+
height: 32px;
313313
cursor: pointer;
314-
background: rgba(255, 255, 255, 0.95);
315-
border-radius: 18px;
314+
background: transparent;
315+
border-radius: 50%;
316316
display: flex;
317317
align-items: center;
318318
justify-content: center;
319-
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
320319
z-index: 1001;
321-
transition: all 0.3s ease;
322-
border: 1px solid rgba(0,0,0,0.08);
320+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
321+
border: none;
322+
outline: none;
323+
padding: 0;
324+
opacity: 0.6;
323325
}
324326

325-
.markdown-close::before,
326-
.markdown-close::after {
327+
.markdown-close::before {
327328
content: '';
328329
position: absolute;
329-
width: 18px;
330-
height: 2px;
331-
background: #666;
332-
border-radius: 1px;
333-
transition: background 0.3s;
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;
334346
}
335347

336-
.markdown-close::before {
337-
transform: rotate(45deg);
348+
.markdown-close:hover {
349+
opacity: 1;
338350
}
339351

340-
.markdown-close::after {
341-
transform: rotate(-45deg);
352+
.markdown-close:hover::before {
353+
transform: scale(1);
342354
}
343355

344-
.markdown-close:hover {
345-
background: #667eea;
346-
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
347-
transform: scale(1.1);
356+
.markdown-close:hover svg {
357+
stroke: #000;
358+
transform: rotate(90deg);
348359
}
349360

350-
.markdown-close:hover::before,
351-
.markdown-close:hover::after {
352-
background: white;
361+
.markdown-close:active {
362+
transform: scale(0.95);
353363
}
354364

355365
@media (max-width: 900px) {
356366
.markdown-close {
357367
right: 20px;
368+
top: 60px;
358369
}
359370
}
360371

@@ -654,7 +665,11 @@ <h2>📚 8 個學習場景</h2>
654665
<!-- Markdown Modal -->
655666
<div id="markdownModal" class="markdown-modal">
656667
<div class="markdown-content">
657-
<span class="markdown-close" onclick="closeMarkdown()"></span>
668+
<button class="markdown-close" onclick="closeMarkdown()" aria-label="關閉">
669+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
670+
<path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
671+
</svg>
672+
</button>
658673
<div id="markdownBody">
659674
<div class="markdown-loading">📡 載入中...</div>
660675
</div>

0 commit comments

Comments
 (0)