three实现三维低洼路面卡丁车比赛游戏代码

代码语言:html

所属分类:其他

代码由deepseek-v4.1 ai生成,可能有错误,仅供参考:点击查看提示词

代码描述:三维低洼路面卡丁车比赛游戏

代码标签: 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>越野卡丁车 3D</title>
<style>
  html, body {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
    background: #070b11;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  }
  canvas { display: block; }

  #ui {
    position: fixed; inset: 0; pointer-events: none;
    color: #fff; user-select: none; -webkit-user-select: none;
  }

  .panel {
    position: absolute;
    background: rgba(8, 16, 26, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(110, 190, 255, 0.22);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }

  #hud { top: 16px; left: 16px; min-width: 200px; }
  #hud .row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; margin: 5px 0; letter-spacing: 0.4px;
  }
  #hud .label { color: #7fa9cc; }
  #hud .val {
    font-weight: 700; color: #eaf6ff; font-variant-numeric: tabular-nums;
    font-size: 15px;
  }
  #hud .val.hi { color: #57d4ff; }
  #hud .val.gold { color: #ffd257; }

  #speedo {
    right: 20px; bottom: 20px;
    display: flex; align-items: baseline; gap: 6px;
    padding: 10px 20px;
  }
  #speedo #speed {
    font-size: 42px; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #fff; text-shadow: 0 0 18px rgba(80, 190, 255, 0.75);
  }
  #speedo small { font-size: 12px; color: #7fa9cc; letter-spacing: 1px; }

  #hint {
    left: 50%; bottom: 18px; transform: translateX(-50%);
    font-size: 12.5px; color: #9dc3e0; letter-spacing: 0.6px;
    white-space: nowrap;
  }
  #hint b { color: #57d4ff; font-weight: 700; }

  #toast {
    left: 50%; top: 22%; transform: translate(-50%, -50%) scale(0.9);
    font-size: 26px; font-weight: 800; letter-spacing: 2px;
    color: #fff; text-shadow: 0 0 24px rgba(90, 200, 255, 0.9);
    opacity: 0; transition: opacity 0.25s, transform 0.25s;
    background: none; border: none; box-shadow: none; padding: 0;
  }
  #toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

  #loading {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px; background: #070b11; z-index: 10;
    color: #7fa9cc; font-size: 14px; letter-spacing: 3px;
    transition: opacity 0.6s;
  }
  #loading .bar {
    width: 180px; height: 3px; background: rgba(110, 190, 255, 0.15);
    border-radius: 3px; overflow: hidden;
  }
  #loading .bar i {
    display: block; height: 100%; width: 40%;
    background: linear-gradient(90deg, transparent, #57d4ff, transparent);
    animation: scan 1.1s infinite linear;
  }
  @keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
  #loading.done { opacity: 0; pointer-events: none; }
</style>
</head>
<body>

<div id="loading">
  <div>正在生成地形...</div>
  <div class="bar"><i></i></div>
</div>

<div id="ui">
  <div class="panel" id="hud">
    <div class="row"><span class="label">圈数</span><span class="val" id="hudLap">1</span></div>
    <div class="row"><span class="label">检查点</span><span class="val hi" id="hudCp">0 / 8</span></div>
    <div class="row"><span class="label">本圈时间</span><span class="val" id="hudTime">0.00</span></div>
    <div class="row"><span class="label">最佳成绩</span><span class="val gold" id="hudBest">--</span></div>
  &.........完整代码请登录后点击上方下载按钮下载查看

网友评论0