SmartestHome/digest-engine/render/templates/compact.html

66 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Digest — compact</title>
<link rel="stylesheet" href="digest-canvas-sdk/glow.css">
<style>
/*
* Compact view: sized for a Home Assistant Lovelace iframe card, so single
* column, no fixed height, and no globe-sized artwork. Give the iframe card
* about 420px of width and let it scroll.
*/
html, body {
margin: 0;
padding: 0;
background: var(--digest-bg);
}
#canvas {
display: flex;
flex-direction: column;
gap: 0.7rem;
padding: 0.7rem;
min-height: 100vh;
}
#canvas .digest-window {
width: 100%;
}
#canvas .digest-window-body {
max-height: 22rem;
}
#canvas .digest-globe {
max-width: 260px;
}
</style>
</head>
<body>
<div id="canvas" class="digest-canvas"></div>
<script src="digest-canvas-sdk/window-chrome.js"></script>
<script src="digest-canvas-sdk/globe.js"></script>
<script src="digest-canvas-sdk/render.js"></script>
<script>
// digest-web serves the shared output volume under /output/; run.py rewrites
// output/latest.json at the end of every run, so this URL is always current
// and no coordination with the scheduler is needed. Change it if you mount
// the output volume at the server root instead.
var DIGEST_URL = 'output/latest.json';
var REFRESH_MS = 5 * 60 * 1000;
var canvas = document.getElementById('canvas');
function load() {
DigestRender.load(canvas, DIGEST_URL, { detailLevel: 'compact' });
}
load();
setInterval(load, REFRESH_MS);
</script>
</body>
</html>