← back to Nationalrealestate
public/commercial-feed.html
121 lines
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='%230a0d13'/%3E%3Ctext x='8' y='12' font-size='10' text-anchor='middle' fill='%23c8a24b'%3ECR%3C/text%3E%3C/svg%3E">
<title>USRealEstate — LA Commercial Feed</title>
<style>
:root{--bg:#0a0d13;--panel:#11151d;--line:#222936;--fg:#e8ecf2;--muted:#8a93a3;--gold:#c8a24b;}
*{box-sizing:border-box;}
html,body{margin:0;background:var(--bg);color:var(--fg);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;}
#topbar{display:flex;align-items:center;gap:14px;padding:10px 18px;background:rgba(17,21,29,.94);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;backdrop-filter:blur(6px);}
.brand{font-size:16px;font-weight:700;white-space:nowrap;} .brand b{color:var(--gold);}
nav{display:flex;gap:14px;font-size:13px;} nav a{color:var(--muted);text-decoration:none;} nav a:hover,nav a.active{color:var(--gold);}
main{padding:16px 18px 60px;max-width:960px;margin:0 auto;}
.lede{color:var(--muted);font-size:13px;line-height:1.5;margin:6px 0 16px;}
#controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:14px;}
#seg{display:inline-flex;flex-wrap:wrap;border:1px solid var(--line);border-radius:8px;overflow:hidden;}
#seg button{background:var(--panel);color:var(--muted);border:0;border-right:1px solid var(--line);padding:7px 11px;font-size:12px;cursor:pointer;}
#seg button:last-child{border-right:0;} #seg button.active{background:var(--gold);color:var(--bg);font-weight:700;}
select{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:13px;}
.item{display:flex;gap:14px;padding:14px 12px;border-bottom:1px solid var(--line);}
.item .date{min-width:92px;font-size:12px;color:var(--gold);font-weight:600;padding-top:2px;}
.item .body{flex:1;}
.item .hl{font-size:15px;font-weight:600;line-height:1.3;}
.item .meta{font-size:12px;color:var(--muted);margin-top:4px;display:flex;flex-wrap:wrap;gap:10px;}
.item .brief{font-size:13px;color:#c3ccd8;margin-top:6px;line-height:1.4;font-style:italic;}
.tag{font-size:10px;letter-spacing:.05em;text-transform:uppercase;color:var(--gold);border:1px solid var(--line);border-radius:5px;padding:1px 6px;}
.val{color:var(--fg);font-weight:600;}
/* featured stories */
#featured{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:4px 0 24px;}
.story{background:linear-gradient(160deg,#141a24,#0d1119);border:1px solid var(--line);border-radius:10px;padding:14px;}
.story .h{font-size:14px;font-weight:700;line-height:1.3;} .story .h b{color:var(--gold);}
.story .b{font-size:13px;color:#c3ccd8;margin-top:7px;line-height:1.45;}
.story .f{font-size:11px;color:var(--muted);margin-top:8px;}
#loading{padding:40px;text-align:center;color:var(--muted);}
</style>
<link rel="stylesheet" href="/nav-drawer.css">
<link rel="stylesheet" href="/geo-search.css">
</head>
<body>
<div id="topbar">
<div class="brand"><b>USRealEstate</b> — LA Commercial Feed</div>
<nav>
<a href="/">Map</a><a href="/markets.html">Markets</a>
<a href="/commercial.html">Commercial</a>
<a href="/commercial-feed.html" class="active">Feed</a>
<a href="/commercial-brokers.html">Brokers</a>
</nav>
</div>
<main>
<p class="lede">Recently recorded commercial & industrial activity across Los Angeles County, newest first —
sourced from the LA County Assessor roll. Figures shown are <b>assessed value</b> and the <b>last recorded
transfer date</b>; market sale prices are not in the public roll (they arrive with the commercial listings feed).</p>
<div id="controls">
<div id="seg"></div>
<select id="city"><option value="">All LA cities</option></select>
</div>
<h3 style="font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:6px 0 8px;">Featured Assets</h3>
<div id="featured"></div>
<h3 style="font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:6px 0 8px;">Recorded Activity</h3>
<div id="feed"></div>
<div id="loading">Loading…</div>
</main>
<script>
const $=s=>document.querySelector(s), usd=n=>n==null?'—':'$'+Number(n).toLocaleString();
const state={type:'',city:''};
function dstr(d){const dt=new Date(d);return dt.toLocaleDateString(undefined,{year:'numeric',month:'short',day:'numeric'});}
async function j(u){const r=await fetch(u);return r.json();}
async function loadTypes(){
const d=await j('/api/commercial/types');
const seg=$('#seg');
seg.innerHTML=`<button data-t="" class="active">All</button>`+
d.types.filter(t=>t.count).map(t=>`<button data-t="${t.key}">${t.label}</button>`).join('');
seg.querySelectorAll('button').forEach(b=>b.onclick=()=>{
seg.querySelectorAll('button').forEach(x=>x.classList.remove('active'));
b.classList.add('active'); state.type=b.dataset.t; load();});
}
async function loadCities(){
const d=await j('/api/commercial/cities');
$('#city').innerHTML='<option value="">All LA cities</option>'+
d.cities.map(c=>`<option value="${c.city}">${c.city} (${c.count.toLocaleString()})</option>`).join('');
$('#city').onchange=()=>{state.city=$('#city').value;load();};
}
async function loadFeatured(){
const p=new URLSearchParams({limit:9});
if(state.type)p.set('type',state.type); if(state.city)p.set('city',state.city);
const d=await j('/api/commercial/marquee?'+p);
$('#featured').innerHTML=d.results.map(r=>`<div class="story" style="cursor:pointer" onclick="location.href='/commercial-property.html?ain='+encodeURIComponent('${r.ain}')">
<div class="h"><b>${usd(r.assessed_total)}</b> · ${r.type_label}</div>
<div class="b">${r.brief ? r.brief : `${r.address||''}${r.city?', '+r.city:''} — ${r.use_desc||''}.`}</div>
<div class="f">${r.address||''}${r.city?', '+r.city:''}</div>
</div>`).join('');
}
async function load(){
$('#loading').style.display='block';
loadFeatured();
const p=new URLSearchParams({limit:80});
if(state.type)p.set('type',state.type); if(state.city)p.set('city',state.city);
const d=await j('/api/commercial/feed?'+p);
$('#feed').innerHTML=d.results.map(r=>`<div class="item" style="cursor:pointer" onclick="location.href='/commercial-property.html?ain='+encodeURIComponent('${r.ain}')">
<div class="date">${dstr(r.recording_date)}</div>
<div class="body">
<div class="hl">${r.address||'—'}${r.city?`, ${r.city}`:''}</div>
<div class="meta">
<span class="tag">${r.type_label}</span>
<span>${r.use_desc||''}</span>
<span class="val">Assessed ${usd(r.assessed_total)}</span>
${r.sqft?`<span>${Number(r.sqft).toLocaleString()} sqft</span>`:''}
</div>
${r.brief?`<div class="brief">${r.brief}</div>`:''}
</div></div>`).join('') || '<div id="loading">No recorded activity for this filter.</div>';
$('#loading').style.display='none';
}
(async()=>{ await loadTypes(); await loadCities(); await load(); })();
</script>
<script src="/nav-drawer.js"></script>
<script src="/geo-search.js"></script>
</body>
</html>