Files
sunscope/scope-cell.html
T
fraxle f22833ee63 2.8
Animated sunscope with day cycle
2026-06-06 14:49:56 +01:00

37 lines
1.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>scope cell</title>
<link rel="stylesheet" href="./assets/css/header.css" />
<style>
html,body { margin:0; height:100%; background: transparent; overflow: hidden; }
#cell { display:flex; align-items:center; justify-content:center; height:100%; }
.scope-ring { width: 200px; height: 200px; }
</style>
</head>
<body>
<div id="cell"></div>
<script type="module">
import { h, render } from './assets/vendor/preact.js';
import { ScopeReticle } from './assets/js/components.js';
const q = new URLSearchParams(location.search);
const n = (k, d) => { const v = q.get(k); return v == null ? d : Number(v); };
// hour drives the rising/setting palette (UTC hour < 12 => sunrise tints).
const dt = new Date(Date.UTC(2026, 5, 6, n('hour', 12), 0, 0));
const cat = { label: 'Comfortable', bg: '#90d090', fg: '#157a15' };
const storm = q.get('storm') === '1';
render(h(ScopeReticle, {
value: 12.4, cat, loading: false,
elev: n('elev', 30), dt, glob: n('glob', 400),
activeEvent: storm ? { id: 'storm' } : null,
cc: n('cc', 0), ccLow: n('ccLow', 0), ccMid: n('ccMid', 0), ccHigh: n('ccHigh', 0),
precip: n('precip', 0), snow: n('snow', 0), visKm: n('vis', 30),
}), document.getElementById('cell'));
</script>
</body>
</html>