three实现三维滚动式生日蛋糕贺卡显示代码
代码语言:html
所属分类:三维
代码描述:three实现三维滚动式生日蛋糕贺卡显示代码
代码标签: three 三维 滚动式 生日 蛋糕 贺卡 显示 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; padding: 0; font-family: "Arial", sans-serif; background: linear-gradient(135deg, #f4f4f4, #580000); color: #333; overflow-x: hidden; overflow-y: scroll; min-height: 200vh; } #container { position: relative; width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; } #cake-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; cursor: pointer; transition: all 1.5s ease-in-out; } #instructions { position: fixed; bottom: 10%; left: 50%; transform: translateX(-50%); font-size: 24px; color: #fff; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.2); padding: 10px 20px; border-radius: 10px; animation: pulse 2s infinite; z-index: 100; text-align: center; } @keyframes pulse { 0% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } } #scroll-instruction { position: fixed; bottom: 10%; left: 50%; transform: translateX(-50%); font-size: 24px; color: #fff; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.2); padding: 10px 20px; border-radius: 10px; display: none; animation: pulse 2s infinite; z-index: 100; } #letter { position: fixed; width: 40%; right: -100%; top: 50%; transform: translateY(-50%) rotate(3deg); background-color: white; padding: 40px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); transition: all 1s ease-in-out; max-height: 70vh; overflow-y: auto; z-index: 50; } #letter h1 { color: #580000; text-align: center; } #letter p { line-height: 1.6; } #confetti-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; d.........完整代码请登录后点击上方下载按钮下载查看
网友评论0