Files
youlegames/games/minipro/calculation/miniprogram/pages/random-draw/random-draw.wxss

236 lines
4.5 KiB
Plaintext

page {
background: linear-gradient(180deg, #fce4ec 0%, #f3e5f5 100%);
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.container {
display: flex;
flex-direction: column;
height: 100vh;
padding: 20px;
box-sizing: border-box;
}
.header-tip {
text-align: center;
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 {
display: flex;
margin-bottom: 20px;
background: #fff;
border-radius: 50px;
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: 44px;
padding: 0 20px;
font-size: 16px;
color: #333;
}
.btn-add {
min-width: 80px;
height: 44px;
line-height: 44px;
text-align: center;
background: linear-gradient(135deg, #ec407a, #d81b60);
color: #fff;
border-radius: 40px;
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;
overflow: hidden;
}
.name-list {
display: flex;
flex-wrap: wrap;
align-content: flex-start; /* 防止换行后拉伸 */
gap: 10px;
padding-bottom: 10px;
}
.name-item {
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: 18px; /* 给关闭按钮留空间 */
}
.btn-delete {
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%;
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 {
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 20px;
}
.result-box {
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(0.98);
background: #fff8e1;
}
.result-label {
font-size: 13px;
color: #999;
margin-bottom: 5px;
text-transform: uppercase;
letter-spacing: 1px;
}
.result-text {
font-size: 32px;
font-weight: 800;
color: #333;
/* Prevent long names from overflowing */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-start {
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.6;
background: #9e9e9e;
box-shadow: none;
transform: none;
}