three实现三维手动挡驾驶汽车模拟游戏代码
代码语言:html
所属分类:三维
代码描述:three实现三维手动挡驾驶汽车模拟游戏代码
代码标签: three 三维 手动挡 驾驶 汽车 模拟 游戏 代码
下面为部分代码预览,完整代码请点击下载或在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>手动挡驾驶模拟器 | Manual Transmission Simulator</title>
<link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #0a0e1a;
--bg-2: #141822;
--fg: #e8eef5;
--muted: #6b7689;
--accent: #ffaa00;
--accent-2: #ff6600;
--danger: #ff3344;
--success: #44ff88;
--info: #44ddff;
--border: rgba(255,170,0,0.25);
}
html, body {
background: var(--bg);
color: var(--fg);
font-family: 'Rajdhani', sans-serif;
overflow: hidden;
height: 100%;
user-select: none;
-webkit-user-select: none;
}
#scene {
position: fixed;
top: 0; left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: block;
}
#hud {
position: fixed;
top: 0; left: 0;
width: 100%;
height: 100%;
z-index: 10;
pointer-events: none;
}
/* 顶部信息栏 */
.top-bar {
position: absolute;
top: 20px;
left: 20px;
right: 20px;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 20px;
}
.title-block {
background: rgba(10,14,26,0.65);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--border);
padding: 12px 22px;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.title {
font-family: 'Orbitron', sans-serif;
font-size: 16px;
font-weight: 900;
letter-spacing: 3px;
color: var(--accent);
line-height: 1.2;
}
.subtitle {
font-size: 11px;
color: var(--muted);
letter-spacing: 2px;
margin-top: 3px;
text-transform: uppercase;
}
.status-indicators {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: flex-end;
}
.indicator {
background: rgba(10,14,26,0.7);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.08);
padding: 8px 14px;
border-radius: 6px;
display: flex;
align-items: center;
gap: 8px;
font-size: 11px;
font-weight: 600;
letter-spacing: 1.5px;
transition: all 0.2s;
}
.indicator .dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #444;
transition: all 0.2s;
}
.indicator.active {
border-color: rgba(68,255,136,0.4);
background: rgba(68,255,136,0.1);
}
.indicator.active .dot {
background: var(--success);
box-shadow: 0 0 12px var(--success);
}
.indicator.warn { border-color: rgba(255,170,0,0.4); }
.indicator.warn .dot {
background: var(--accent);
box-shadow: 0 0 12px var(--accent);
}
.indicator.danger {
border-color: rgba(255,51,68,0.5);
background: rgba(255,51,68,0.1);
}
.indicator.danger .dot {
background: var(--danger);
box-shadow: 0 0 12px var(--danger);
animation: pulse 0.5s infinite alternate;
}
@keyframes pulse {
from { transform: scale(1); }
to { transform: scale(1.3); }
}
/* 仪表盘 */
.dashboard {
position: absolute;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 24px;
background: linear-gradient(180deg, rgba(20,24,34,0.92), rgba(10,14,26,0.96));
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255,170,0,0.3);
border-radius: 18px;
padding: 22px 36px;
box-shadow:
0 -10px 50px rgba(0,0,0,0.6),
0 0 40px rgba(255,170,0,0.12),
inset 0 1px 0 rgba(255,255,255,0.05);
}
.gauge {
width: 190px;
height: 190px;
position: relative;
}
.gauge svg {
width: 100%;
height: 100%;
overflow: visible;
}
.gauge-value {
position: absolute;
bottom: 28px;
left: 50%;
transform: translateX(-50%);
text-align: center;
pointer-events: none;
}
.gauge-number {
font-family: 'Orbitron', sans-serif;
font-size: 26px;
font-weight: 700;
color: var(--fg);
line-height: 1;
text-shadow: 0 0 12px rgba(255,255,255,0.3);
}
.gauge-unit {
font-size: 10px;
color: var(--muted);
letter-spacing: 3px;
margin-top: 4px;
font-weight: 600;
}
/* 挡位面板 */
.gear-panel {
width: 170px;
text-align: center;
padding: 0 8px;
}
.gear-label {
font-size: 10px;
color: var(--muted);
letter-spacing: 4px;
margin-bottom: 4px;
font-weight: 700;
}
.gear-current {
font-family: 'Orbitron', sans-serif;
font-size: 80px;
font-weight: 900;
color: var(--accent);
line-height: 1;
text-shadow: 0 0 25px rgba(255,170,0,0.6);
transition: color 0.2s, text-shadow 0.2s;
margin: 4px 0 10px;
}
.gear-current.warn {
color: var(--danger);
text-shadow: 0 0 25px rgba(255,51,68,0.6);
}
.gear-current.nutral { color: var(--info); text-shadow: 0 0 25px rgba(68,221,255,0.5); }
.gear-current.reverse { color: #ff66aa; text-shadow: 0 0 25px rgba(255,102,170,0.5); }
.gear-grid {
display: grid;
grid-template.........完整代码请登录后点击上方下载按钮下载查看















网友评论0