three实现三维霓虹小镇场景动画代码
代码语言:html
所属分类:三维
代码描述:three实现三维霓虹小镇场景动画代码,可调节参数。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
</head>
<body translate="no">
<style>
:root {
--ui-cyan: #00f0ff;
--ui-pink: #ff2a85;
--ui-violet: #a855f7;
--ui-amber: #ffe56b;
--ui-ink: rgba(3, 2, 12, 0.78);
--ui-soft: rgba(226, 232, 240, 0.68);
}
body {
margin: 0;
padding: 0;
overflow: hidden;
background: #020005;
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: #e2e8f0;
user-select: none;
}
#canvas-container {
position: absolute;
inset: 0;
width: 100vw;
height: 100vh;
z-index: 1;
}
#loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 20;
font-size: 12px;
color: var(--ui-cyan);
text-shadow: 0 0 18px rgba(0, 240, 255, 0.9);
letter-spacing: 4px;
pointer-events: none;
transition: opacity 0.8s ease;
white-space: nowrap;
}
#micro-ui {
position: absolute;
top: 18px;
right: 18px;
width: 228px;
z-index: 10;
padding: 12px 13px;
border-radius: 19px;
overflow: hidden;
isolation: isolate;
background:
radial-gradient(circle at 8% 0%, rgba(0, 240, 255, 0.18), transparent 34%),
radial-gradient(circle at 95% 18%, rgba(255, 42, 133, 0.18), transparent 36%),
radial-gradient(circle at 50% 120%, rgba(168, 85, 247, 0.16), transparent 42%),
linear-gradient(145deg, rgba(10, 7, 24, 0.76), rgba(2, 1, 9, 0.58));
backdrop-filter: blur(22px) saturate(165%);
-webkit-backdrop-filter: blur(22px) saturate(165%);
box-shadow:
0 20px 58px rgba(0, 0, 0, 0.72),
0 0 28px rgba(0, 240, 255, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.09),
inset 0 -18px 40px rgba(0, 0, 0, 0.26);
max-height: 350px;
transition:
max-height 0.42s cubic-bezier(0.25, 1, 0.5, 1),
padding 0.32s ease,
transform 0.32s ease,
box-shadow 0.32s ease;
}
#micro-ui::before {
content: "";
position: absolute;
inset: 1px;
z-index: 0;
border-radius: 18px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 30%),
repeating-linear-gradient(
90deg,
rgba(255, 255, 255, 0.026) 0 1px,
transparent 1px 18px
);
opacity: 0.55;
pointer-events: none;
}
#micro-ui::after {
content: "";
position: absolute;
inset: 1px;
z-index: 1;
border-radius: 18px;
border: 1px solid rgba(0, 240, 255, 0.18);
box-shadow:
inset 0 0 18px rgba(0, 240, 255, 0.055),
inset 0 0 26px rgba(255, 42, 133, 0.035);
pointer-events: none;
}
.ui-border {
position: absolute;
z-index: 4;
pointer-events: none;
opacity: 0.98;
filter:
drop-shadow(0 0 7px rgba(0, 240, 255, 0.74))
drop-shadow(0 0 10px rgba(255, 42, 133, 0.32));
}
.ui-border-top,
.ui-border-bottom {
left: 15px;
right: 15px;
height: 2px;
background:
repeating-linear-gradient(
135deg,
transparent 0 8px,
rgba(0, 240, 255, 0.95) 8px 15px,
rgba(255, 42, 133, 0.92) 15px 21px,
transparent 21px 32px
);
background-size: 64px 2px;
animation: borderFlowX 2.8s linear infinite;
}
.ui-border-top { top: 0; }
.ui-border-bottom {
bottom: 0;
animation-direction: reverse;
}
.ui-border-left,
.ui-border-right {
top: 15px;
bottom: 15px;
width: 2px;
background:
repeating-linear-gradient(
45deg,
transparent 0 8px,
rgba(255, 42, 133, 0.9) 8px 15px,
rgba(0, 240, 255, 0.95) 15px 21px,
transparent 21px 32px
);
background-size: 2px 64px;
animation: borderFlowY 2.8s linear infinite;
}
.ui-border-left { left: 0; animation-direction: reverse; }
.ui-border-right { right: 0; }
@keyframes borderFlowX {
from { background-position: 0 0; }
to { background-position: 64px 0; }
}
@keyframes borderFlowY {
from { background-position: 0 0; }
to { background-position: 0 64px; }
}
#micro-ui.minimized {
max-height: 39px;
padding: 6px 13px;
box-shadow:
0 14px 38px rgba(0, 0, 0, 0.68),
0 0 22px rgba(0, 240, 255, 0.10),
inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
#ui-header {
position: relative;
z-index: 5;
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
margin-bottom: 10px;
transition: margin 0.34s ease;
}
#micro-ui.minimized #ui-header {
margin-bottom: 0;
}
.title-wrap {
display: flex;
align-items: center;
gap: 9px;
min-width: 0;
}
.title-orb {
width: 10px;
height: 10px;
flex: 0 0 auto;
border-radius: 50%;
background:
radial-gradient(circle, #ffffff 0 18%, var(--ui-cyan) 22% 48%, rgba(255, 42, 133, 0.55) 54%, transparent 74%);
box-shadow:
0 0 11px rgba(0, 240, 255, 0.9),
0 0 20px rgba(255, 42, 133, 0.42);
animation: corePulse 1.9s ease-in-out infinite;
}
@keyframes corePulse {
0%, 100% { transform: scale(0.92); opacity: 0.78; }
50% { transform: scale(1.16); opacity: 1; }
}
#ui-header h1 {
display: flex;
flex-direction: column;
gap: 1px;
margin: 0;
min-width: 0;
line-height: 1;
}
.title-kicker {
font-size: 8px;
letter-spacing: 1.75px;
color: rgba(196, 181, 253, 0.78);
text-transform: uppercase;
font-weight: 750;
}
.title-main {
margin-top: 3px;
font-size: 12px;
letter-spacing: 1.25px;
color: #f8fbff;
text-transform: uppercase;
font-weight: 850;
text-shadow:
0 0 12px rgba(0, 240, 255, 0.62),
0 0 18px rgba(255, 42, 133, 0.26);
white-space: nowrap;
}
#ui-toggle {
position: relative;
width: 27px;
height: 27px;
flex: 0 0 auto;
display: grid;
place-items: center;
border-radius: 50%;
border: 1px solid rgba(0, 240, 255, 0.36);
background:
radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.18), transparent 30%),
linear-gradient(145deg, rgba(0, 240, 255, 0.13), rgba(255, 42, 133, 0.10));
color: #ffffff;
cursor: pointer;
font-size: 18px;
line-height: 1;
padding: 0 0 2px;
box-shadow:
0 0 14px rgba(0, 240, 255, 0.16),
inset 0 0 12px rgba(255, 255, 255, 0.06);
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
#ui-toggle:hover {
transform: translateY(-1px) scale(1.04);
border-color: rgba(255, 42, 133, 0.62);
box-shadow:
0 0 18px rgba(0, 240, 255, 0.42),
0 0 18px rgba(255, 42, 133, 0.22),
inset 0 0 12px rgba(255, 255, 255, 0.08);
}
#ui-content {
position: relative;
z-index: 5;
opacity: 1;
transform: translateY(0);
transition: opacity 0.26s ease, transform 0.34s ease, visibility 0.34s ease;
}
#micro-ui.minimized #ui-content {
opacity: 0;
transform: translateY(-8px);
visibility: hidden;
pointer-events: none;
}
.micro-status {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 5px;
margin-bottom: 10px;
}
.micro-status span {
height: 19px;
display: grid;
place-items: center;
border-radius: 999px;
font-size: 8px;
font-weight: 800;
letter-spacing: 0.82px;
color: rgba(234, 246, 255, 0.82);
text-transform: uppercase;
background:
linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(255, 42, 133, 0.08));
border: 1px solid rgba(255, 255, 255, 0.07);
box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.035);
}
.control-group {
margin-bottom: 9px;
display: flex;
flex-direction: column;
gap: 5px;
}
.control-group label {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
font-size: 9px;
color: rgba(226, 232, 240, 0.76);
text-transform: uppercase;
font-weight: 800;
letter-spacing: 0.68px;
}
.value-pill {
min-width: 37px;
padding: 3px 6px 3px;
border-radius: 999px;
color: #ffffff;
text-align: right;
font-size: 9px;
letter-spacing: 0.35px;
background: rgba(0, 0, 0, 0.32);
border: 1px solid rgba(0, 240, 255, 0.18);
box-shadow:
inset 0 0 10px rgba(0, 240, 255, 0.055),
0 0 9px rgba(255, 42, 133, 0.055);
}
.slider-shell {
position: relative;
height: 16px;
display: flex;
align-items: center;
}
.slider-shell::before {
content: "";
position: absolute;
left: 6px;
right: 6px;
top: 50%;
height: 12px;
transform: translateY(-50%);
border-radius: 999px;
background:
linear-gradient(90deg, rgba(0, 240, 255, 0.16), rgba(255, 42, 133, 0.12)),
repeating-linear-gradient(90deg, rgba(255,255,255,0.055) 0 1px, transparent 1px 18px);
opacity: 0.8;
pointer-events: none;
}
input[type=range] {
--fill: 50%;
position: relative;
z-index: 2;
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 8px;
margin: 0;
border-radius: 999px;
cursor: pointer;
outline: none;
background:
linear-gradient(
90deg,
rgba(0, 240, 255, 0.95) 0%,
rgba(168, 85, 247, 0.92) calc(var(--fill) * 0.72),
rgba(255, 42, 133, 0.92) var(--fill),
rgba(255, 255, 255, 0.075) var(--fill),
.........完整代码请登录后点击上方下载按钮下载查看















网友评论0