pages/live.php
Snapshot 2026.09.17-a2894de (current) · 45 lines · 3,748 bytes · tree · plain text
SHA-256
9bfde60e9dab4a843d8a7e899067052821fcbacad0b0aafb3efc96e1e9fca528| 1 | <?php |
| 2 | require_once __DIR__.'/../inc/layout.php'; |
| 3 | page_header('Live','live'); |
| 4 | echo '<section class="hero" style="background-image:url(\''.h(HERO_IMAGE_URL).'\')"><div class="heroinner">' |
| 5 | .'<h1 class="herotitle">The Skerðingsstaðir Experiment</h1>' |
| 6 | .'<div class="herosub">Live open field research from an AI-operated regenerative retreat inside Iceland\'s first UNESCO Biosphere Reserve. Every instrument, every fault and every number, published as it happens.</div>' |
| 7 | .'<div class="herobadges"><span class="badge badge-live">RESEARCH LABS · LIVE</span><span class="badge badge-ph">BASELINE DEPLOYS EARLY 2027</span></div>' |
| 8 | .'</div></section>'; |
| 9 | |
| 10 | /* Location */ |
| 11 | echo '<h2 style="margin-top:0">The location</h2><div class="locgrid">'; |
| 12 | echo '<div class="mapwrap"><iframe loading="lazy" referrerpolicy="no-referrer-when-downgrade" src="https://maps.google.com/maps?q='.h(SITE_LAT).','.h(SITE_LNG).'&ll=64.9631,-19.0208&z='.h(MAP_ZOOM).'&output=embed"></iframe></div>'; |
| 13 | echo '<div class="card"><h3>Skerðingsstaðir</h3>'; |
| 14 | foreach([ |
| 15 | ['Coordinates (WGS84)', h(SITE_LAT).' N, '.h(ltrim(SITE_LNG,'-')).' W'], |
| 16 | ['Setting','Northern shore of the Snæfellsnes peninsula, West Iceland'], |
| 17 | ['Municipality','Grundarfjarðarbær · 350 Grundarfjörður, ~5 km east'], |
| 18 | ['Designation','Snæfellsnes UNESCO Biosphere Reserve (2025, Iceland\'s first)'], |
| 19 | ['Parcel','75,000 m² coastal holding; ~5 ha planning area; 2% built'], |
| 20 | ['Water','Lárvaðall coastal lagoon on the parcel edge; Breiðafjörður beyond'], |
| 21 | ['Heritage','Eight protected monuments; farm documented from 1480, occupied to 1961'], |
| 22 | ['Development','The Outpost, a Human Recharging Station: five cabins, staff-absent; hotel consent held unexercised'], |
| 23 | ['From Reykjavík','~170 km by road (Route 54), about 2.5 hours'], |
| 24 | ] as [$k,$v]) echo '<div class="factrow"><b>'.$k.'</b><span>'.$v.'</span></div>'; |
| 25 | echo '<div class="kv" style="margin-top:10px"><a href="https://www.google.com/maps/search/?api=1&query='.h(SITE_LAT).','.h(SITE_LNG).'" target="_blank" rel="noopener">Open in Google Maps →</a> · <a href="index.php?p=heritage">the monuments →</a> · <a href="index.php?p=control">the control site →</a></div>'; |
| 26 | echo '</div></div>'; |
| 27 | |
| 28 | echo '<h1 style="margin-top:30px">Live status wall</h1><p class="lede">Every instrument in the programme, its latest reading and its health, in one view. Placeholder streams are tagged until their live feed lands, then the tag flips automatically.</p>'; |
| 29 | $open=db()->query("SELECT COUNT(*) c FROM events WHERE class IN ('fault','gap') AND ts>DATE_SUB(NOW(),INTERVAL 7 DAY)")->fetch()['c']; |
| 30 | if($open>0) echo '<div class="alert">'.$open.' fault/gap event(s) in the last 7 days · see <a href="index.php?p=faults">Faults & Gaps</a>.</div>'; |
| 31 | $q=db()->query("SELECT s.*, i.name inst_name, i.product, i.status inst_status, i.zone FROM streams s JOIN instruments i ON i.id=s.instrument_id WHERE s.visibility='public' ORDER BY i.zone, s.label"); |
| 32 | echo '<div class="grid cols3">'; |
| 33 | foreach($q as $s){ |
| 34 | $last=latest($s); |
| 35 | $rows=series($s, date('Y-m-d H:i:s',strtotime('-48 hours')), date('Y-m-d H:i:s'), 60); |
| 36 | echo '<div class="card"><h3>'.h($s['label']).' '.mode_badge($s).'</h3>'; |
| 37 | echo '<div class="kv">'.inst_status_badge($s['inst_status']).' · '.h($s['zone']).'</div>'; |
| 38 | if($last) echo '<div class="big">'.h(number_format((float)$last['value'],2)).'<span class="unit">'.h($s['unit']).'</span></div><div class="kv">'.h($last['ts']).'</div>'; |
| 39 | else echo '<div class="kv">no data yet</div>'; |
| 40 | echo '<div data-spark=\''.h(json_encode(array_map(fn($r)=>[$r['ts'],(float)$r['value']],$rows))).'\'></div>'; |
| 41 | echo '<div class="kv"><a href="index.php?p='.h($s['page']).'">open '.h($s['page']).' →</a></div></div>'; |
| 42 | } |
| 43 | echo '</div>'; |
| 44 | page_footer(); |
| 45 | |
Lines can be cited as pages/live.php L120-L140, platform code 2026.09.17-a2894de; add #L120-L140 to this page's address to highlight them. Source shown for scrutiny of the research platform. All rights reserved. Not offered as installable software.