three实沙漠越野车行驶交互效果代码

代码语言:html

所属分类:三维

代码描述:three沙漠越野车行驶交互效果代码,claude4.5生成

代码标签: 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>🏜️ 沙漠狂飙 - Desert Racing (Fixed)</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            overflow: hidden;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            background: #000;
        }

        #gameCanvas {
            width: 100vw;
            height: 100vh;
            display: block;
        }

        /* UI层 */
        .ui-layer {
            position: fixed;
            z-index: 100;
            pointer-events: none;
        }

        /* 速度表 */
        .speedometer {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 180px;
            height: 180px;
            background: radial-gradient(circle, rgba(139,69,19,0.8) 0%, rgba(0,0,0,0.7) 100%);
            border-radius: 50%;
            border: 4px solid rgba(255,200,100,0.5);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 30px rgba(255,150,50,0.3), inset 0 0 30px rgba(0,0,0,0.5);
        }

        .speed-value {
            font-size: 48px;
            font-weight: bold;
            color: #ffcc66;
            text-shadow: 0 0 20px rgba(255,200,100,0.8);
            line-height: 1;
        }

        .speed-unit {
            font-size: 16px;
            color: #cc9966;
            margin-top: 5px;
        }

        .speed-needle {
            position: absolute;
            width: 4px;
            height: 60px;
            background: linear-gradient(to top, #ff6600, #ffcc00);
            bottom: 50%;
            left: 50%;
            transform-origin: bottom center;
            transform: translateX(-50%) rotate(-120deg);
            border-radius: 2px;
            box-shadow: 0 0 10px rgba(255,100,0,0.8);
            transition: transform 0.1s ease-out;
        }

        /* 状态面板 */
        .status-panel {
            position: fixed;
            top: 20px;
            left: 20px;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px;
            border: 1px solid rgba(255,200,100,0.3);
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .status-item:last-child {
            margin-bottom: 0;
        }

        .status-icon {
            font-size: 24px;
        }

        .status-bar {
            width: 150px;
            height: 12px;
            background: rgba(0,0,0,0.5);
            border-radius: 6px;
            overflow: hidden;
        }

        .status-fill {
            height: 100%;
            transition: width 0.3s;
        }

        .fuel-fill {
            background: linear-gradient(90deg, #ff6600, #ffcc00);
        }

        .turbo-fill {
            background: linear-gradient(90deg, #00ccff, #00ffcc);
        }

        .status-value {
            color: #fff;
            font-size: 14px;
            min-width: 50px;
        }

        /* 指南针 */
        .compass {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 80px;
            height: 80px;
            background: rgba(0,0,0,0.6);
            border-radius: 50%;
            border: 2px solid rgba(255,200,100,0.3);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .compass-arrow {
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 40px solid #ff6600;
            transform-origin: center 30px;
            filter: drop-shadow(0 0 5px rgba(255,100,0,0.8));
        }

        .compass-label {
            position: absolute;
            font-size: 12px;
            color: #ffcc66;
            font-weight: bold;
        }

        .compass-n { top: 5px; }
        .compass-s { bottom: 5px; }
        .compass-e { right: 8px; }
        .compass-w { left: 8px; }

        /* 控制提示 */
        .controls-hint {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 15px 30px;
            display: flex;
            gap: 20px;
            border: 1px solid rgba(255,200,100,0.3);
        }

        .control-key {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
        }

        .key {
            width: 45px;
            height: 45px;
            background: rgba(255,200,100,0.1);
            border: 2px solid rgba(255,200,100,0.4);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: #ffcc66;
            font-weight: bold;
            transition: all 0.2s;
        }

        .key.active {
            background: rgba(255,150,50,0.4);
            border-color: #ff9933;
            box-shadow: 0 0 15px rgba(255,150,50,0.5);
            transform: scale(0.95);
        }

        .key-label {
            font-size: 10px;
            color: #999;
        }

        /* 距离/时间显示 */
        .info-panel {
            position: fixed;
            top: 20px.........完整代码请登录后点击上方下载按钮下载查看

网友评论0