f1minigamewebfromgrach
- 📅 2026-10-04T15:24:56.643Z
- 👁️ 82 katselukertaa
- 🔓 Julkinen
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Гран-При Легенд F1: V10 Звук</title>
<style>
body {
margin: 0;
padding: 0;
background: #0a0a0a;
font-family: 'Arial Black', Gadget, sans-serif;
overflow: hidden;
color: white;
user-select: none;
-webkit-user-select: none;
}
.menu-screen {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
position: absolute;
background: linear-gradient(135deg, #111 0%, #000 100%);
z-index: 10;
}
#mode-menu, #track-menu, #game-container { display: none; }
h1 {
font-size: 28px;
text-align: center;
margin-bottom: 5px;
color: #ff3333;
text-transform: uppercase;
letter-spacing: 2px;
text-shadow: 0 0 10px rgba(255,51,51,0.5);
}
.subtitle {
margin-bottom: 30px;
color: #888;
text-align: center;
font-size: 13px;
font-family: Arial, sans-serif;
padding: 0 15px;
text-transform: uppercase;
}
.btn {
width: 85%;
max-width: 320px;
padding: 16px;
margin: 10px;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
color: white;
cursor: pointer;
text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
transition: all 0.2s ease;
text-transform: uppercase;
}
.btn:active { transform: scale(0.96); box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
#btn-senna { background: #1a1a1a; border: 2px solid #ffd700; color: #ffd700; }
#btn-lauda { background: #990000; border: 2px solid #fff; }
#btn-schumi { background: #006699; border: 2px solid #ff3333; }
.btn-menu { background: #222; border: 2px solid #444; font-family: Arial, sans-serif; }
#btn-qual { background: #311b92; border: 2px solid #7c4dff; }
#btn-race { background: #b71c1c; border: 2px solid #ff5252; }
canvas { display: block; box-shadow: 0 0 30px rgba(0,0,0,0.8); }
#controls {
position: absolute;
bottom: 40px;
width: 100%;
display: flex;
justify-content: space-around;
padding: 0 30px;
box-sizing: border-box;
}
.touch-btn {
width: 85px;
height: 85px;
background: rgba(255, 255, 255, 0.1);
border: 3px solid rgba(255, 255, 255, 0.4);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 38px;
color: white;
box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
.touch-btn:active { background: rgba(255, 255, 255, 0.3); }
#ui-overlay {
position: absolute;
top: 20px;
font-size: 13px;
font-family: Arial, sans-serif;
font-weight: bold;
background: rgba(0,0,0,0.85);
padding: 12px 18px;
border-radius: 8px;
pointer-events: none;
border: 1px solid #333;
text-align: center;
line-height: 1.5;
width: 200px;
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.damage-bar-bg {
width: 100%;
height: 6px;
background: #333;
border-radius: 3px;
margin-top: 6px;
overflow: hidden;
}
#damage-bar-fill { width: 0%; height: 100%; background: #00ff00; }
#end-screen {
display: none;
position: absolute;
background: rgba(5,5,5,0.96);
top: 0; left: 0; width: 100%; height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
z-index: 20;
}
</style>
</head>
<body>
<!-- ЭКРАН 1: ВЫБОР ГОНЩИКА -->
<div id="menu" class="menu-screen">
<h1>ГРАН-ПРИ ЛЕГЕНД</h1>
<p class="subtitle">Выберите пилота для заезда</p>
<button class="btn" id="btn-senna" onclick="selectDriver('senna')">Айртон Сенна<br><span style="font-size:11px;font-family:Arial;font-weight:normal;opacity:0.8;">Lotus Черно-Золотой</span></button>
<button class="btn" id="btn-lauda" onclick="selectDriver('lauda')">Ники Лауда<br><span style="font-size:11px;font-family:Arial;font-weight:normal;opacity:0.8;">Ferrari Классическая Красная</span></button>
<button class="btn" id="btn-schumi" onclick="selectDriver('schumi')">Михаэль Шумахер<br><span style="font-size:11px;font-family:Arial;font-weight:normal;opacity:0.8;">Benetton Голубой Чемпион</span></button>
</div>
<!-- ЭКРАН 2: ВЫБОР РЕЖИМА -->
<div id="mode-menu" class="menu-screen">
<h1>ВЫБОР РЕЖИМА</h1>
<p class="subtitle">Выберите формат уикенда</p>
<button class="btn" id="btn-qual" onclick="selectMode('qualifying')">Квалификация<br><span style="font-size:11px;font-family:Arial;font-weight:normal;opacity:0.8;">1 круг • Одиночный заезд на время</span></button>
<button class="btn" id="btn-race" onclick="selectMode('race')">Гонка Гран-При<br><span style="font-size:11px;font-family:Arial;font-weight:normal;opacity:0.8;">3 круга • Битва с легендарными ботами</span></button>
</div>
<!-- ЭКРАН 3: ВЫБОР ТРАССЫ -->
<div id="track-menu" class="menu-screen">
<h1>ВЫБОР ТРАССЫ</h1>
<p class="subtitle">Выберите гоночный трек</p>
<button class="btn btn-menu" onclick="selectTrack('imola')">Имола (Сан-Марино)<br><span style="font-size:11px;font-weight:normal;opacity:0.6;">1000м • Быстрые виражи</span></button>
<button class="btn btn-menu" onclick="selectTrack('monaco')">Монако (Городская)<br><span style="font-size:11px;font-weight:normal;opacity:0.6;">1000м • Бетонные отбойники</span></button>
<button class="btn btn-menu" style="border-color:#ff3333;" onclick="selectTrack('nurburgring')"><span style="color:#ff5555;">Нюрбургринг (Старый круг)</span><br><span style="font-size:11px;font-weight:normal;opacity:0.6;">2000м • Опасный «Зелёный ад»</span></button>
</div>
<!-- ИГРОВОЙ ИНТЕРФЕЙС -->
<div id="game-container">
<canvas id="gameCanvas"></canvas>
<div id="ui-overlay">
<div id="track-title" style="color:#ff3333; font-weight:bold; letter-spacing:1px;"></div>
<div id="ui-lap-info" style="color:#ffd700; margin: 2px 0; text-transform:uppercase;"></div>
<div style="color:#aaa;">ДИСТАНЦИЯ: <span id="dist-val" style="color:#fff;">0</span> / <span id="max-dist-val" style="color:#fff;">1000</span> м</div>
<div style="color:#fff; margin-top:4px;">ПОВРЕЖДЕНИЯ: <span id="damage-val" style="font-weight:bold;">0</span>%</div>
<div class="damage-bar-bg"><div id="damage-bar-fill"></div></div>
</div>
<div id="controls">
<div class="touch-btn" id="left-btn">◀</div>
<div class="touch-btn" id="right-btn">▶</div>
</div>
<!-- Финальный экран -->
<div id="end-screen">
<canvas id="cupCanvas" width="200" height="200"></canvas>
<h2 id="end-title" style="font-size: 26px; margin: 0; letter-spacing: 1px;"></h2>
<p id="end-sub" style="font-size: 16px; font-family:Arial, sans-serif; margin: 15px 0 25px 0; color: #aaa; line-height: 1.5;"></p>
<button class="btn" style="background:#333; border: 1px solid #555;" onclick="stopAudio(); location.reload();">В меню</button>
</div>
</div>
<script>
const canvas = document.getElementById("gameCanvas");
const ctx = canvas.getContext("2d");
const cw = Math.min(window.innerWidth, 500);
const ch = window.innerHeight;
canvas.width = cw;
canvas.height = ch;
const ULTRA_SPEED = 22;
const BASE_STEERING_SPEED = 9.5;
const allDrivers = {
senna: { key: 'senna', name: "Айртон Сенна", color: "#111111", wingColor: "#ffd700" },
lauda: { key: 'lauda', name: "Ники Лауда", color: "#cc0000", wingColor: "#ffffff" },
schumi: { key: 'schumi', name: "Михаэль Шумахер", color: "#006699", wingColor: "#cc0000" }
};
const tracks = {
imola: { name: "Имола", grass: "#1b5e20", asphalt: "#2d2d2d", border: "#ffffff", curveFreq: 0.012, curveAmp: 95, type: "open", lapLength: 1000 },
monaco: { name: "Монако", grass: "#444444", asphalt: "#222222", border: "#ffcc00", curveFreq: 0.02, curveAmp: 120, type: "city", lapLength: 1000 },
nurburgring: { name: "Нюрбургринг", grass: "#0f3813", asphalt: "#3a3a3a", border: "#ffffff", curveFreq: 0.025, curveAmp: 110, type: "nordschleife", lapLength: 2000 }
};
let player = { x: cw / 2 - 18, y: ch - 210, w: 36, h: 65 };
let activeDriver = null;
let activeTrack = null;
let activeMode = null;
let maxLaps = 1;
let currentLap = 1;
let bots = [];
let particles = [];
let distance = 0;
let damage = 0;
let startTime = 0;
let gameActive = false;
let spawnTimer = 0;
let roadCurveOffset = 0;