Spaces:
Running
Running
Download index.html from codex-automatus/race: direct link, hf CLI and curl.
- Browser
- Download file 12.7 kB
-
https://huggingface.co/spaces/codex-automatus/race/resolve/main/index.html
- Command line
-
hf download hf://spaces/codex-automatus/race/index.html
-
curl -L -o index.html https://huggingface.co/spaces/codex-automatus/race/resolve/main/index.html
12.7 kB
| <html lang="ar" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
| <title>أوسفالت 3D — سباق النيترو</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap" rel="stylesheet"> | |
| <style> | |
| * { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; } | |
| html,body { width:100%; height:100%; overflow:hidden; background:#05070c; | |
| font-family:'Cairo','Segoe UI',Tahoma,sans-serif; color:#fff; user-select:none; } | |
| canvas#game { position:fixed; inset:0; display:block; } | |
| /* ====== HUD ====== */ | |
| #hud { position:fixed; inset:0; pointer-events:none; display:none; z-index:10; } | |
| #hud.show { display:block; } | |
| .hud-top-right { position:absolute; top:14px; left:14px; text-align:left; } | |
| #rank { font-size:52px; font-weight:900; font-style:italic; line-height:1; | |
| text-shadow:0 3px 12px rgba(0,0,0,.7); color:#ffd23f; } | |
| #rank small { font-size:20px; color:#fff; } | |
| #time { font-size:20px; font-weight:700; margin-top:4px; color:#cfe4ff; text-shadow:0 2px 6px #000; direction:ltr; } | |
| #lapBox { position:absolute; top:14px; right:50%; transform:translateX(50%); | |
| background:rgba(5,10,25,.55); border:1px solid rgba(255,255,255,.18); border-radius:12px; | |
| padding:4px 22px; font-size:19px; font-weight:700; backdrop-filter:blur(4px); } | |
| #lapBox b { color:#ff5e3a; } | |
| #speedBox { position:absolute; bottom:18px; left:20px; text-align:left; } | |
| #speed { font-size:64px; font-weight:900; font-style:italic; line-height:.9; | |
| text-shadow:0 4px 14px rgba(0,0,0,.8); } | |
| #speedUnit { font-size:16px; font-weight:700; color:#9fc3ff; } | |
| #nitroBox { position:absolute; bottom:26px; left:50%; transform:translateX(-50%); width:min(340px,42vw); } | |
| #nitroLabel { text-align:center; font-size:13px; font-weight:700; color:#8fe8ff; margin-bottom:3px; | |
| text-shadow:0 1px 4px #000; letter-spacing:1px; } | |
| #nitroBar { height:14px; background:rgba(0,10,25,.6); border:1px solid rgba(140,220,255,.4); | |
| border-radius:8px; overflow:hidden; } | |
| #nitroFill { height:100%; width:50%; border-radius:7px; | |
| background:linear-gradient(90deg,#0af,#4df); box-shadow:0 0 14px #2cf; transition:width .08s linear; } | |
| #minimap { position:absolute; bottom:18px; right:16px; width:150px; height:150px; | |
| background:rgba(5,10,25,.5); border:1px solid rgba(255,255,255,.2); border-radius:14px; backdrop-filter:blur(3px); } | |
| #msg { position:absolute; top:24%; left:50%; transform:translateX(-50%); | |
| font-size:64px; font-weight:900; font-style:italic; text-align:center; | |
| text-shadow:0 4px 24px rgba(0,0,0,.85); opacity:0; transition:opacity .25s; white-space:nowrap; } | |
| #msg.show { opacity:1; } | |
| #msg.gold { color:#ffd23f; } #msg.red { color:#ff4d3d; } #msg.cyan { color:#4de3ff; } | |
| /* ====== Menu / overlays ====== */ | |
| .overlay { position:fixed; inset:0; z-index:20; display:none; | |
| background:radial-gradient(120% 120% at 50% 0%, rgba(10,18,40,.92), rgba(3,5,10,.96)); } | |
| .overlay.show { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:16px; } | |
| .title { font-size:clamp(44px,9vw,92px); font-weight:900; font-style:italic; line-height:1; | |
| background:linear-gradient(180deg,#fff 10%,#7fd0ff 45%,#1263ff 70%,#0a2f8f); | |
| -webkit-background-clip:text; background-clip:text; color:transparent; | |
| filter:drop-shadow(0 6px 22px rgba(30,120,255,.55)); } | |
| .subtitle { margin-top:6px; font-size:clamp(15px,2.6vw,22px); font-weight:700; color:#ffd23f; letter-spacing:2px; } | |
| .menu-line { width:min(560px,86vw); height:3px; margin:20px 0; | |
| background:linear-gradient(90deg,transparent,#2f7bff,transparent); } | |
| .cars { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; } | |
| .car-card { width:158px; background:rgba(12,20,44,.75); border:2px solid rgba(120,170,255,.25); | |
| border-radius:16px; padding:14px 12px 12px; cursor:pointer; transition:.15s; text-align:center; } | |
| .car-card:hover { transform:translateY(-4px); } | |
| .car-card.sel { border-color:#ffd23f; box-shadow:0 0 26px rgba(255,210,63,.35); } | |
| .car-thumb { height:58px; margin-bottom:8px; position:relative; } | |
| .car-body { position:absolute; bottom:8px; left:50%; transform:translateX(-50%) skewX(-18deg); | |
| width:118px; height:26px; border-radius:10px 14px 8px 8px; } | |
| .car-body::after { content:''; position:absolute; top:-14px; left:26px; width:56px; height:16px; | |
| border-radius:8px 12px 0 0; background:rgba(10,14,20,.9); } | |
| .wheel { position:absolute; bottom:0; width:20px; height:20px; border-radius:50%; | |
| background:#0b0d10; border:3px solid #3a4150; } | |
| .w1{right:14px} .w2{left:14px} | |
| .car-name { font-size:17px; font-weight:900; margin-bottom:8px; } | |
| .stat-row { display:flex; align-items:center; gap:6px; margin:4px 0; font-size:11px; color:#a9c3ea; } | |
| .stat-row span { width:34px; text-align:right; } | |
| .stat-bar { flex:1; height:6px; background:rgba(255,255,255,.12); border-radius:4px; overflow:hidden; } | |
| .stat-fill { height:100%; border-radius:4px; background:linear-gradient(90deg,#2f7bff,#4de3ff); } | |
| .big-btn { margin-top:26px; padding:14px 66px; font-family:inherit; font-size:26px; font-weight:900; | |
| font-style:italic; color:#04122e; background:linear-gradient(180deg,#ffe27a,#ffb400); | |
| border:none; border-radius:14px; cursor:pointer; letter-spacing:1px; | |
| box-shadow:0 8px 28px rgba(255,180,0,.4), inset 0 -3px 0 rgba(0,0,0,.25); transition:.12s; } | |
| .big-btn:hover { transform:scale(1.05); } | |
| .big-btn:active { transform:scale(.97); } | |
| .controls-hint { margin-top:22px; font-size:13px; color:#7d93b8; text-align:center; line-height:1.9; } | |
| .controls-hint b { color:#cfe4ff; } | |
| kbd { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25); border-radius:5px; | |
| padding:1px 7px; font-family:inherit; font-size:12px; } | |
| #resultsBox { background:rgba(8,14,32,.85); border:1px solid rgba(120,170,255,.3); border-radius:20px; | |
| padding:26px 34px; min-width:min(420px,88vw); } | |
| #resTitle { font-size:34px; font-weight:900; font-style:italic; text-align:center; color:#ffd23f; } | |
| #resSub { text-align:center; color:#9fc3ff; font-size:15px; margin-top:2px; } | |
| .res-row { display:flex; align-items:center; gap:10px; margin-top:12px; font-size:17px; font-weight:700; } | |
| .res-pos { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; | |
| font-weight:900; background:rgba(255,255,255,.1); } | |
| .res-row.me { color:#ffd23f; } | |
| .res-name { flex:1; } | |
| .res-time { direction:ltr; color:#cfe4ff; font-size:15px; } | |
| /* ====== Touch controls ====== */ | |
| #touch { position:fixed; inset:0; z-index:15; display:none; pointer-events:none; } | |
| #touch.show { display:block; } | |
| .tbtn { position:absolute; pointer-events:auto; touch-action:none; | |
| width:74px; height:74px; border-radius:50%; border:2px solid rgba(255,255,255,.35); | |
| background:rgba(10,20,40,.45); color:#fff; font-size:28px; font-weight:900; | |
| display:flex; align-items:center; justify-content:center; backdrop-filter:blur(2px); } | |
| .tbtn:active,.tbtn.on { background:rgba(80,150,255,.55); } | |
| #tLeft { left:18px; bottom:120px; } | |
| #tRight { left:112px; bottom:120px; } | |
| #tGas { right:18px; bottom:120px; width:92px; height:92px; font-size:15px; } | |
| #tBrake { right:132px; bottom:120px; font-size:14px; } | |
| #tNitro { right:60px; bottom:232px; font-size:12px; color:#4de3ff; border-color:rgba(77,227,255,.6); } | |
| #tDrift { right:170px; bottom:232px; font-size:12px; color:#ffd23f; border-color:rgba(255,210,63,.6); } | |
| #pauseBtn { position:fixed; top:14px; right:14px; z-index:12; display:none; width:44px; height:44px; | |
| border-radius:12px; border:1px solid rgba(255,255,255,.25); background:rgba(5,10,25,.55); | |
| color:#fff; font-size:18px; cursor:pointer; } | |
| #pauseBtn.show { display:block; } | |
| #soundBtn { position:fixed; top:14px; right:66px; z-index:30; width:44px; height:44px; | |
| border-radius:12px; border:1px solid rgba(255,255,255,.25); background:rgba(5,10,25,.55); | |
| color:#fff; font-size:20px; cursor:pointer; backdrop-filter:blur(3px); } | |
| /* difficulty selector (F-009) */ | |
| .diff-row { display:flex; align-items:center; gap:8px; margin-bottom:16px; } | |
| .diff-label { font-size:14px; font-weight:700; color:#9fc3ff; } | |
| .diff-btn { font-family:inherit; font-size:14px; font-weight:700; color:#cfe4ff; cursor:pointer; | |
| background:rgba(12,20,44,.75); border:2px solid rgba(120,170,255,.25); border-radius:10px; | |
| padding:6px 20px; transition:.15s; } | |
| .diff-btn.sel { border-color:#ffd23f; color:#ffd23f; box-shadow:0 0 14px rgba(255,210,63,.25); } | |
| .best-lap { font-size:11px; font-weight:700; color:#ffd23f; margin-bottom:6px; } | |
| #nitroLabel.charge { color:#ffd23f; text-shadow:0 0 12px rgba(255,210,63,.9); } | |
| </style> | |
| </head> | |
| <body> | |
| <canvas id="game"></canvas> | |
| <button id="soundBtn" title="الصوت (M)">🔊</button> | |
| <!-- HUD --> | |
| <div id="hud"> | |
| <div id="lapBox">الجولة <b id="lapNow">1</b> / <span id="lapTotal">3</span></div> | |
| <div class="hud-top-right"> | |
| <div id="rank">5<small>/5</small></div> | |
| <div id="time">00:00.000</div> | |
| </div> | |
| <div id="speedBox"> | |
| <div id="speed">0</div> | |
| <div id="speedUnit">كم/س</div> | |
| </div> | |
| <div id="nitroBox"> | |
| <div id="nitroLabel">⚡ نيترو</div> | |
| <div id="nitroBar"><div id="nitroFill"></div></div> | |
| </div> | |
| <canvas id="minimap" width="150" height="150"></canvas> | |
| <div id="msg"></div> | |
| </div> | |
| <button id="pauseBtn">❚❚</button> | |
| <!-- Touch --> | |
| <div id="touch"> | |
| <div class="tbtn" id="tLeft">◀</div> | |
| <div class="tbtn" id="tRight">▶</div> | |
| <div class="tbtn" id="tGas">وقود</div> | |
| <div class="tbtn" id="tBrake">فرامل</div> | |
| <div class="tbtn" id="tNitro">نيترو</div> | |
| <div class="tbtn" id="tDrift">درفت</div> | |
| </div> | |
| <!-- Main menu --> | |
| <div id="menu" class="overlay show"> | |
| <div class="title">أوسفالت 3D</div> | |
| <div class="subtitle">سباق النيترو — المدينة</div> | |
| <div class="menu-line"></div> | |
| <div class="diff-row"> | |
| <span class="diff-label">المستوى:</span> | |
| <button class="diff-btn" data-diff="easy">سهل</button> | |
| <button class="diff-btn" data-diff="normal">عادي</button> | |
| <button class="diff-btn" data-diff="hard">صعب</button> | |
| </div> | |
| <div class="cars" id="carList"></div> | |
| <button class="big-btn" id="btnStart">انطلق! 🏁</button> | |
| <div class="controls-hint"> | |
| <b>القيادة:</b> <kbd>↑</kbd><kbd>↓</kbd><kbd>←</kbd><kbd>→</kbd> أو <kbd>WASD</kbd> • | |
| <b>نيترو:</b> <kbd>Shift</kbd> • <b>درفت:</b> <kbd>مسافة</kbd> — يملّئ النيترو ⚡ • <b>صوت:</b> <kbd>M</kbd> • <b>إيقاف:</b> <kbd>Esc</kbd><br> | |
| 3 جولات ضد 4 سيارات منافسة — سجّل أفضل جولة لك! | |
| </div> | |
| </div> | |
| <!-- Pause --> | |
| <div id="pause" class="overlay"> | |
| <div class="title" style="font-size:56px">إيقاف مؤقت</div> | |
| <button class="big-btn" id="btnResume">استئناف</button> | |
| <div class="big-btn" id="btnQuit" style="background:linear-gradient(180deg,#8fb3e8,#3d6db3); color:#fff; margin-top:16px; padding:12px 50px; font-size:20px;">القائمة الرئيسية</div> | |
| </div> | |
| <!-- Fatal error (WebGL / CDN failure, F-002) --> | |
| <div id="fatal" class="overlay"> | |
| <div style="max-width:520px;text-align:center;padding:30px;background:rgba(8,14,32,.92); | |
| border:1px solid rgba(255,120,100,.45);border-radius:20px;"> | |
| <div style="font-size:48px">⚠️</div> | |
| <div id="fatalMsg" style="margin-top:14px;font-size:18px;font-weight:700;line-height:2;white-space:pre-line"></div> | |
| </div> | |
| </div> | |
| <!-- Results --> | |
| <div id="results" class="overlay"> | |
| <div id="resultsBox"> | |
| <div id="resTitle">🏆 نتائج السباق</div> | |
| <div id="resSub"></div> | |
| <div id="resList"></div> | |
| <div style="text-align:center"> | |
| <button class="big-btn" id="btnAgain" style="margin-top:20px; font-size:22px; padding:12px 50px;">سباق جديد</button> | |
| <button class="big-btn" id="btnMenu2" style="margin-top:14px; font-size:18px; padding:10px 40px; | |
| background:linear-gradient(180deg,#8fb3e8,#3d6db3); color:#fff;">القائمة الرئيسية</button> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.158.0/three.min.js" | |
| integrity="sha384-5UGTcMIxVUKFeJH0zOS3lqMAZNBG+fCXJbi3UglUq6ABO4MQJu6rxNa+MPP+qtwq" | |
| crossorigin="anonymous"></script> | |
| <script src="game.js"></script> | |
| </body> | |
| </html> | |