Files
avcf/dom.js
T

23 lines
1017 B
JavaScript

// ── Global constants & DOM shortcuts ──────────────────────────────────────────
//
// Provides app-wide constants and a concise DOM query shortcut.
// This module depends on nothing and is loaded first.
//
// Globals provided:
// $ → document.querySelector() bound once
// $id → document.getElementById() bound once
// svgNamespace → SVG namespace URI for createElementNS
// STORAGE_KEY → localStorage key used by persist.js
/** Shorthand for document.querySelector, bound once. */
const $ = document.querySelector.bind(document);
/** Shorthand for document.getElementById, bound once. */
const $id = document.getElementById.bind(document);
/** SVG namespace URI, required when creating SVG elements via JS. */
const svgNamespace = "http://www.w3.org/2000/svg";
/** localStorage key for workspace persistence (save/load/new). */
const STORAGE_KEY = "workspace";