clock/weather etc. default to 1/6 width; sizes store an integer span 1-12 (legacy s/m/l still accepted by /api/dashboard/layout). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
537 B
JavaScript
16 lines
537 B
JavaScript
import { el } from '../dom.js';
|
|
|
|
// Builds the refined-B chrome shell and returns { root, body }. The card module
|
|
// fills `body` in its mount(); start()/stop() own its refresh timer.
|
|
export function svCard(def) {
|
|
const body = el('div', { class: 'sv-card-body' });
|
|
const root = el('div', {
|
|
class: 'sv-card', dataset: { cardId: def.id },
|
|
style: { gridColumn: 'span ' + (def.span || 6) } // 12-col grid; per-card width
|
|
},
|
|
el('div', { class: 'sv-card-title' }, def.title),
|
|
body
|
|
);
|
|
return { root, body };
|
|
}
|