three+gsap实现可配置参数海面日出日落各种天气景色奇观海浪波动动画效果代码
代码语言:html
所属分类:动画
代码描述:three+gsap实现可配置参数海面日出日落各种天气景色奇观海浪波动动画效果代码,可修改几十种参数跳出你心中喜欢的海边景色。
代码标签: three gsap 可 配置 参数 海面 日出 日落 各种 天气 景色 奇观 海浪 波动 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: "PPNeueBit";
src: url("https://assets.codepen.io/7558/PPNeueBit-Bold.woff2")
format("woff2");
font-weight: bold;
font-style: normal;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0;
background: #000;
overflow-x: hidden;
overflow-y: auto;
}
canvas {
display: block;
position: fixed;
top: 0;
left: 0;
z-index: 0;
}
/* Scroll Container */
.scroll-container {
position: relative;
height: 1500vh;
width: 100%;
pointer-events: none;
}
/* Tweakpane */
#pane-container {
position: fixed;
top: 8px;
right: 8px;
z-index: 1001;
width: 280px;
}
/* Audio Toggle */
.audio-toggle {
position: fixed;
top: 24px;
left: 24px;
width: 12px;
height: 12px;
background: rgba(255, 255, 255, 0.5);
border-radius: 50%;
cursor: pointer;
z-index: 1000;
transition: opacity 0.3s ease;
pointer-events: auto;
}
.audio-toggle:hover {
opacity: 0.8;
}
.audio-toggle.playing {
background: rgba(255, 255, 255, 0.9);
}
/* Story Toggle - Square */
.story-toggle {
position: fixed;
top: 24px;
left: 48px;
width: 10px;
height: 10px;
background: rgba(255, 255, 255, 0.5);
cursor: pointer;
z-index: 1000;
transition: opacity 0.3s ease;
pointer-events: auto;
}
.story-toggle:hover {
opacity: 0.8;
}
.story-toggle.active {
background: rgba(255, 255, 255, 0.9);
}
/* Credits Toggle - Triangle */
.credits-toggle {
position: fixed;
top: 24px;
left: 70px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 10px solid rgba(255, 255, 255, 0.5);
cursor: pointer;
z-index: 1000;
transition: opacity 0.3s ease;
pointer-events: auto;
}
.credits-toggle:hover {
opacity: 0.8;
}
.credits-toggle.active {
border-bottom-color: rgba(255, 255, 255, 0.9);
}
/* Story Panel */
.story-panel {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.05);
z-index: 500;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
visibility: hidden;
transition: opacity 0.5s ease, visibility 0.5s ease;
pointer-events: none;
}
.story-panel.visible {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.story-content {
font-family: "PPNeueBit", monospace;
font-size: clamp(18px, 1.3vw, 22px);
color: rgba(255, 255, 255, 0.85);
text-align: center;
line-height: 1.6;
max-width: 480px;
padding: 20px;
text-wrap: pretty;
}
.story-content p {
margin: 0 0 0.8em 0;
}
.story-content p:last-child {
margin-bottom: 0;
}
/* Credits Panel */
.credits-panel {
position: fixed;
bottom: 24px;
left: 24px;
z-index: 500;
opacity: 0;
visibility: hidden;
transition: opacity 0.5s ease, visibility 0.5s ease;
pointer-events: none;
}
.credits-panel.visible {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.credits-panel a {
font-family: "PPNeueBit", monospace;
font-size: 16px;
color: rgba(255, 255, 255, 0.5);
text-decoration: none;
letter-spacing: 0.05em;
transition: color 0.3s ease;
text-transform: uppercase;
}
.credits-panel a:hover {
color: rgba(255, 255, 255, 0.8);
}
/* Scroll Progress Indicator */
.scroll-progress {
position: fixed;
left: 24px;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 120px;
background: rgba(255, 255, 255, 0.15);
z-index: 100;
}
.scroll-progress-fill {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 0%;
background: rgba(255, 255, 255, 0.4);
transition: height 0.1s ease-out;
}
.scroll-marker {
position: absolute;
left: 10px;
font-family: "PPNeueBit", monospace;
font-size: 10px;
color: rgba(255, 255, 255, 0.2);
letter-spacing: 0.1em;
text-transform: uppercase;
white-space: nowrap;
transition: color 0.3s ease;
}
.scroll-marker.past {
top: -4px;
}
.scroll-marker.present {
top: 50%;
transform: translateY(-50%);
}
.scroll-marker.future {
bottom: -4px;
}
.scroll-marker.active {
color: rgba(255, 255, 255, 0.7);
}
/* Subtitle System */
.subtitle-container {
position: fixed;
bottom: 10%;
left: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
pointer-events: none;
transition: opacity 0.4s ease, visibility 0.4s ease;
}
.subtitle {
font-family: "PPNeueBit", monospace;
font-size: clamp(18px, 2.2vw, 26px);
font-weight: bold;
color: var(--subtitle-color, rgba(255, 255, 255, 0.95));
text-align: center;
letter-spacing: 0.02em;
line-height: 1.5;
max-width: 80%;
padding: 4px 12px;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}
.subtitle .char {
display: inline-block;
opacity: 0;
filter: blur(8px);
}
/* Style-specific subtitle colors */
body.style-noir .subtitle {
--subtitle-color: #f0d856;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 10px rgba(240, 216, 86, 0.3);
}
body.style-retro .subtitle {
--subtitle-color: #ffffff;
text-shadow: 0 0 5px rgba(255, 255, 255, 0.8),
0 0 15px rgba(255, 255, 255, 0.4);
}
body.style-synthwave .subtitle {
--subtitle-color: #ff71ce;
text-shadow: 0 0 10px rgba(255, 113, 206, 0.8),
0 0 20px rgba(1, 205, 254, 0.5);
}
body.style-dream .subtitle {
--subtitle-color: rgba(255, 255,.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0