Files
eryao/web/src/styles/animations.css
T
ZL-Q f695dd86e9 fix(web): 修复手动起卦教程、硬币动画与积分显示
- 修复硬币翻转动画:从 @keyframes 改为 CSS transition 实现双向动画
- 修复教程自动显示:将 setTutorialChecked 移入 setTimeout 回调,
  避免 useEffect cleanup 提前清除 timer 导致 setGuideStep 不执行
- 添加 AppShell UserSettingsContext 共享 userProfile
- 实现教程结束后调用 updateUserSettings 标记 manual_divination_shown
- 添加点击已确认爻进行编辑的功能 (editingIndex 状态)
- 确认爻后不再重置硬币状态
- 积分显示从硬编码改为读取 API 返回值
- 手机端教程使用 absolute 定位替代 fixed 避免滚动偏移
- 添加 isMobile 响应式状态追踪窗口大小变化
2026-05-09 23:35:53 +08:00

187 lines
5.3 KiB
CSS

@import "tailwindcss";
@keyframes fade-in-up {
from { opacity: 0; transform: translateY(24px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slide-in-left {
from { opacity: 0; transform: translateX(-40px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
from { opacity: 0; transform: translateX(40px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes scale-in {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
@keyframes glow-pulse {
0%, 100% { opacity: 0.12; }
50% { opacity: 0.2; }
}
@keyframes particle-drift {
0% { transform: translate(0, 0); }
25% { transform: translate(10px, -20px); }
50% { transform: translate(-5px, -40px); }
75% { transform: translate(15px, -20px); }
100% { transform: translate(0, 0); }
}
/* Reveal animations */
.reveal { opacity: 0; will-change: transform, opacity; }
.reveal.visible { animation: fade-in-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal-left { opacity: 0; will-change: transform, opacity; }
.reveal-left.visible { animation: slide-in-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal-right { opacity: 0; will-change: transform, opacity; }
.reveal-right.visible { animation: slide-in-right 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal-scale { opacity: 0; will-change: transform, opacity; }
.reveal-scale.visible { animation: scale-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal.visible.stagger-1 { animation-delay: 0.1s; }
.reveal.visible.stagger-2 { animation-delay: 0.2s; }
.reveal.visible.stagger-3 { animation-delay: 0.3s; }
.reveal.visible.stagger-4 { animation-delay: 0.4s; }
.reveal.visible.stagger-5 { animation-delay: 0.5s; }
.reveal.visible.stagger-6 { animation-delay: 0.6s; }
@media (max-width: 767px) {
.reveal, .reveal-left, .reveal-right, .reveal-scale {
opacity: 1;
transform: none;
animation: none;
}
}
/* Cyber gradient */
.cyber-gradient {
background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 50%, #C084FC 100%);
}
.cyber-glow {
box-shadow: 0 0 20px rgba(139, 92, 246, 0.35), 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* Purple glow backgrounds */
.glow-bg {
position: relative;
overflow: hidden;
}
.glow-bg::before {
content: '';
position: absolute;
top: -10%;
left: 50%;
transform: translateX(-50%);
width: 800px;
height: 600px;
border-radius: 50%;
background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
pointer-events: none;
animation: glow-pulse 6s ease-in-out infinite;
}
.glow-bg-wide::before {
width: 1200px;
height: 800px;
}
/* Floating particles (pure CSS) */
.particle {
position: absolute;
width: 4px;
height: 4px;
border-radius: 50%;
background: rgba(139, 92, 246, 0.4);
pointer-events: none;
}
.particle:nth-child(1) { top: 20%; left: 15%; animation: particle-drift 8s ease-in-out infinite; }
.particle:nth-child(2) { top: 40%; left: 75%; animation: particle-drift 12s ease-in-out infinite 1s; width: 3px; height: 3px; }
.particle:nth-child(3) { top: 60%; left: 30%; animation: particle-drift 10s ease-in-out infinite 2s; width: 5px; height: 5px; }
.particle:nth-child(4) { top: 30%; left: 55%; animation: particle-drift 9s ease-in-out infinite 3s; }
.particle:nth-child(5) { top: 70%; left: 85%; animation: particle-drift 11s ease-in-out infinite 4s; width: 3px; height: 3px; }
.particle:nth-child(6) { top: 50%; left: 10%; animation: particle-drift 7s ease-in-out infinite 5s; width: 2px; height: 2px; }
.particle:nth-child(7) { top: 15%; left: 65%; animation: particle-drift 13s ease-in-out infinite 2s; }
.particle:nth-child(8) { top: 80%; left: 45%; animation: particle-drift 8s ease-in-out infinite 6s; width: 3px; height: 3px; }
/* Connection lines between particles */
.particle-lines {
position: absolute;
inset: 0;
pointer-events: none;
background-image:
radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
radial-gradient(circle at 75% 40%, rgba(139, 92, 246, 0.04) 0%, transparent 35%),
radial-gradient(circle at 30% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 38%);
}
/* Hexagram lines */
.hex-yang {
width: 9rem;
height: 6px;
border-radius: 9999px;
background: linear-gradient(135deg, #8B5CF6, #C084FC);
}
.hex-yin {
display: flex;
align-items: center;
gap: 4px;
}
.hex-yin > div {
width: 3.5rem;
height: 6px;
border-radius: 9999px;
background: rgba(139, 92, 246, 0.4);
}
/* Coin flip animation */
.coin-flip {
transition: transform 0.3s ease-out;
transform-style: preserve-3d;
}
.coin-flip.flipped {
transform: rotateY(180deg);
}
/* Feature card hover */
.feature-card {
transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-card:hover {
transform: translateY(-4px);
border-color: rgba(139, 92, 246, 0.25);
box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1);
}
/* Smooth scroll */
html { scroll-behavior: smooth; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
.reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; animation: none; }
.particle { animation: none; }
.glow-bg::before { animation: none; }
html { scroll-behavior: auto; }
}