Assembly Election Results 2026 – Live :root { --bg: #0b0f1a; --surface: #111827; --surface2: #1a2235; --border: #1e2d45; --accent: #f59e0b; --text: #e2e8f0; --muted: #64748b; } * { box-sizing: border-box; margin: 0; padding: 0; } body { background: var(--bg); font-family: 'Source Sans 3', sans-serif; color: var(--text); min-height: 100vh; } .header { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%); border-bottom: 2px solid var(--accent); padding: 32px 24px 22px; text-align: center; position: relative; overflow: hidden; } .header::before { content:''; position:absolute; inset:0; background:radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.15) 0%, transparent 70%); } .header-flag { display:flex; align-items:center; justify-content:center; gap:16px; margin-bottom:12px; } .flag-stripe { display:flex; flex-direction:column; width:36px; height:24px; border-radius:3px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.5); } .header h1 { font-family:'Rajdhani',sans-serif; font-size:clamp(22px,5vw,38px); font-weight:700; letter-spacing:3px; text-transform:uppercase; color:#fff; position:relative; } .header h1 span { color:var(--accent); } .header-sub { font-size:13px; letter-spacing:4px; text-transform:uppercase; color:var(--muted); margin-top:6px; position:relative; } .live-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.4); border-radius:20px; padding:4px 12px; font-size:11px; font-weight:600; letter-spacing:2px; text-transform:uppercase; color:#f87171; margin-top:14px; position:relative; } .live-dot { width:7px; height:7px; background:#f87171; border-radius:50%; animation:pulse 1.4s ease-in-out infinite; } @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} } .last-updated { font-size:11px; color:var(--muted); margin-top:8px; position:relative; } .loading { text-align:center; padding:80px 20px; font-family:'Rajdhani',sans-serif; font-size:18px; letter-spacing:3px; text-transform:uppercase; color:var(--muted); } .spinner { width:40px; height:40px; border:3px solid rgba(245,158,11,.2); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; margin:0 auto 20px; } @keyframes spin { to { transform:rotate(360deg); } } .container { max-width:1100px; margin:0 auto; padding:28px 20px 60px; } .summary-strip { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:32px; } .summary-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px 12px; text-align:center; flex:1; min-width:130px; transition:transform .2s,border-color .2s; } .summary-card:hover { transform:translateY(-2px); border-color:var(--accent); } .summary-card .s-state { font-family:'Rajdhani',sans-serif; font-size:13px; font-weight:600; letter-spacing:1.5px; text-transform:uppercase; color:var(--muted); margin-bottom:6px; } .summary-card .s-seats { font-family:'Rajdhani',sans-serif; font-size:28px; font-weight:700; color:var(--accent); line-height:1; } .summary-card .s-label { font-size:10px; letter-spacing:1px; text-transform:uppercase; color:var(--muted); margin-top:4px; } .summary-card .s-leader { margin-top:8px; font-size:12px; color:var(--text); font-weight:600; } .state-block { background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; margin-bottom:28px; animation:fadeUp .5s ease both; } @keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} } .state-header { display:flex; align-items:center; justify-content:space-between; padding:16px 22px; background:linear-gradient(90deg,#1a2235 0%,#0f172a 100%); border-bottom:1px solid var(--border); } .state-name { font-family:'Rajdhani',sans-serif; font-size:20px; font-weight:700; letter-spacing:2px; text-transform:uppercase; color:#fff; } .state-total-badge { background:rgba(245,158,11,.15); border:1px solid rgba(245,158,11,.3); border-radius:6px; padding:4px 10px; font-size:12px; font-weight:600; color:var(--accent); font-family:'Rajdhani',sans-serif; letter-spacing:1px; } .bar-chart { padding:12px 22px 6px; background:var(--surface2); border-bottom:1px solid var(--border); } .bar-row { display:flex; align-items:center; gap:10px; margin-bottom:7px; } .bar-party-label { width:64px; font-size:11px; font-weight:600; letter-spacing:1px; text-transform:uppercase; color:var(--muted); text-align:right; flex-shrink:0; } .bar-track { flex:1; height:18px; background:rgba(255,255,255,.04); border-radius:4px; overflow:hidden; } .bar-fill { height:100%; border-radius:4px; display:flex; align-items:center; padding-left:8px; font-size:10px; font-weight:700; color:rgba(255,255,255,.85); min-width:26px; } .bar-value { width:32px; text-align:right; font-family:'Rajdhani',sans-serif; font-size:15px; font-weight:600; flex-shrink:0; } /* TABLE — only Party, Leading, Won */ .results-table { width:100%; border-collapse:collapse; } .results-table thead tr { background:rgba(255,255,255,.03); } .results-table th { padding:10px 18px; font-size:10px; font-weight:600; letter-spacing:2px; text-transform:uppercase; color:var(--muted); text-align:left; border-bottom:1px solid var(--border); } .results-table th:not(:first-child) { text-align:center; } .results-table tbody tr { border-bottom:1px solid rgba(255,255,255,.04); transition:background .15s; } .results-table tbody tr:last-child { border-bottom:none; } .results-table tbody tr:hover { background:rgba(255,255,255,.03); } .results-table td { padding:11px 18px; font-size:14px; } .results-table td:not(:first-child) { text-align:center; } .party-cell { display:flex; align-items:center; gap:10px; } .party-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; box-shadow:0 0 6px currentColor; } .party-name { font-weight:600; font-size:14px; letter-spacing:.5px; } .rank-badge { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; font-size:11px; font-weight:700; flex-shrink:0; } .rank-1 { background:#f59e0b; color:#000; } .rank-2 { background:#94a3b8; color:#000; } .rank-3 { background:#b45309; color:#fff; } .rank-n { background:rgba(255,255,255,.08); color:var(--muted); } .chip { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:3px 10px; font-size:13px; font-weight:600; font-family:'Rajdhani',sans-serif; letter-spacing:.5px; } .chip-lead { background:rgba(59,130,246,.15); border:1px solid rgba(59,130,246,.35); color:#93c5fd; } .chip-win { background:rgba(16,185,129,.15); border:1px solid rgba(16,185,129,.35); color:#6ee7b7; } .chip-zero { color:var(--muted); font-size:13px; } .majority-line { font-size:11px; color:var(--muted); padding:6px 18px; border-top:1px dashed rgba(255,255,255,.06); background:rgba(0,0,0,.2); display:flex; align-items:center; gap:6px; } .majority-line span { color:var(--accent); font-weight:600; } .source-live { display:inline-flex; align-items:center; gap:5px; background:rgba(16,185,129,.1); border:1px solid rgba(16,185,129,.25); border-radius:20px; padding:2px 8px; font-size:10px; color:#6ee7b7; letter-spacing:1px; text-transform:uppercase; margin-left:8px; } .source-saved { display:inline-flex; align-items:center; gap:5px; background:rgba(245,158,11,.1); border:1px solid rgba(245,158,11,.25); border-radius:20px; padding:2px 8px; font-size:10px; color:#fcd34d; letter-spacing:1px; text-transform:uppercase; margin-left:8px; } .footer { text-align:center; padding:24px; font-size:11px; letter-spacing:2px; text-transform:uppercase; color:var(--muted); border-top:1px solid var(--border); } @media(max-width:600px) { .results-table th, .results-table td { padding:8px 10px; } .bar-party-label { width:44px; font-size:10px; } } India Election Results State-wise Party Performance · Assembly Elections Live Counting Fetching latest data… Loading election data… Data sourced from Election Commission of India · Results are indicative and subject to official declaration // ── YOUR GOOGLE SHEET CSV URL ── const SHEET_CSV_URL = "https://script.google.com/macros/s/AKfycbxHvnO9uhY7ZKupsU2UUd3OFN39Ral-Z5i2AAuqGcX6sB9IOsVU6sAjL8yz06psO_msTQ/exec"; // ── FALLBACK DATA (edit numbers here if live fetch fails) ── const FALLBACK_CSV = `State,Party,Leading,Won,Total Assam,BJP,78,0,126 Assam,INC,24,0,126 Assam,BOPF,10,0,126 Assam,AGP,9,0,126 Assam,AIUDF,2,0,126 Kerala,INC,59,0,140 Kerala,CPI(M),29,0,140 Kerala,IUML,23,0,140 Kerala,CPI,9,0,140 Kerala,KEC,7,0,140 Puducherry,AINRC,8,1,30 Puducherry,IND,3,0,30 Puducherry,BJP,2,0,30 Puducherry,INC,1,0,30 Puducherry,ADMK,1,0,30 Tamil Nadu,TVK,105,0,234 Tamil Nadu,ADMK,64,0,234 Tamil Nadu,DMK,44,0,234 Tamil Nadu,INC,5,0,234 Tamil Nadu,PMK,4,0,234 West Bengal,BJP,178,0,294 West Bengal,AITC,92,0,294 West Bengal,AJUP,2,0,294 West Bengal,BGPM,1,0,294 West Bengal,CPI(M),1,0,294`; // ── Party colors ── const PARTY_COLORS = { BJP:"#f97316", INC:"#3b82f6", "CPI(M)":"#dc2626", CPIM:"#dc2626", CPI:"#ef4444", AITC:"#22c55e", TVK:"#a855f7", DMK:"#ec4899", ADMK:"#14b8a6", PMK:"#f59e0b", AGP:"#84cc16", AIUDF:"#06b6d4", BOPF:"#8b5cf6", IUML:"#10b981", KEC:"#f43f5e", AINRC:"#fb923c", IND:"#94a3b8", BGPM:"#c084fc", AJUP:"#34d399", DEFAULT:"#64748b" }; function partyColor(name) { const n = (name || "").trim(); return PARTY_COLORS[n] || PARTY_COLORS[n.toUpperCase()] || PARTY_COLORS.DEFAULT; } // ── CSV parser — handles quotes and commas properly ── function parseCSV(text) { const rows = text.replace(/\r\n/g,"\n").replace(/\r/g,"\n").trim().split("\n"); const data = {}; for (const row of rows) { // Parse quoted CSV correctly const cols = []; let cur = "", inQ = false; for (const ch of row) { if (ch === '"') { inQ = !inQ; } else if (ch === ',' && !inQ) { cols.push(cur.trim()); cur = ""; } else { cur += ch; } } cols.push(cur.trim()); if (cols.length < 4) continue; const [state, party, leading, won, total] = cols; if (!state || !party || state.toLowerCase() === "state") continue; const leadNum = parseInt(leading); if (isNaN(leadNum)) continue; if (!data[state]) data[state] = []; data[state].push({ party: party.trim(), leading: leadNum, won: parseInt(won)||0, total: parseInt(total)||0 }); } return data; } // ── Rank badge ── function rankBadge(i) { if (i===0) return `1`; if (i===1) return `2`; if (i===2) return `3`; return `${i+1}`; } // ── Render one state block ── function renderState(state, parties, delay) { const total = parties[0]?.total || 0; const majorityNum = Math.floor(total/2) + 1; const maxLeading = Math.max(...parties.map(p => p.leading + p.won), 1); const leader = parties[0]; const bars = parties.map(p => { const c = partyColor(p.party); const pct = ((p.leading+p.won)/maxLeading*100).toFixed(1); return ` ${p.party} ${p.leading+p.won} ${p.leading+p.won} `; }).join(""); // Only Party | Leading | Won — NO Total column const rows = parties.map((p,i) => { const c = partyColor(p.party); const leadCell = p.leading > 0 ? `📈 ${p.leading}` : `—`; const wonCell = p.won > 0 ? `✅ ${p.won}` : `—`; return ` ${rankBadge(i)}${p.party} ${leadCell} ${wonCell} `; }).join(""); const leaderTotal = (leader?.leading||0)+(leader?.won||0); const leaderMsg = leaderTotal >= majorityNum ? `${leader.party} has crossed majority with ${leaderTotal} seats 🎉` : `${leader.party} leads with ${leaderTotal} — majority mark: ${majorityNum}`; return ` 🗳 ${state} ${total} Seats · Majority: ${majorityNum} ${bars} PartyLeadingWon ${rows} ${leaderMsg} `; } // ── Render summary strip ── function renderSummary(data) { return Object.entries(data).map(([state, parties]) => { const total = parties[0]?.total || 0; const leader = parties[0]; return ` ${state} ${total} Total Seats ${leader?.party||"—"} Leading `; }).join(""); } // ── Paint the page ── function renderFromData(data, source) { const container = document.getElementById("mainContent"); if (Object.keys(data).length === 0) throw new Error("No data rows"); const html = `${renderSummary(data)}` + Object.entries(data).map(([s,p],i) => renderState(s,p,i*0.07)).join(""); container.innerHTML = html; const now = new Date().toLocaleTimeString('en-IN',{hour:'2-digit',minute:'2-digit'}); const badge = source === "sheet" ? `✓ Live From ECI` : `⚠ Saved data`; document.getElementById("lastUpdated").innerHTML = `Last updated: ${now} ${badge}`; } // ── Main: try live sheet, fall back to hardcoded ── async function loadData() { try { const url = SHEET_CSV_URL + (SHEET_CSV_URL.includes("?") ? "&" : "?") + "t=" + Date.now(); const res = await fetch(url, { cache: "no-store" }); const text = await res.text(); const data = parseCSV(text); if (Object.keys(data).length > 0) { renderFromData(data, "sheet"); return; } throw new Error("Empty data"); } catch (e) { console.warn("Live fetch failed — showing fallback data", e); renderFromData(parseCSV(FALLBACK_CSV), "fallback"); } } // Load on open, then every 3 minutes loadData(); setInterval(loadData, 3 * 60 * 1000);