酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

<!DOCTYPE html> <html> <head> <style> :root { --main-red: #db1f1f; --fire-orange: #ff6b35; --gold: #ffd700; } body { background: linear-gradient(45deg, #1a1a1a 30%, #4a0000 100%); height: 100vh; display: flex; justify-content: center; align-items: center; margin: 0; overflow: hidden; } .poster-container { position: relative; width: 800px; height: 1200px; } /* 粒子特效 */ .particles { position: absolute; width: 100%; height: 100%; animation: rotate 60s linear infi

看起来你正在设计一个电影海报的网页,并且已经完成了一部分代码。你希望继续完成这个设计,特别是票房文字的部分。以下是一个可能的解决方案: ```html <!DOCTYPE html> <html> <head> <style> :root { --main-red: #db1f1f; --fire-orange: #ff6b35; --gold: #ffd700; } body { background: linear-gradient(45deg, #1a1a1a 30%, #4a0000 100%); height: 100vh; display: flex; justify-content: center; align-items: center; margin: 0; overflow: hidden; } .poster-container { position: relative; width: 800px; height: 1200px; } /* 粒子特效 */ .particles { position: absolute; width: 100%; height: 100%; animation: rotate 60s linear infinite; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .particle { position: absolute; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; opacity: 0.8; } /* 角色容器 */ .nezha { position: absolute; width: 60%; left: 20%; top: 15%; filter: drop-shadow(0 0 20px var(--main-red)); } /* 火焰特效 */ .fire-effect { position: absolute; width: 100%; height: 40%; bottom: 0; background: linear-gradient( to top, var(--main-red) 20%, var(--fire-orange) 50%, var(--gold) 80% ); mask-image: url(https://example.com/fire-mask.png); /* 需火焰遮罩图 */ mix-blend-mode: screen; } /* 票房文字 */ .box-office { position: absolute; bottom: 15%; width: 100%; text-align: center; font-family: 'Arial', sans-serif; font-size: 48px; color: var(--gold); text-shadow: 0 0 10px var(--main-red), 0 0 20px var(--fire-orange); animation: glow 2s infinite alternate; } @keyframes glow { from { text-shadow: 0 0 10px var(--main-red), 0 0 20px var(--fire-orange); } to { text-shadow: 0 0 20px var(--main-red), 0 0 40px var(--fire-orange); } } </style> </head> <body> <div class="poster-container"> <div class="particles"> <!-- 粒子特效 --> </div> <img src="https://example.com/nezha.png" alt="Nezha" class="nezha"> <div class="fire-effect"></div> <div class="box-office">票房:50亿</div> </div> </body> </html> ``` 代码解释: 1. 票房文字样式:`.box-office` 类用于设置票房文字的样式。文字居中显示,使用金色字体,并添加了红色和橙色的发光效果。 2. 发光动画:通过 `@keyframes glow` 定义了一个简单的发光动画,使文字在红色和橙色之间交替发光。 3. 粒子特效:`.particles` 和 `.particle` 类用于创建粒子特效,粒子会围绕中心旋转。 需要注意的逻辑点: 1. 火焰遮罩图:`mask-image` 属性需要一个火焰遮罩图的URL,确保你有一个合适的图片资源。 2. 粒子特效:粒子特效的生成可能需要使用JavaScript来动态创建粒子,当前代码中粒子特效部分为空。 3. 浏览器兼容性:`mix-blend-mode` 和 `mask-image` 属性在某些旧版浏览器中可能不支持,确保目标用户的浏览器兼容性。 [2025-02-24 14:16:00 | AI写代码神器 | 902点数解答]

相关提问