Skip to content

Instantly share code, notes, and snippets.

@Veraticus
Created June 14, 2013 05:10
Show Gist options
  • Select an option

  • Save Veraticus/5779594 to your computer and use it in GitHub Desktop.

Select an option

Save Veraticus/5779594 to your computer and use it in GitHub Desktop.
<!Doctype HTML>
<html>
<head>
<title>Google</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="logo"><img src="logo4w.png" height="95" width="275"/>
</div>
<form name="input" action="html_form_action.asp" method="get">
<input type="text" name="search">
<input type="submit" value="Submit">
</form>
<div class="footer">
<div id="search">Google Search
</div>
<div id="lucky">I'm feeling lucky
</div>
<div id="ads">Advertising Programs
</div>
<div id="business">Business Solutions
</div>
<div id="privacy">Privacy & Terms
</div>
<div id="google+">+Google
</div>
<div id="about">About Google
</div>
</div>
</body>
</html>
<?php
/**
* PHP ERRORS
*
* The php error reporting level. We want all significant errors to
* be shown, including E_STRICT. We exclude E_DEPRECATED through,
* because we need to use some deprecated functions to disable
* certain PHP features that are deprecated but still work (think
* magic_quotes).
*/
if (defined('E_DEPRECATED'))
{
error_reporting((E_ALL | E_STRICT) & ~E_DEPRECATED);
}
else
{
error_reporting(E_ALL | E_STRICT);
}
/**
* CONSTANTS
*
* Mission-critical application and system constants are the first
* thing to set up. These constants include:
*
* ROOTPATH - The full server path to the root folder
* EXT - The file extension. Typically ".php"
* SYSPATH - The full server path to the "system" folder
* APPPATH - The full server path to the "application" folder
* VENPATH - The full server path to the "vendors" folder
*/
define('ROOTPATH', dirname(__FILE__) . '/');
define('EXT', '.php');
define('SYSPATH', ROOTPATH . 'sys/');
define('APPPATH', ROOTPATH . 'app/');
define('VENPATH', ROOTPATH . 'vendors/');
if (!defined('CONTROLLERS')) // May already be set by test.php
{
define('CONTROLLERS', 'controllers/');
}
if (defined('DEPLOY_CUSTOM_PATH'))
{
define('CUSPATH', DEPLOY_CUSTOM_PATH);
}
else
{
define('CUSPATH', ROOTPATH . 'custom/');
}
if (defined('DEPLOY_EXPORT_PATH'))
{
define('EXPPATH', DEPLOY_EXPORT_PATH);
}
else
{
define('EXPPATH', ROOTPATH . 'exports/');
}
if (!defined('DEPLOY_RESOURCE_URL'))
{
define('DEPLOY_RESOURCE_URL', '');
}
/**
* CORE HELPERS
*
* The next thing we do is to include some helpers that are required
* during the boot process (and elsewhere in the framework or app)
* or do some initializing work (setting up the PHP environment, for
* instance).
*/
require_once(SYSPATH . 'boot/core.php');
require_once(SYSPATH . 'boot/errors.php');
require_once(SYSPATH . 'boot/str.php');
require_once(SYSPATH . 'boot/env.php');
require_once(SYSPATH . 'boot/os.php');
require_once(SYSPATH . 'boot/support.php');
/**
* APP-SPECIFIC
*
* If the application-specific file exists, we load it and the app
* can check its required dependencies, load and validate its config
* file and so on.
*/
$application = APPPATH . 'boot/index.php';
if (file_exists($application))
{
require_once $application;
}
/**
* GIZMO
*
* After initializing the framework and letting the application check
* its requirements, we load the actual Gizmo framework.
*/
require_once(SYSPATH . 'core/gizmo.php');
<!Doctype HTML>
<html>
<head>
<title>Google</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="blackmenu">
+Justine
Search
Images
Maps
Play
YouTube
News
Gmail
Drive
Calendar
More
</div>
<div id="login">
[email protected]
</div>
<div id="logo"><img src="logo4w.png" height="95" width="275"/>
</div>
<div id="searchForm">
<div class="row">
<form name="input" action="html_form_action.asp" method="get">
<input type="text" name="search">
</form>
</div>
</div>
<div id="underSearch">
<div class="row">
<div id="search"><input type="submit" class="google" value="Google Search">
</div>
<div id="lucky"><input type="submit" class="lucky" value="I'm Feeling Lucky">
</div>
</div>
<div id="text">
<div class="row">Heard about The Internship? <a href="http://www.google.com/students">Meet the real Google interns.</a></div>
</div>
</div>
<div id="footer">
<div class="row">
<div id="ads">Advertising Programs
</div>
<div id="business">Business Solutions
</div>
<div id="privacy">Privacy & Terms
</div>
<div id="google+">+Google
</div>
<div id="about">About Google
</div>
</div>
</div>
</body>
</html>
@maks3721
Copy link

