three实现三维抽签看运势摇签求福交互效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维抽签看运势摇签求福交互效果代码
代码标签: three 三维 抽签 看运势 摇签 求福 交互
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🎋 2026蛇年吉祥签 - 新年抽签</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
overflow: hidden;
background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
user-select: none;
}
canvas { display: block; }
#ui {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 20px;
}
#title {
font-size: 36px;
color: #ffd700;
text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,100,100,0.5);
text-align: center;
animation: glow 2s ease-in-out infinite alternate;
}
@keyframes glow {
from { text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,100,100,0.5); }
to { text-shadow: 0 0 40px rgba(255,215,0,1), 0 0 80px rgba(255,100,100,0.8); }
}
#subtitle {
font-size: 18px;
color: rgba(255,255,255,0.8);
margin-top: 10px;
}
#drawBtn {
pointer-events: auto;
padding: 20px 60px;
font-size: 28px;
background: linear-gradient(45deg, #c41e3a, #ff6b6b, #c41e3a);
background-size: 200% 200%;
animation: gradientMove 3s ease infinite;
color: white;
border: 3px solid rgba(255,215,0,0.5);
border-radius: 50px;
cursor: pointer;
box-shadow: 0 0 30px rgba(196,30,58,0.6), 0 0 60px rgba(255,107,107,0.3);
transition: all 0.3s;
margin-bottom: 40px;
}
@keyframes gradientMove {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
#drawBtn:hover {
transform: scale(1.1);
box-shadow: 0 0 50px rgba(196,30,58,0.9), 0 0 100px rgba(255,107,107,0.5);
}
#drawBtn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
#result {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0);
background: linear-gradient(145deg, #8b0000, #b22222, #8b0000);
border: 8px solid #ffd700;
border-radius: 20px;
padding: 40px 60px;
text-align: center;
box-shadow: 0 0 50px rgba(255,215,0,0.5), 0 0 100px rgba(139,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.3);
z-index: 1000;
transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
max-width: 90%;
pointer-events: auto;
}
#result.show {
transform: translate(-50%, -50%) scale(1);
}
#result .fortune-type {
font-size: 48px;
color: #ffd700;
text-shadow: 0 0 20px rgba(255,215,0,0.8);
margin-bottom: 15px;
}
#result .fortune-title {
font-size: 32px;
color: #fff;
margin-bottom: 20px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
#result .fortune-poem {
font-size: 20px;
color: #ffe4b5;
line-height: 1.8;
margin-bottom: 20px;
font-style: italic;
}
#result .fortune-detail {
font-size: 16px;
color: rgba(255,255,255,0.9);
line-height: 1.6;
text-align: left;
background: rgba(0,0,0,0.2);
padding: 15px 20px;
border-radius: 10px;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0