three实现三维雪人下雪水晶球代码
代码语言:html
所属分类:三维
代码描述: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>水晶雪球</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
overflow: hidden;
background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
font-family: 'Microsoft YaHei', sans-serif;
}
canvas { display: block; }
#title {
position: absolute;
top: 30px;
left: 50%;
transform: translateX(-50%);
color: #fff;
font-size: 36px;
text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(100,150,255,0.3);
letter-spacing: 8px;
pointer-events: none;
}
#controls {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 15px;
z-index: 100;
}
.btn {
background: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.3);
color: white;
padding: 12px 25px;
border-radius: 25px;
cursor: pointer;
font-size: 14px;
backdrop-filter: blur(10px);
transition: all 0.3s;
}
.btn:hover {
background: rgba(255,255,255,0.2);
box-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.btn.active {
background: rgba(100,150,255,0.4);
border-color: rgba(100,150,255,0.8);
}
#info {
position: absolute;
top: 90px;
left: 50%;
transform: translateX(-50%);
color: rgba(255,255,255,0.6);
font-size: 14px;
pointer-events: none;
}
#snow-control {
position: absolute;
top: 30px;
right: 30px;
background: rgba(255,255,255,0.1);
padding: 20px;
border-radius: 15px;
border: 1px solid rgba(255,255,255,0.2);
backdrop-filter: blur(10px);
}
#snow-control label {
color: white;
font-size: 14px;
display: block;
margin-bottom: 10px;
}
#snow-control input[type="range"] {
width: 150px;
cursor: pointer;
}
#loading {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 1000;
transition: opacity 1s;
}
#loading h1 {
color: white;
font-size: 32px;
margin-bottom: 30px;
text-shadow: 0 0 20px rgba(255,255,255,0.5);
}
.snowflake-loader {
font-size: 40px;
animation: fall 1.5s ease-in-out infinite;
}
@keyframes fall {
0%, 100% { transform: translateY(-10px) rotate(0deg); opacity: 0.5; }
50% .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0