maks3721 commented Jul 5, 2025

Shop

@maks3721
Copy link

maks3721 commented Jul 5, 2025

Miks

@shamltargalqrady-jpg
Copy link

<!doctype html>

<title>لعبة الكرة - تخطي الحواجز</title> <style> html,body {height:100%;margin:0;font-family: "Segoe UI", Tahoma, Arial;} body {background: linear-gradient(#0b1020,#2b2f4a); display:flex; align-items:center; justify-content:center; color:#fff;} #gameWrap { width:100%; max-width:900px; aspect-ratio:16/9; position:relative; box-shadow:0 10px 30px rgba(0,0,0,0.6); border-radius:12px; overflow:hidden; } canvas { display:block; width:100%; height:100%; background:transparent; } #ui { position:absolute; left:12px; top:12px; z-index:20; display:flex; gap:10px; align-items:center; } .panel { background:rgba(0,0,0,0.35); padding:8px 12px; border-radius:8px; backdrop-filter: blur(4px); } #score { font-weight:700; font-size:18px; } #controls { position:absolute; right:12px; bottom:12px; z-index:21; display:flex; gap:8px; } .btn { width:64px; height:64px; border-radius:16px; display:flex; align-items:center; justify-content:center; background:linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); border:1px solid rgba(255,255,255,0.06); color:#fff; font-size:20px; user-select:none; touch-action:none;} .btn:active { transform: translateY(2px); } #startOverlay { position:absolute; inset:0; z-index:30; display:flex; align-items:center; justify-content:center; background:linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.6)); flex-direction:column; gap:12px; } #startOverlay h1{ margin:0; font-size:28px;} #startOverlay p{ margin:0 20px; text-align:center; opacity:0.9;} #startBtn { padding:10px 18px; border-radius:10px; cursor:pointer; background:#1db954; border:none; color:#fff; font-weight:700;} #footerHint { position:absolute; left:12px; bottom:12px; z-index:15; font-size:13px; opacity:0.9; } /* small device buttons adjust */ @media (max-width:520px){ .btn{ width:56px; height:56px; font-size:18px; } } </style>
النتيجة: 0
الأفضل: 0
<div id="controls">
  <div class="btn" id="leftBtn">◀</div>
  <div class="btn" id="jumpBtn">⬆</div>
  <div class="btn" id="rightBtn">▶</div>
</div>

<div id="footerHint">اسحب أو اضغط القفز / استخدم الأسهم</div>

<div id="startOverlay">
  <h1>لعبة الكرة — تخطى الحواجز</h1>
  <p>اضغط ابدأ، تحكم بالأسهم أو أزرار الشاشة. اقفز لتتفادى الحواجز، وحاول تحقق أعلى نقطة!</p>
  <button id="startBtn">ابدأ اللعب</button>
</div>
<script> /* ---- إعداد القماشين ---- */ const bgCanvas = document.getElementById('bgCanvas'); const mainCanvas = document.getElementById('mainCanvas'); const gw = document.getElementById('gameWrap'); const scoreEl = document.getElementById('score'); const bestEl = document.getElementById('best'); const startOverlay = document.getElementById('startOverlay'); const startBtn = document.getElementById('startBtn'); let DPR = window.devicePixelRatio || 1; function resize() { const rect = gw.getBoundingClientRect(); DPR = window.devicePixelRatio || 1; [bgCanvas, mainCanvas].forEach(c => { c.width = Math.floor(rect.width * DPR); c.height = Math.floor(rect.height * DPR); c.style.width = rect.width + 'px'; c.style.height = rect.height + 'px'; }); } window.addEventListener('resize', resize); resize(); const bgCtx = bgCanvas.getContext('2d'); const ctx = mainCanvas.getContext('2d'); /* ---- لعبة و فيزياء الكرة ---- */ const GAME = { running: false, w: mainCanvas.width, h: mainCanvas.height, speed: 3, gravity: 0.45 * DPR, lastTime: 0, spawnTimer: 0, spawnInterval: 1200, // ms score: 0, best: Number(localStorage.getItem('ball_best')||0) }; bestEl.innerText = 'الأفضل: ' + GAME.best; const player = { x: 120 * DPR, y: 0, r: 20 * DPR, vx: 0, vy: 0, onGround: false, color: '#ffd166' }; const obstacles = []; /* ---- خلفية متحركة: تدرج، نجوم، جبال متدرجة ---- */ const bg = { stars: [], layers: [] }; function initBackground() { bg.stars = []; for(let i=0;i<120;i++){ bg.stars.push({ x: Math.random()*GAME.w, y: Math.random()*GAME.h*0.6, r: Math.random()*1.6*DPR, a: 0.2 + Math.random()*0.9 }); } // layers of mountains (parallax) bg.layers = [ { yOffset: GAME.h*0.6, color:'#21325e', depth:0.3, peaks:8, amplitude:0.18 }, { yOffset: GAME.h*0.7, color:'#2b3b72', depth:0.5, peaks:6, amplitude:0.25 }, { yOffset: GAME.h*0.8, color:'#384a85', depth:0.8, peaks:5, amplitude:0.35 }, ]; } initBackground(); /* draw background */ let bgScroll = 0; function drawBackground(dt) { bgCtx.clearRect(0,0,GAME.w,GAME.h); // gradient sky with subtle moving aurora const g = bgCtx.createLinearGradient(0,0,0,GAME.h); g.addColorStop(0,'#07102a'); g.addColorStop(0.4,'#12233f'); g.addColorStop(1,'#0f1b2f'); bgCtx.fillStyle = g; bgCtx.fillRect(0,0,GAME.w,GAME.h); // slow aurora bands for(let i=0;i<3;i++){ bgCtx.save(); const alpha = 0.04 + 0.02 * i; bgCtx.globalAlpha = alpha; bgCtx.translate( (bgScroll*0.08*(i+1))%GAME.w, 30*i ); bgCtx.fillStyle = ['#4b6cb7','#6dd3f8','#9be7d6'][i]; bgCtx.beginPath(); const h = GAME.h*0.25; bgCtx.moveTo(-GAME.w, h + (i*60)); for(let x=-GAME.w;x<=GAME.w*2;x+=GAME.w*0.12){ const y = h + Math.sin((x*0.004)+ (bgScroll*0.002*(i+1))) * (60+(i*20)); bgCtx.lineTo(x,y + i*20); } bgCtx.lineTo(GAME.w*2, GAME.h); bgCtx.lineTo(-GAME.w, GAME.h); bgCtx.closePath(); bgCtx.fill(); bgCtx.restore(); } // stars for(const s of bg.stars){ bgCtx.globalAlpha = s.a; bgCtx.beginPath(); bgCtx.arc(s.x, s.y, s.r, 0, Math.PI*2); bgCtx.fillStyle = '#fff'; bgCtx.fill(); } bgCtx.globalAlpha = 1; // mountains layers for(const layer of bg.layers){ bgCtx.fillStyle = layer.color; bgCtx.beginPath(); const step = GAME.w / layer.peaks; bgCtx.moveTo(0, GAME.h); for(let i=0;i<=layer.peaks+2;i++){ const px = i * step - (bgScroll * layer.depth) % (step); const py = layer.yOffset + Math.sin(i*1.6 + bgScroll*0.002)* (layer.amplitude * GAME.h); bgCtx.lineTo(px, py); } bgCtx.lineTo(GAME.w, GAME.h); bgCtx.closePath(); bgCtx.fill(); } // ground glow const glow = bgCtx.createLinearGradient(0, GAME.h*0.85, 0, GAME.h); glow.addColorStop(0, 'rgba(255,255,255,0.03)'); glow.addColorStop(1, 'rgba(0,0,0,0.35)'); bgCtx.fillStyle = glow; bgCtx.fillRect(0, GAME.h*0.85, GAME.w, GAME.h*0.15); bgScroll += dt * 0.06; } /* ---- Obstacles ---- */ function spawnObstacle() { const height = (30 + Math.random()*120) * DPR; const width = (18 + Math.random()*60) * DPR; const yBase = GAME.h*0.85; obstacles.push({ x: GAME.w + 40 * DPR, y: yBase - height, w: width, h: height, passed: false, color: '#ff6b6b' }); } /* ---- تحديث الفيزياء و الرسم ---- */ function resetGame() { GAME.running = true; GAME.score = 0; obstacles.length = 0; player.x = 120 * DPR; player.y = GAME.h*0.85 - player.r*2; player.vx = 0; player.vy = 0; player.onGround = true; GAME.spawnTimer = 0; GAME.speed = 3 * DPR; startOverlay.style.display = 'none'; } function endGame() { GAME.running = false; startOverlay.style.display = 'flex'; startBtn.innerText = 'إعادة اللعب'; if (GAME.score > GAME.best) { GAME.best = GAME.score; localStorage.setItem('ball_best', GAME.best); } bestEl.innerText = 'الأفضل: ' + GAME.best; } function rectCircleCollide(cx, cy, r, rx, ry, rw, rh) { // closest point const closestX = Math.max(rx, Math.min(cx, rx+rw)); const closestY = Math.max(ry, Math.min(cy, ry+rh)); const dx = cx - closestX; const dy = cy - closestY; return (dx*dx + dy*dy) < (r*r); } function update(dt) { if(!GAME.running) return; // player controls shaping velocity player.vy += GAME.gravity * dt * 0.06; player.y += player.vy * dt * 0.06; // ground collision const groundY = GAME.h*0.85; if (player.y + player.r > groundY) { player.y = groundY - player.r; player.vy = 0; player.onGround = true; } else { player.onGround = false; } // obstacles move left for(const ob of obstacles){ ob.x -= GAME.speed * dt * 0.06; // scoring if(!ob.passed && ob.x + ob.w < player.x - player.r){ ob.passed = true; GAME.score += 1; scoreEl.innerText = 'النتيجة: ' + GAME.score; // gradually increase speed if (GAME.score % 5 === 0) GAME.speed += 0.4 * DPR; } // collision check if(rectCircleCollide(player.x, player.y, player.r, ob.x, ob.y, ob.w, ob.h)){ // small impact animation GAME.running = false; endGame(); } } // remove offscreen while(obstacles.length && obstacles[0].x + obstacles[0].w < -100) obstacles.shift(); // spawn GAME.spawnTimer += dt; const interval = Math.max(650, GAME.spawnInterval - GAME.score*10); if (GAME.spawnTimer > interval) { GAME.spawnTimer = 0; spawnObstacle(); } } function draw() { ctx.clearRect(0,0,GAME.w,GAME.h); // ground ctx.fillStyle = '#0b1220'; ctx.fillRect(0, GAME.h*0.85, GAME.w, GAME.h*0.15); // draw obstacles for(const ob of obstacles){ // shadow ctx.fillStyle = 'rgba(0,0,0,0.25)'; ctx.fillRect(ob.x+6*DPR, ob.y+6*DPR, ob.w, ob.h); // body ctx.fillStyle = ob.color; ctx.fillRect(ob.x, ob.y, ob.w, ob.h); // highlight ctx.fillStyle = 'rgba(255,255,255,0.08)'; ctx.fillRect(ob.x+4*DPR, ob.y+4*DPR, ob.w*0.25, ob.h*0.18); } // player shadow ctx.beginPath(); ctx.ellipse(player.x, GAME.h*0.85 + player.r*0.7, player.r*1.1, player.r*0.45, 0, 0, Math.PI*2); ctx.fillStyle = 'rgba(0,0,0,0.25)'; ctx.fill(); // player ball with shiny effect ctx.beginPath(); ctx.arc(player.x, player.y, player.r, 0, Math.PI*2); // radial gradient const g = ctx.createRadialGradient(player.x - player.r*0.4, player.y - player.r*0.6, player.r*0.2, player.x, player.y, player.r); g.addColorStop(0, '#fff9e6'); g.addColorStop(0.12, player.color); g.addColorStop(1, '#c45a3a'); ctx.fillStyle = g; ctx.fill(); // small shine ctx.beginPath(); ctx.arc(player.x - player.r*0.28, player.y - player.r*0.36, player.r*0.28, 0, Math.PI*2); ctx.fillStyle = 'rgba(255,255,255,0.6)'; ctx.fill(); // UI hints when not running if(!GAME.running){ ctx.fillStyle = 'rgba(255,255,255,0.04)'; ctx.fillRect(20*DPR, 20*DPR, 260*DPR, 84*DPR); } } /* ---- Main loop ---- */ let last = performance.now(); function loop(now){ const dt = now - last; last = now; GAME.w = mainCanvas.width; GAME.h = mainCanvas.height; drawBackground(dt); update(dt); draw(); requestAnimationFrame(loop); } requestAnimationFrame(loop); /* ---- Input handling ---- */ function doJump(){ if(!GAME.running) return; if(player.onGround){ player.vy = -10 * DPR; player.onGround = false; } } function moveLeft(){ if(!GAME.running) return; player.x -= 12 * DPR; if(player.x - player.r < 10*DPR) player.x = 10*DPR; } function moveRight(){ if(!GAME.running) return; player.x += 12 * DPR; if(player.x + player.r > GAME.w - 10*DPR) player.x = GAME.w - 10*DPR; } /* keyboard */ window.addEventListener('keydown', (e)=>{ if(e.key === ' ' || e.key === 'ArrowUp' || e.key === 'w') { e.preventDefault(); doJump(); } if(e.key === 'ArrowLeft' || e.key === 'a') { moveLeft(); } if(e.key === 'ArrowRight' || e.key === 'd') { moveRight(); } }); /* buttons */ document.getElementById('jumpBtn').addEventListener('touchstart', (e)=>{ e.preventDefault(); doJump(); }); document.getElementById('leftBtn').addEventListener('touchstart', (e)=>{ e.preventDefault(); moveLeft(); }); document.getElementById('rightBtn').addEventListener('touchstart', (e)=>{ e.preventDefault(); moveRight(); }); document.getElementById('jumpBtn').addEventListener('mousedown', ()=>doJump()); document.getElementById('leftBtn').addEventListener('mousedown', ()=>moveLeft()); document.getElementById('rightBtn').addEventListener('mousedown', ()=>moveRight()); /* click to jump on canvas */ mainCanvas.addEventListener('click', (e)=>{ if(GAME.running) doJump(); }); /* swipe up to jump (for touch players) */ let touchStartY = null; mainCanvas.addEventListener('touchstart', (e)=>{ const t = e.touches[0]; touchStartY = t.clientY; }); mainCanvas.addEventListener('touchend', (e)=>{ if(touchStartY === null) return; const t = e.changedTouches[0]; const dy = touchStartY - t.clientY; if(dy > 30) doJump(); touchStartY = null; }); /* start button */ startBtn.addEventListener('click', ()=>{ resetGame(); scoreEl.innerText = 'النتيجة: 0'; }); /* init player pos */ player.y = GAME.h*0.85 - player.r*2; /* responsive recalc on load */ window.addEventListener('load', ()=> { resize(); initBackground(); }); </script>

@gehansalah903-dotcom
Copy link

index.htm1

@gehansalah903-dotcom
Copy link

diff

@gehansalah903-dotcom
Copy link

scss

@saad32765
Copy link

<title>أمن السعودية</title> <style> body { margin: 0; font-family: 'Tajawal', sans-serif; background: linear-gradient(135deg, #003366, #0077b6); color: #fff; text-align: center; } header { background: #002244; padding: 20px; font-size: 28px; font-weight: bold; } .login-box { background: #fff; color: #333; padding: 20px; margin: 40px auto; width: 90%; max-width: 400px; border-radius: 12px; box-shadow: 0 0 15px rgba(0,0,0,0.2); } input { width: 90%; padding: 10px; margin: 10px 0; border: none; border-bottom: 2px solid #0077b6; outline: none; font-size: 16px; } button { background: #0077b6; color: #fff; padding: 12px; border: none; width: 95%; font-size: 18px; cursor: pointer; border-radius: 8px; transition: 0.3s; } button:hover { background: #005f87; } footer { margin-top: 30px; font-size: 14px; color: #ddd; } </style> 🚨 أمن السعودية

تسجيل الدخول

دخول فوري
© 2025 أمن السعودية - جميع الحقوق محفوظة
<script>
    function login() {
        alert('تم تسجيل الدخول بنجاح ✅');
    }
</script>
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Tahoma', sans-serif; }

body {
background: #f8f9fa;
color: #333;
direction: rtl;
}

header {
display: flex;
justify-content: space-between;
align-items: center;
background: #0a3d62;
padding: 15px 20px;
color: white;
}

header .logo {
font-size: 24px;
font-weight: bold;
}

header nav ul {
display: flex;
list-style: none;
}

header nav ul li {
margin-left: 20px;
}

header nav ul li a {
color: white;
text-decoration: none;
font-size: 18px;
}

.hero {
text-align: center;
padding: 100px 20px;
background: linear-gradient(to right, #0a3d62, #1e3799);
color: white;
}

.hero h1 {
font-size: 40px;
}

.hero button {
margin-top: 20px;
padding: 10px 20px;
background: #fbc531;
border: none;
color: #0a3d62;
font-size: 18px;
cursor: pointer;
border-radius: 5px;
}

.features {
padding: 50px 20px;
text-align: center;
}

.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 20px;
margin-top: 30px;
}

.feature-card {
background: #dcdde1;
padding: 20px;
border-radius: 8px;
font-weight: bold;
}

.login {
padding: 50px 20px;
text-align: center;
}

.login form {
display: flex;
flex-direction: column;
max-width: 300px;
margin: auto;
}

.login input {
margin: 10px 0;
padding: 10px;
font-size: 16px;
}

.login button {
background: #0a3d62;
color: white;
padding: 10px;
border: none;
font-size: 18px;
cursor: pointer;
}

footer {
text-align: center;
padding: 15px;
background: #0a3d62;
color: white;
margin-top: 30px;
}
function scrollToLogin() {
document.getElementById('login').scrollIntoView({ behavior: 'smooth' });
}

function loginUser() {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const msg = document.getElementById('loginMsg');

if (username === "admin" && password === "1234") {
    msg.style.color = "green";
    msg.textContent = "تم تسجيل الدخول بنجاح ✅";
} else {
    msg.style.color = "red";
    msg.textContent = "بيانات غير صحيحة ❌";
}
return false; // لمنع إعادة تحميل الصفحة

}// firebase.js
// ضع هنا config من Firebase Console
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT",
storageBucket: "YOUR_PROJECT.appspot.com",
messagingSenderId: "SENDER_ID",
appId: "APP_ID"
};

// تحميل الـ SDKs (تأكد تضيف السكربتات في index.html قبل هذا الملف)
// <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script>
// <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script>
// <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-firestore-compat.js"></script>
// <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-storage-compat.js"></script>

firebase.initializeApp(firebaseConfig);
const auth = firebase.auth();
const db = firebase.firestore();
const storage = firebase.storage();

<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script> <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script> <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-firestore-compat.js"></script> <script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-storage-compat.js"></script> <script src="firebase.js"></script>

// script.js (مكمل للـ firebase.js)
function scrollToLogin() {
document.getElementById('login').scrollIntoView({ behavior: 'smooth' });
}

/* AUTH */
async function registerUser(email, password, fullName) {
try {
const userCred = await auth.createUserWithEmailAndPassword(email, password);
await db.collection('users').doc(userCred.user.uid).set({
fullName,
email,
role: 'citizen',
createdAt: firebase.firestore.FieldValue.serverTimestamp()
});
return userCred.user;
} catch (e) {
throw e;
}
}

async function loginUser() {
const username = document.getElementById('username').value.trim();
const password = document.getElementById('password').value;
const msg = document.getElementById('loginMsg');

try {
  // هنا نفترض أن username هو الايميل — تغيّر لو تريد رقم هاتف
  await auth.signInWithEmailAndPassword(username, password);
  msg.style.color = "green";
  msg.textContent = "تم تسجيل الدخول بنجاح ✅";
  // ارسل المستخدم إلى داشبورد
  window.location.href = 'dashboard.html';
} catch (e) {
  msg.style.color = "red";
  msg.textContent = "خطأ في الدخول: " + e.message;
}
return false;

}

/* REPORTS */
async function createReport({ reportType, description, fileInput }) {
try {
const user = auth.currentUser;
if (!user) throw new Error('يجب تسجيل الدخول');

// upload media if exists
let mediaUrls = [];
if (fileInput && fileInput.files.length > 0) {
  for (let f of fileInput.files) {
    const ref = storage.ref().child(`reports/${user.uid}/${Date.now()}_${f.name}`);
    const snap = await ref.put(f);
    const url = await snap.ref.getDownloadURL();
    mediaUrls.push(url);
  }
}

const docRef = await db.collection('reports').add({
  reportType,
  description,
  media: mediaUrls,
  location: null, // يمكنك ملؤها من GPS لاحقًا
  status: 'new',
  createdBy: user.uid,
  createdAt: firebase.firestore.FieldValue.serverTimestamp()
});

return docRef.id;

} catch (e) {
throw e;
}
}

/* SOS (مثال بسيط) */
async function sendSOS() {
try {
const user = auth.currentUser;
if (!user) throw new Error('يجب تسجيل الدخول');

// حاول الحصول على الموقع
let loc = null;
if (navigator.geolocation) {
  await new Promise((res, rej) => {
    navigator.geolocation.getCurrentPosition((p) => {
      loc = { lat: p.coords.latitude, lng: p.coords.longitude };
      res();
    }, (err) => { res(); });
  });
}

const docRef = await db.collection('sos').add({
  userId: user.uid,
  location: loc,
  createdAt: firebase.firestore.FieldValue.serverTimestamp(),
  handled: false
});

alert('تم إرسال SOS، تم إبلاغ الجهة المسؤولة.');
return docRef.id;

} catch (e) {
alert('فشل الإرسال: ' + e.message);
}
}

/* مراقبة البلاغات في Dashboard (مثال) */
function listenReports(onUpdate) {
return db.collection('reports').orderBy('createdAt', 'desc')
.onSnapshot(snapshot => {
const items = [];
snapshot.forEach(doc => items.push({ id: doc.id, ...doc.data() }));
onUpdate(items);
});
}rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == userId;
}
match /reports/{reportId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
allow update: if request.auth != null && (
request.auth.token.role == 'admin' || request.auth.uid == resource.data.createdBy
);
allow delete: if request.auth != null && request.auth.token.role == 'admin';
}
match /sos/{sosId} {
allow read: if request.auth != null && request.auth.token.role in ['admin','moderator'];
allow create: if request.auth != null;
allow update, delete: if request.auth != null && request.auth.token.role == 'admin';
}
}
}

@saad32765
Copy link

كمل

@belal551
Copy link

belal551 commented Oct 1, 2025

اصنع لى صوره للانيموس

@belal551
Copy link

belal551 commented Oct 1, 2025

Uploading Screenshot_٢٠٢٥٠٩٢٦_٠٢٥٨١٩_Gallery.jpg…

@wv5mq8zhcf-create
Copy link

index.htm1

@abhitranjandas68-arch
Copy link

<title>AromaNest — Handcrafted Candles</title>
<nav class="nav">
  <a href="#products">Candles</a>
  <a href="#about">About</a>
  <a href="#instagram">Instagram</a>
  <a href="#contact">Contact</a>
</nav>

<div class="header-right">
  <button id="themeToggle" class="icon-btn" aria-label="Toggle dark mode">🌓</button>
  <button id="cartBtn" class="icon-btn" aria-label="Open cart">🛒 <span id="cartCount">0</span></button>
</div>

Your Cart

Total: ₹0
Checkout
  <div class="hero-overlay">
    <h1>Hand-poured Soy Candles</h1>
    <p class="lead">Minimal • Aesthetic • Natural — crafted for cozy corners.</p>
    <div class="hero-cta">
      <a href="#products" class="btn primary">Shop Bestsellers</a>
      <button id="heroShopAll" class="btn ghost">View All Candles</button>
    </div>
  </div>
</section>

<!-- PRODUCTS -->
<section id="products" class="section products reveal">
  <div class="section-head">
    <h2>Our Collection</h2>
    <p>Eco-friendly soy wax, cotton wicks, and thoughtfully blended fragrances.</p>
  </div>

  <div id="productGrid" class="grid">
    <!-- Product cards inserted by JS. There are 6 products by default. -->
  </div>
</section>

<!-- ABOUT -->
<section id="about" class="section about reveal">
  <div class="two-col">
    <div>
      <h2>About AromaNest</h2>
      <p>
        AromaNest started as a tiny bedside experiment — now we pour small-batch, non-toxic soy candles with
        calming scent blends made from essential oils. We focus on minimal design and intentional moments.
      </p>
      <ul class="features">
        <li>100% Soy Wax</li>
        <li>Phthalate-free Fragrances</li>
        <li>Hand-poured in small batches</li>
      </ul>
    </div>

    <div class="about-image" aria-hidden="true">
      <img src="https://i.imgur.com/o5T8kUX.png" alt="Candles styled" />
    </div>
  </div>
</section>

<!-- INSTAGRAM FEED (simple grid) -->
<section id="instagram" class="section instagram reveal">
  <h2>From Our Instagram</h2>
  <p>Follow @aromanest_candles for behind-the-scenes and styling ideas.</p>

  <div class="ig-grid" id="igGrid">
    <!-- grid populated by JS (images link to Instagram) -->
  </div>
  <div class="ig-cta">
    <a href="https://instagram.com" target="_blank" class="btn ghost">Follow on Instagram</a>
  </div>
</section>

<!-- NEWSLETTER -->
<section class="section newsletter reveal">
  <div class="newsletter-card">
    <div>
      <h3>Join our cozy list</h3>
      <p>Get exclusive early releases and 10% off your first order.</p>
    </div>

    <form id="newsletterForm" class="newsletter-form" novalidate>
      <input id="newsletterEmail" type="email" placeholder="Your email" required />
      <button type="submit" class="btn primary">Subscribe</button>
    </form>

    <p class="newsletter-note" id="newsletterNote" aria-live="polite"></p>
  </div>
</section>

<!-- CONTACT / FOOTER -->
<section id="contact" class="section contact reveal">
  <div class="two-col">
    <div>
      <h2>Contact</h2>
      <p>Email: <a href="mailto:[email protected]">[email protected]</a></p>
      <p>Instagram: <a href="https://instagram.com/aromanest_candles" target="_blank">@aromanest_candles</a></p>
    </div>

    <div>
      <h3>Quick Questions?</h3>
      <form id="contactForm" class="contact-form" novalidate>
        <input id="contactName" type="text" placeholder="Your name" required />
        <input id="contactEmail" type="email" placeholder="Email" required />
        <textarea id="contactMessage" placeholder="Message" rows="4" required></textarea>
        <button type="submit" class="btn primary">Send</button>
        <p class="form-note" id="contactNote" aria-live="polite"></p>
      </form>
    </div>
  </div>
</section>

<!-- CHECKOUT MODAL -->
<div id="checkoutModal" class="modal" aria-hidden="true">
  <div class="modal-content">
    <button id="closeCheckout" class="close-btn">✕</button>
    <h3>Checkout</h3>

    <div id="checkoutSummary" class="checkout-summary">
      <!-- populated by JS -->
    </div>

    <form id="checkoutForm" class="checkout-form" novalidate>
      <div class="form-row">
        <input id="custName" name="name" type="text" placeholder="Full name" required />
        <input id="custEmail" name="email" type="email" placeholder="Email" required />
      </div>

      <div class="form-row">
        <input id="custPhone" name="phone" type="tel" placeholder="Phone" required />
        <input id="custPostal" name="postal" type="text" placeholder="Pincode / ZIP" required />
      </div>

      <textarea id="custAddress" name="address" placeholder="Shipping address" rows="3" required></textarea>

      <div class="payment-methods">
        <label><input type="radio" name="payment" value="cod" checked /> Cash on Delivery</label>
        <label><input type="radio" name="payment" value="upi" /> UPI (mock)</label>
        <label><input type="radio" name="payment" value="card" /> Card (mock)</label>
      </div>

      <div class="checkout-actions">
        <button type="submit" class="btn primary">Place Order</button>
        <button id="checkoutCancel" type="button" class="btn ghost">Cancel</button>
      </div>

      <p id="checkoutNote" class="form-note" aria-live="polite"></p>
    </form>
  </div>
</div>

© AromaNest — Hand-poured soy candles

<script src="script.js"></script>

@kauanrocha02670-dotcom
Copy link

index.html

<title>ChatPlay</title>
ChatPlay

ChatPlay

Home + Perfil

Avatar

username

Post

❤️ 💬 📤

0 curtidas

username legenda

    <script src="js/app.js"></script>

    css/style.css

    :root {
    --bg: #fafafa;
    --border: #dbdbdb;
    --primary: #ff0050;
    --text: #262626;
    }

    • { margin: 0; padding: 0; box-sizing: border-box; }
      body {
      font-family: Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      }
      header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.5rem 1rem;
      border-bottom: 1px solid var(--border);
      background: #fff;
      position: sticky;
      top: 0;
      z-index: 9;
      }
      .logo { display:flex; align-items:center; gap:.4rem; }
      .logo img { height: 28px; }
      .search { padding:.4rem .6rem; border:1px solid var(--border); border-radius:4px; }
      nav { display:flex; gap:.5rem; }
      nav button { background:var(--primary); color:#fff; border:none; padding:.5rem 1rem; border-radius:4px; cursor:pointer; }

    #feed { max-width: 600px; margin: 1rem auto; }
    .post {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    }
    .post-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem;
    }
    .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
    .post-img { width: 100%; display: block; }
    .actions { display: flex; gap: .8rem; padding: .5rem .7rem; }
    .actions button { background: none; border: none; font-size: 1.3rem; cursor: pointer; }
    .likes, .caption, .comments { padding: 0 .7rem 0.5rem; font-size: 0.9rem; }
    .addComment {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border);
    padding: .7rem;
    }

    footer { text-align:center; padding:1rem; font-size:.8rem; color:#999; }

    js/app.js

    const feed = document.getElementById('feed');
    const tpl = document.getElementById('postTemplate');

    // dados fake
    const posts = [
    {
    user: 'aninha_fit',
    avatar: 'img/avatar1.jpg',
    img: 'img/post1.jpg',
    caption: 'Treino concluído! 💪',
    likes: 137,
    comments: ['Arrasou!', 'Top demais']
    }
    ];

    // renderizar posts
    posts.forEach(p => {
    const clone = tpl.content.cloneNode(true);
    clone.querySelector('.avatar').src = p.avatar;
    clone.querySelector('.username').textContent = p.user;
    clone.querySelector('.post-img').src = p.img;
    clone.querySelector('.caption').innerHTML = <strong>${p.user}</strong> ${p.caption};
    clone.querySelector('.likes').textContent = ${p.likes} curtidas;

    const ul = clone.querySelector('.comments');
    p.comments.forEach(c => {
    const li = document.createElement('li');
    li.textContent = c;
    ul.appendChild(li);
    });

    // curtir
    clone.querySelector('.likeBtn').addEventListener('click', e => {
    const likesEl = e.target.closest('.post').querySelector('.likes');
    let num = parseInt(likesEl.textContent);
    likesEl.textContent = ${++num} curtidas;
    });

    // comentar (live)
    const input = clone.querySelector('.addComment');
    input.addEventListener('keydown', e => {
    if (e.key === 'Enter' && input.value.trim()) {
    const li = document.createElement('li');
    li.textContent = input.value.trim();
    ul.appendChild(li);
    input.value = '';
    }
    });

    feed.appendChild(clone);
    });

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