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>3D发光粒子城市</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
overflow: hidden;
background: #000;
font-family: 'Arial', sans-serif;
}
#canvas-container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
}
#info {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
color: #0ff;
font-size: 14px;
text-align: center;
z-index: 100;
text-shadow: 0 0 10px #0ff;
pointer-events: none;
}
#stats {
position: fixed;
bottom: 20px;
left: 20px;
color: #0f0;
font-size: 12px;
z-index: 100;
text-shadow: 0 0 5px #0f0;
}
#controls {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 100;
display: flex;
flex-direction: column;
gap: 10px;
}
.btn {
padding: 10px 20px;
background: rgba(0, 255, 255, 0.1);
border: 1px solid #0ff;
color: #0ff;
cursor: pointer;
font-size: 12px;
transition: all 0.3s;
text-transform: uppercase;
}
.btn:hover {
background: rgba(0, 255, 255, 0.3);
box-shadow: 0 0 20px #0ff;
}
#loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
transition: opacity 0.5s;
}
#loading.hidden {
opacity: 0;
pointer-events: none;
}
.loader {
width: 50px;
height: 50px;
border: 3px solid #0ff;
border-top-color: transparent;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div id="loading">
<div class="loader"></di.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0