UI优化:美化顶部按钮为圆形图标,添加交互功能

This commit is contained in:
Coldin04 2026-01-23 15:22:46 +08:00
parent 5b79d2179f
commit 359dc1a7da
2 changed files with 67 additions and 16 deletions

View file

@ -10,12 +10,23 @@
<header class="top-bar"> <header class="top-bar">
<div class="top-bar__brand"> <div class="top-bar__brand">
<img src="src/avatar_48.png" alt="Logo" class="top-bar__logo"> <img src="src/avatar_48.png" alt="Logo" class="top-bar__logo">
<span>Coldin04 WorkSpace</span> <span>Coldin04 的工作台</span>
</div> </div>
<div class="top-bar__actions"> <div class="top-bar__actions">
<button class="top-bar__button">主页</button> <button class="top-bar__button" onclick="window.location.href='https://cold04.com'">
<button class="top-bar__button">退出</button> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg>
</button>
<button class="top-bar__button" onclick="alert('你已退出登录(个鬼)')">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line>
</svg>
</button>
</div> </div>
</header> </header>
@ -73,7 +84,7 @@
</li> </li>
<li class="task-item"> <li class="task-item">
<input type="checkbox" id="task2"> <input type="checkbox" id="task2">
<label for="task2" class="task-content">完善个人主页样式</label> <label for="task2" class="task-content">记得启动原神</label>
</li> </li>
<li class="task-item"> <li class="task-item">
<input type="checkbox" id="task3"> <input type="checkbox" id="task3">
@ -81,7 +92,7 @@
</li> </li>
<li class="task-item"> <li class="task-item">
<input type="checkbox" id="task4"> <input type="checkbox" id="task4">
<label for="task4" class="task-content">优化移动端体验</label> <label for="task4" class="task-content">Home可以点</label>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -55,20 +55,27 @@ body {
} }
.top-bar__button { .top-bar__button {
padding: 8px 16px; width: 40px;
border: 1px solid rgba(0, 0, 0, 0.1); height: 40px;
border-radius: 8px; padding: 0;
background-color: rgba(255, 255, 255, 0.5); border: none;
backdrop-filter: blur(5px); border-radius: 50%;
background-color: transparent;
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
transition: var(--transition); transition: var(--transition);
display: flex;
align-items: center;
justify-content: center;
color: #333;
}
.top-bar__button span {
display: none;
} }
.top-bar__button:hover { .top-bar__button:hover {
background-color: rgba(255, 255, 255, 0.8); background-color: rgba(0, 0, 0, 0.05);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} }
.top-bar__button:active { .top-bar__button:active {
@ -386,11 +393,44 @@ body {
} }
.task-item input[type="checkbox"] { .task-item input[type="checkbox"] {
width: 18px; appearance: none;
height: 18px; -webkit-appearance: none;
width: 20px;
height: 20px;
border: 2px solid #c7c7cc;
border-radius: 50%; /* 圆形复选框 */
margin: 0; margin: 0;
accent-color: #0071e3; outline: none;
cursor: pointer; cursor: pointer;
position: relative;
transition: all 0.2s ease;
flex-shrink: 0;
}
.task-item input[type="checkbox"]:checked {
background-color: #0071e3;
border-color: #0071e3;
}
.task-item input[type="checkbox"]:checked::after {
content: '';
position: absolute;
top: 45%;
left: 50%;
width: 9px;
height: 5px;
border-left: 2px solid white;
border-bottom: 2px solid white;
transform: translate(-50%, -50%) rotate(-45deg);
}
.task-item input[type="checkbox"]:hover {
border-color: #0071e3;
background-color: rgba(0, 113, 227, 0.05);
}
.task-item input[type="checkbox"]:checked:hover {
background-color: #0077ed;
} }
.task-content { .task-content {