Optimize UI for unit converter and random draw, remove relative calculator page

This commit is contained in:
2026-02-04 19:56:35 +08:00
parent 8c677908d7
commit 32cdaf44cc
11 changed files with 352 additions and 410 deletions

View File

@@ -1,6 +1,7 @@
page {
background-color: #f6f7f9;
background: linear-gradient(180deg, #fce4ec 0%, #f3e5f5 100%);
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.container {
@@ -13,9 +14,20 @@ page {
.header-tip {
text-align: center;
margin-bottom: 20px;
color: #666;
margin-bottom: 24px;
}
.title {
font-size: 24px;
font-weight: bold;
color: #880e4f;
margin-bottom: 4px;
}
.subtitle {
font-size: 14px;
color: #ad1457;
opacity: 0.7;
}
.input-area {
@@ -23,133 +35,201 @@ page {
margin-bottom: 20px;
background: #fff;
border-radius: 50px;
padding: 5px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
padding: 6px;
box-shadow: 0 4px 12px rgba(173, 20, 87, 0.1);
border: 2px solid rgba(255,255,255,0.5);
}
.input {
flex: 1;
height: 40px;
height: 44px;
padding: 0 20px;
font-size: 16px;
color: #333;
}
.btn-add {
width: 80px;
height: 40px;
line-height: 40px;
min-width: 80px;
height: 44px;
line-height: 44px;
text-align: center;
background: #9c27b0;
background: linear-gradient(135deg, #ec407a, #d81b60);
color: #fff;
border-radius: 40px;
font-size: 14px;
font-size: 15px;
font-weight: bold;
box-shadow: 0 4px 8px rgba(216, 27, 96, 0.3);
transition: opacity 0.2s;
}
.btn-add:active {
opacity: 0.8;
}
.list-container {
flex: 1;
display: flex;
flex-direction: column;
background: rgba(255, 255, 255, 0.6);
border-radius: 20px;
padding: 15px 15px 5px 15px; /* bottom padding smaller because scrollview */
margin-bottom: 20px;
backdrop-filter: blur(10px);
min-height: 0; /* Important for flex child to scroll */
}
.list-header {
font-size: 14px;
color: #888;
margin-bottom: 10px;
padding-left: 5px;
}
.list-area {
flex: 1;
background: #fff;
border-radius: 12px;
padding: 10px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
overflow: hidden;
flex: 1;
overflow: hidden;
}
.name-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 10px;
display: flex;
flex-wrap: wrap;
align-content: flex-start; /* 防止换行后拉伸 */
gap: 10px;
padding-bottom: 10px;
}
.name-item {
background: #f3e5f5;
color: #4a148c;
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
display: flex;
align-items: center;
position: relative;
padding: 8px 16px 8px 12px;
border-radius: 20px;
font-size: 14px;
display: flex;
align-items: center;
position: relative;
font-weight: 500;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
from { transform: scale(0.8); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
/* 伪随机颜色,根据 .color-0 到 .color-4 */
.color-0 { background: #e3f2fd; color: #1565c0; }
.color-1 { background: #e8f5e9; color: #2e7d32; }
.color-2 { background: #fff3e0; color: #ef6c00; }
.color-3 { background: #f3e5f5; color: #7b1fa2; }
.color-4 { background: #ffebee; color: #c62828; }
.name-text {
margin-right: 15px;
margin-right: 18px; /* 给关闭按钮留空间 */
}
.btn-delete {
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
border-radius: 50%;
background: rgba(0,0,0,0.1);
color: #4a148c;
font-size: 16px;
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
border-radius: 50%;
background: rgba(0,0,0,0.08);
font-size: 16px;
font-weight: normal;
}
.btn-delete:active {
background: rgba(0,0,0,0.2);
}
.color-0 .btn-delete { color: #1565c0; }
.color-1 .btn-delete { color: #2e7d32; }
.color-2 .btn-delete { color: #ef6c00; }
.color-3 .btn-delete { color: #7b1fa2; }
.color-4 .btn-delete { color: #c62828; }
.empty-tip {
width: 100%;
text-align: center;
color: #999;
padding-top: 50px;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
color: #999;
padding-top: 40px;
}
.empty-icon {
font-size: 40px;
margin-bottom: 10px;
opacity: 0.5;
}
.result-area {
height: 200px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 20px;
}
.result-box {
width: 120px;
height: 120px;
border-radius: 50%;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
border: 5px solid #e1bee7;
box-shadow: 0 4px 15px rgba(156, 39, 176, 0.2);
transition: all 0.1s;
width: 100%;
background: #fff;
border-radius: 20px;
padding: 20px;
text-align: center;
margin-bottom: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
display: flex;
flex-direction: column;
justify-content: center;
min-height: 120px;
transition: transform 0.1s;
}
.result-box.rolling {
transform: scale(1.1);
border-color: #9c27b0;
transform: scale(0.98);
background: #fff8e1;
}
.result-label {
font-size: 13px;
color: #999;
margin-bottom: 5px;
text-transform: uppercase;
letter-spacing: 1px;
}
.result-text {
font-size: 24px;
font-weight: bold;
color: #333;
/* Prevent long names from overflowing */
max-width: 90%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 32px;
font-weight: 800;
color: #333;
/* Prevent long names from overflowing */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-start {
width: 80% !important;
background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
color: #fff;
border-radius: 30px;
padding: 12px 0;
font-size: 18px;
box-shadow: 0 4px 15px rgba(142, 36, 170, 0.4);
width: 100% !important;
background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
color: #fff;
border-radius: 50px;
padding: 14px 0;
font-size: 18px;
font-weight: bold;
box-shadow: 0 8px 20px rgba(74, 20, 140, 0.4);
transition: all 0.2s;
}
.btn-start-hover {
transform: translateY(2px);
box-shadow: 0 4px 10px rgba(74, 20, 140, 0.3);
}
.btn-start[disabled] {
opacity: 0.7;
background: #ccc;
box-shadow: none;
opacity: 0.6;
background: #9e9e9e;
box-shadow: none;
transform: none;
}