three实现简洁的三维个人SOHO工作室作品展示场景鼠标滚动丝滑切换视角代码
代码语言:html
所属分类:三维
代码描述:three实现简洁的三维个人SOHO工作室作品展示场景鼠标滚动丝滑切换视角代码
代码标签: three 简洁 三维 个人 SOHO 工作室 作品 展示 场景 鼠标 滚动 丝滑 切换 视角 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SOHO 创意工作室</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', 'PingFang SC', sans-serif;
overflow-x: hidden;
background: #1a1a2e;
}
#canvas-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
z-index: 1;
}
.scroll-container {
height: 400vh;
position: relative;
z-index: 2;
pointer-events: none;
}
/* 右侧导航点 */
.nav-dots {
position: fixed;
right: 30px;
top: 50%;
transform: translateY(-50%);
z-index: 100;
display: flex;
flex-direction: column;
gap: 20px;
}
.nav-dot {
width: 14px;
height: 14px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.6);
cursor: pointer;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}
.nav-dot:hover {
background: rgba(255, 255, 255, 0.5);
transform: scale(1.2);
}
.nav-dot.active {
background: #fff;
box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
transform: scale(1.3);
}
.nav-dot .tooltip {
position: absolute;
right: 30px;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 8px 16px;
border-radius: 6px;
font-size: 14px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s, transform 0.3s;
}
.nav-dot:hover .tooltip {
opacity: 1;
transform: translateY(-50%) translateX(-5px);
}
/* 场景标题 */
.scene-title {
position: fixed;
left: 40px;
bottom: 40px;
z-index: 100;
color: white;
transition: all 0.5s;
}
.scene-title h2 {
font-size: 32px;
font-weight: 300;
margin-bottom: 8px;
text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.scene-title p {
font-size: 16px;
opacity: 0.8;
text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}
/* 滚动提示 */
.scroll-hint {
position: fixed;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
z-index: 100;
color: white;
text-align: center;
transition: opacity 0.5s;
}
.scroll-hint .mouse {
width: 26px;
height: 40px;
border: 2px solid rgba(255,255,255,0.8);
border-radius: 13px;
margin: 0 auto 10px;
position: relative;
}
.scroll-hint .wheel {
width: 4px;
height: 8px;
background: white;
border-radius: 2px;
position: absolute;
left: 50%;
top: 8px;
transform: translateX(-50%);
animation: scroll-wheel 2s infinite;
}
@keyframes scroll-wheel {
0%, 100% { opacity: 1; top: 8px; }
50% { opacity: 0.3; top: 18px; }
}
.scroll-hint span {
font-size: 13px;
opacity: 0.8;
letter-spacing: 2px;
}
/* 进度条 */
.progress-bar {
position: fixed;
top: 0;
left: 0;
height: 3px;
background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
z-index: 100;
transition: width 0.1s;
}
/* 信息面板 */
.info-panel {
position: fixed;
top: 30px;
left: 30px;
background: rgba(255, 255, 255, 0.95);
padding: 20px 25px;
border-radius: 12px;
z-index: 100;
box-shadow: 0 10px 40px rgba(0,0,0,0.1);
max-width: 280px;
}
.info-panel h1 {
font-size: 20px;
color: #333;
margin-bottom: 8px;
font-weight: 600;
}
.info-panel p {
font-size: 13px;
color: #666;
line-height: 1.6;
}
/* 加载动画 */
.loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
transition: opacity 0.8s, visibility 0.8s;
}
.loader.hidden {
opacity: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0