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>Three.js 汽车发动机点火运转模拟</title>
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #0b0e14;
font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}
canvas {
display: block;
}
#ui {
position: absolute;
top: 14px;
left: 14px;
width: 265px;
padding: 14px;
border-radius: 14px;
background: rgba(8, 12, 18, 0.78);
border: 1px solid rgba(255, 255, 255, 0.08);
color: #e8eef7;
backdrop-filter: blur(10px);
user-select: none;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
#ui .title {
font-size: 17px;
font-weight: 700;
margin-bottom: 10px;
line-height: 1.4;
}
#ui .row {
margin: 9px 0;
display: flex;
align-items: center;
gap: 8px;
}
#ui label {
font-size: 13px;
color: #aeb9c8;
}
#ui input[type="range"] {
width: 125px;
}
#ui button {
width: 100%;
border: none;
border-radius: 9px;
padding: 10px 12px;
font-size: 14px;
font-weight: 700;
cursor: pointer;
background: #e64545;
color: #fff;
transition: 0.15s;
}
#ui button:hover {
filter: brightness(1.12);
}
#ui button:active {
transform: translateY(1px);
}
.stat {
margin: 6px 0;
font-size: 13px;
color: #c9d4e3;
}
.small {
color: #7f8b9b;
font-size: 12px;
line-height: 1.5;
margin-top: 8px;
}
#rpmBar {
width: 100%;
height: 10px;
border-radius: 6px;
overflow: hidden;
background: #1c2430;
margin: 7px 0 10px;
}
#rpmFill {
width: 0%;
height: 100%;
background: linear-gradient(90deg, #3fb950, #58a6ff);
transition: width 0.08s linear;
}
#fireText {
color: #ffb020;
font-weight: 700;
}
.check {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: #aeb9c8;
cursor: pointer;
}
.check input {
cursor: pointer;
}
#tip {
position: absolute;
right: 14px;
bottom: 14px;
padding: 8px 12px;
border-radius: 10px;
background: rgba(8, 12, 18, 0.65);
border: 1px solid rgba(255, 255, 255, 0.08);
color: #93a1b5;
font-size: 12px;
backdrop-filter: blur(8px);
}
</style>
</head>
<body>
<div id="ui">
<div class="title">汽车发动机点火运转模拟</div>
<div class="row">
<button id="btnEngine">点火启动</button>
</div>
<div class="row">
<label for="throttle">油门</label>
<input id="throttle" type="range" min="0" max="100" value="8" />
<span id="throttleVal">8%</span>
</div>
<div class="row">
<label class="check">
<input id="showBlock" type="checkbo.........完整代码请登录后点击上方下载按钮下载查看















网友评论0