Files
xingque/components/global-notification/global-notification.wxss
2026-07-09 00:17:03 +08:00

238 lines
5.3 KiB
Plaintext

.global-notification {
position: fixed;
left: 24rpx;
right: 24rpx;
top: calc(env(safe-area-inset-top) + 108rpx);
z-index: 99999;
opacity: 0;
transform: translateY(-160%);
transition: all 0.42s cubic-bezier(0.34, 1.2, 0.64, 1);
pointer-events: none;
overflow: hidden;
border-radius: 28rpx;
background: linear-gradient(145deg,
rgba(28, 32, 42, 0.97) 0%,
rgba(22, 26, 36, 0.98) 100%);
backdrop-filter: blur(40rpx) saturate(180%);
-webkit-backdrop-filter: blur(40rpx) saturate(180%);
border: 1rpx solid rgba(255, 255, 255, 0.1);
box-shadow:
0 24rpx 64rpx rgba(0, 0, 0, 0.45),
0 0 0 1rpx rgba(255, 255, 255, 0.04),
inset 0 1rpx 0 rgba(255, 255, 255, 0.12);
min-height: 148rpx;
touch-action: pan-y;
}
.global-notification::before {
content: '';
position: absolute;
left: 0;
top: 24rpx;
bottom: 24rpx;
width: 6rpx;
border-radius: 0 6rpx 6rpx 0;
background: linear-gradient(180deg, #07c160 0%, #D4AF37 100%);
}
.global-notification.show {
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}
.notification-swipe-indicator {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4rpx;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
}
.swipe-line {
width: 40rpx;
height: 4rpx;
background: rgba(255, 255, 255, 0.3);
border-radius: 2rpx;
transition: all 0.3s;
}
.notification-swipe-indicator.active .swipe-line {
background: rgba(255, 255, 255, 0.6);
transform: scaleX(1.2);
}
.notification-content {
display: flex;
align-items: center;
padding: 28rpx 28rpx 28rpx 36rpx;
min-height: 148rpx;
position: relative;
}
.notification-avatar {
width: 88rpx;
height: 88rpx;
border-radius: 44rpx;
margin-right: 24rpx;
flex-shrink: 0;
border: 3rpx solid rgba(212, 175, 55, 0.6);
box-shadow:
0 8rpx 24rpx rgba(212, 175, 55, 0.2),
inset 0 1rpx 0 rgba(255, 255, 255, 0.3);
background-color: rgba(0, 0, 0, 0.2);
}
.notification-body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: center;
}
.notification-tag {
display: inline-block;
align-self: flex-start;
font-size: 20rpx;
color: #07c160;
background: rgba(7, 193, 96, 0.15);
padding: 4rpx 14rpx;
border-radius: 20rpx;
margin-bottom: 8rpx;
font-weight: 500;
}
.notification-title {
font-size: 34rpx;
font-weight: 600;
margin-bottom: 8rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background: linear-gradient(135deg, #D4AF37 0%, #FFD700 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
}
.notification-message {
font-size: 28rpx;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
color: rgba(255, 255, 255, 0.95);
text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.5);
}
.notification-time {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.5);
margin-top: 4rpx;
font-weight: 300;
}
.notification-actions {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-left: 20rpx;
gap: 16rpx;
}
.notification-close,
.notification-mute {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.08);
border: 1rpx solid rgba(255, 255, 255, 0.1);
transition: all 0.3s;
flex-shrink: 0;
box-shadow:
0 4rpx 12rpx rgba(0, 0, 0, 0.2),
inset 0 1rpx 0 rgba(255, 255, 255, 0.05);
}
.notification-close:active,
.notification-mute:active {
background: rgba(255, 255, 255, 0.15);
transform: scale(0.92);
}
.close-icon {
font-size: 32rpx;
font-weight: 300;
color: rgba(255, 255, 255, 0.9);
line-height: 1;
}
.mute-icon {
font-size: 28rpx;
line-height: 0;
color: rgba(255, 255, 255, 0.9);
}
.notification-mute.muted .mute-icon {
color: #D4AF37;
}
.notification-progress {
height: 6rpx;
background: rgba(255, 255, 255, 0.05);
overflow: hidden;
border-radius: 0 0 24rpx 24rpx;
}
.progress-bar {
height: 100%;
width: 100%;
background: linear-gradient(90deg,
#D4AF37 0%,
#FFD700 50%,
#D4AF37 100%);
background-size: 200% 100%;
transition: width 0.1s linear;
box-shadow: 0 0 20rpx rgba(212, 175, 55, 0.4);
animation: progressShine 2s linear infinite;
}
@keyframes progressShine {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.progress-bar.warning {
background: linear-gradient(90deg,
#ff3b30 0%,
#ff6b6b 50%,
#ff3b30 100%);
animation: progressShine 1s linear infinite;
}
.global-notification.swiping {
opacity: 0.7;
transform: translateY(calc(var(--swipe-distance, 0) * -1));
}
.global-notification.swiping-up {
opacity: 0.3;
transform: translateY(calc(var(--swipe-distance, 0) * -1));
}
.global-notification:active:not(.swiping) {
transform: scale(0.995) translateY(0);
transition: transform 0.1s;
}