.card1{ width: 100%; height: 100vh; position: relative; overflow: hidden; } .cards-container { width: 100%; height: 100vh; display: flex; max-width: 500px; margin: 0 auto; position: relative; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; } .animation-wrapper { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 80; } .message-container { width: 100%; max-width: 400px; } /* 动画卡片样式 */ .animate-card { background: #ffffff; /*position: absolute;*/ border-radius: 10px; padding: 25px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); width: 380px; box-sizing: border-box; transform-origin: center center; transition: all 0.5s ease; animation-delay: 3s; animation-duration: 1.5s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); animation-fill-mode: forwards; /*left: 50%;*/ /*top: -50%;*/ /*transform: translate(-50%, -50%);*/ z-index: 81; cursor: pointer; } .animate-card .fake-content { width: 100%; height: 280px; background: #f7f9fc; border-radius: 8px; padding: 20px; box-sizing: border-box; border: 1px solid rgba(226, 232, 240, 0.8); } .animate-card .fake-image { width: 80px; height: 80px; background: #edf2f7; border-radius: 50%; margin-bottom: 20px; /*border: 1px solid rgba(226, 232, 240, 0.8);*/ } .animate-card .fake-image img{ border-radius: 50%; border: 1px solid rgba(226, 232, 240, 0.8); } .animate-card .fake-title { background: #edf2f7; padding: 0 10px; width: 85%; margin-bottom: 20px; border-radius: 4px; border: 1px solid rgba(226, 232, 240, 0.8); } .animate-card .fake-line { padding: 0 10px; background: #edf2f7; margin-bottom: 12px; border-radius: 3px; border: 1px solid rgba(226, 232, 240, 0.8); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; } .animate-card .fake-line:nth-child(1) { width: 100%; } .animate-card .fake-line:nth-child(2) { width: 85%; } /*.animate-card .fake-line:nth-child(3) { width: 70%;height: 16px }*/ .animate-card.animated { cursor: pointer; } .animate-card.animated:hover { transform: scale(1.2) !important; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15); z-index: 89; } .animate-card.stacked { position: absolute; top: 100%; left: 50%; transform: translate(-50%, -50%) rotate(0) scale(0.95); opacity: 0.8; transition: all 0.3s ease; } /* 修改动画结束后的样式 */ .animation-ended { position: fixed; opacity: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background: white; border-radius: 10px; width: 200px; pointer-events: none; transition: all 0.5s ease; } .animation-ended .fake-content { transform: scale(1); } /* 移动端适配 */ @media screen and (max-width: 768px) { .animation-wrapper { display: none; /* 隐藏动画卡片容器 */ } .card { width: 100%; padding: 0; } .cards-container { max-width: 100%; padding: 10px; margin: 0; width: 100%; box-sizing: border-box; } .final-card { opacity: 1; animation: mobileCardEnter 0.6s ease-out; width: 100%; padding: 0; } .final-card .message-card { max-width: 100%; margin: 0; padding: 15px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); box-sizing: border-box; } .final-card .avatar img { max-height: 30vh; width: 100%; object-fit: cover; margin-bottom: 12px; animation: contentFadeIn 0.8s ease-out; animation-fill-mode: both; } .final-card .message-header { font-size: 1.1em; padding: 12px 0; margin-bottom: 15px; animation: contentFadeIn 0.8s ease-out 0.2s; animation-fill-mode: both; } .final-card .message-questions { padding: 15px; margin: 12px 0; background: #f8faff; border-radius: 8px; animation: contentFadeIn 0.8s ease-out 0.4s; animation-fill-mode: both; } .final-card .message-footer { padding: 12px; margin-top: 20px; background: linear-gradient(to right, #f8faff, #fff, #f8faff); border-radius: 8px; animation: contentFadeIn 0.8s ease-out 0.6s; animation-fill-mode: both; } /* 移除PC端的动画延迟 */ .final-card { animation-delay: 0s !important; } } /* 移动端的卡片动画 */ @keyframes mobileCardEnter { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } } @keyframes contentFadeIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } } /* 最终显示的卡片 */ .final-card { opacity: 0; transform: scale(0.8); animation: showFinalCard 0.5s ease forwards; animation-delay: 2s; position: relative; z-index: 81; /* 确保最终卡片在最上层 */ } .final-card .message-card { background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); padding: 25px; border-radius: 10px; position: relative; /* z-index: 1000; */ text-align: center; transition: all 0.3s ease; } .final-card .message-card:hover { transform: scale(1.02); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); } @media (hover: hover) { .final-card .message-card:hover { transform: scale(1.02); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); } } @media (hover: none) { .final-card .message-card:hover { transform: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); } } .final-card .avatar img { width: 60px; height: 60px; border-radius: 50%; margin-right: 15px; transition: transform 0.3s ease; } .final-card .message-header { color: var(--text-color); font-size: 1.2em; padding: 15px 0; border-bottom: 2px solid #e1e8f5; margin-bottom: 20px; text-align: center; } .final-card .message-questions { background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 100%); padding: 20px; border-radius: 12px; margin: 15px 0; text-align: center; } .final-card .message-questions p { color: var(--text-color); margin: 12px 0; font-size: 1em; transition: transform 0.2s ease; cursor: pointer; text-align: center; } .final-card .message-footer { background: linear-gradient(to right, #f5f8ff, #ffffff, #f5f8ff); padding: 15px; border-radius: 10px; margin-top: 25px; text-align: center; } .final-card .dots { background: linear-gradient(45deg, #3498db, #2980b9); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: 3px; text-align: center; } .final-card .emoji { font-size: 1.2em; display: inline-block; transition: transform 0.3s ease; } .final-card:hover .emoji { transform: scale(1.2); } .final-card .footer-text { color: var(--text-color); font-size: 0.9em; margin-top: 8px; text-align: center; } /* 悬停效果增强 */ .final-card:hover .message-card { transform: translateY(-15px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.06); } .final-card:hover .avatar img { transform: scale(1.05); } /* 不同卡片的初始位置和动画 */ .card-1 { animation: flyFromLeft 1.5s ease forwards; } .card-2 { animation: flyFromRight 1.5s ease forwards; animation-delay: 0.2s; } .card-3 { animation: flyFromTop 1.5s ease forwards; animation-delay: 0.4s; } .card-4 { animation: flyFromBottom 1.5s ease forwards; animation-delay: 0.6s; } .card-5 { animation: flyFromTopLeft 1.5s ease forwards; animation-delay: 0.8s; } .card-6 { animation: flyFromTopRight 1.5s ease forwards; animation-delay: 1s; } .card-7 { animation: flyFromBottomLeft 1.5s ease forwards; animation-delay: 1.2s; } .card-8 { animation: flyFromBottomRight 1.5s ease forwards; animation-delay: 1.4s; } .card-9 { animation: flyFromTopLeft 1.5s ease forwards; animation-delay: 1.6s; } .card-10 { animation: flyFromBottomRight 1.5s ease forwards; animation-delay: 1.8s; } /* 飞入动画 */ @keyframes flyFromTopLeft { 0% { opacity: 0; transform: translate(-100vw, -100vh) rotate(-45deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromTopRight { 0% { opacity: 0; transform: translate(100vw, -100vh) rotate(45deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromBottomLeft { 0% { opacity: 0; transform: translate(-100vw, 100vh) rotate(45deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromBottomRight { 0% { opacity: 0; transform: translate(100vw, 100vh) rotate(-45deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromLeft { 0% { opacity: 0; transform: translate(-100vw, 0) rotate(-15deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromRight { 0% { opacity: 0; transform: translate(100vw, 0) rotate(15deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromTop { 0% { opacity: 0; transform: translate(0, -100vh) rotate(-15deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } @keyframes flyFromBottom { 0% { opacity: 0; transform: translate(0, 100vh) rotate(15deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } } /* 动画关键帧 */ @keyframes showFinalCard { 0% { opacity: 0; transform: scale(0.8) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } } /* 移动端适配基础设置 */ @media screen and (max-width: 768px) { .cards-container { max-width: 100%; padding: 15px; height: 100vh; max-height: none; /*position: fixed;*/ /*top: 0;*/ /*left: 0;*/ transform: none; width: 100%; } /* 调整最终卡片样式 */ .message-container.final-card { margin: 10px; width: calc(100% - 10px); /* 减去左右外边距 */ } .final-card .message-card { padding: 15px; max-height: calc(100vh - 100px); /* 调整最大高度,考虑外边距 */ width: 100%; margin: 0 auto; } /* 调整卡片内容的间距 */ .final-card .avatar { margin: -15px -15px 15px -15px; /* 让图片充满卡片宽度 */ } .final-card .avatar img { max-height: 30vh; border-radius: 10px 10px 0 0; /* 只保留上方圆角 */ } .final-card .message-content { padding: 0 5px; /* 内容区域添加小边距 */ } .final-card .avatar img { max-height: 30vh; } .final-card .message-header { font-size: 1.1em; padding: 12px 0; } .final-card .message-questions { padding: 15px; margin: 12px 0; } .final-card .message-questions p { margin: 10px 0; font-size: 0.95em; } .final-card .message-footer { padding: 12px; margin-top: 20px; } /* 调整动画卡片尺寸 */ .animate-card { width: calc(100% - 40px); padding: 20px; } .animate-card .fake-content { height: 240px; padding: 15px; } .animate-card .fake-image { width: 60px; height: 60px; margin-bottom: 15px; } .animate-card .fake-title { height: 20px; padding: 5px 10px; margin-bottom: 15px; } .animate-card .fake-line { height: 14px; margin-bottom: 10px; } /* .animate-card:hover{ z-index: 1000!important; cursor: pointer!important; } */ /* 调整动画距离,避免在小屏幕上飞得太远 */ @keyframes flyFromLeft { 0% { opacity: 1; transform: translate(calc(-50vw - 50%), -50%) rotate(-20deg); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(30px - 50%), -50%) rotate(10deg); } } @keyframes flyFromRight { 0% { opacity: 1; transform: translate(calc(50vw - 50%), -50%) rotate(20deg); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(-30px - 50%), -50%) rotate(-10deg); } } @keyframes flyFromTop { 0% { opacity: 1; transform: translate(-50%, calc(-50vh - 50%)) rotate(-20deg); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(-50%, calc(30px - 50%)) rotate(10deg); } } @keyframes flyFromBottom { 0% { opacity: 1; transform: translate(-50%, calc(50vh - 50%)) rotate(20deg); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(-50%, calc(-30px - 50%)) rotate(-10deg); } } /* 对角线动画也需要调整 */ @keyframes flyFromTopLeft { 0% { opacity: 1; transform: translate(calc(-50vw - 50%), calc(-50vh - 50%)) rotate(-45deg); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(20px - 50%), calc(20px - 50%)) rotate(15deg); } } /* 其他对角线动画也类似调整... */ /* 调整悬停效果 */ .final-card:hover .message-card { transform: translateY(-10px); } .message-container:hover .message-card { transform: translateY(-10px); } } /* 移动端样式 */ @media screen and (max-width: 768px) { .final-card{ z-index: 1; } .final-card .message-card { background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%); } .final-card .message-questions { background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 100%); } .final-card .message-header { color: var(--text-color); } .final-card .message-questions p { color:var(--text-color); } .final-card .message-footer { background: linear-gradient(to right, #f5f8ff, #ffffff, #f5f8ff); } .final-card .avatar{ margin-top: 10px; } } /* 特小屏幕的额外调整 */ @media screen and (max-width: 320px) { .message-container.final-card { margin: 5px; /* 更小的外边距 */ width: calc(100% - 30px); } } [data-theme="dark"] .message-card{ background:#0d0d0d !important; border: 1px solid #f5f8ff; color: #f5f8ff !important; } [data-theme="dark"] .message-questions{ background:#0d0d0d !important; color: #f5f8ff !important; } [data-theme="dark"] .message-footer{ background:#0d0d0d !important; color: #f5f8ff !important; } [data-theme="dark"] .message-header{ color: #ffffff; } [data-theme="dark"] .fake-title,.fake-lines{ color: #0d0d0d; } [data-theme="dark"] .fake-content{ background: #0d0d0d!important; }