温馨提示:本站为童趣票务官方授权演出订票中心,请放心购买。
你现在的位置:首页 > 演出资讯  > 儿童亲子

使用Trae做一个简单的天狗食日动画效果试试

发布时间:2025-09-13 12:19:22  浏览量:1

#技术分享天狗食日 CSS 动画.sky { position: relative; width: 100vw; height: 100vh; background: linear-gradient(to bottom, #1a2980, #26d0ce); overflow: hidden; display: flex; justify-content: center; align-items: center; } .sun { width: 150px; height: 150px; background: radial-gradient(circle, #FFD700, #FF8C00); border-radius: 50%; box-shadow: 0 0 50px #FF4500, 0 0 100px rgba(255, 215, 0, 0.5); position: relative; z-index: 2; } .moon { width: 150px; height: 150px; background: #000; border-radius: 50%; position: absolute; z-index: 3; animation: eclipse 8s ease-in-out infinite; filter: blur(1px); } .flare { position: absolute; width: 200px; height: 200px; background: radial-gradient(circle, transparent 60%, rgba(255, 69, 0, 0.3) 90%); border-radius: 50%; animation: pulse 3s ease-in-out infinite; z-index: 1; } @keyframes eclipse { 0% { transform: translateX(-200px); } 50% { transform: translateX(0); } 100% { transform: translateX(200px); } } @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.2); opacity: 0.9; } } .stars { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; animation: stars-appear 8s infinite; } @keyframes stars-appear { 45%, 55% { opacity: 0.8; } 0%, 40%, 60%, 100% { opacity: 0; } } document.addEventListener('DOMContentLoaded', => { const stars = document.querySelector('.stars'); for (let i = 0; i