/* ============================================================
TT Love Loading — reusable AI-wait / "processing" overlay for
the React/Babel workspace. Pairs with ws-loading.css.
Indeterminate only: it signals that work is in flight, it does
NOT show a progress percentage.
Usage (fullscreen splash — default, sits above modals/cards):
{busy && }
Usage (inline overlay over one panel):
{busy && }
…panel…
Props: visible, text, subText, fullscreen (default true), size
("sm"|"md"|"lg"), variant ("halo"|"minimal"), logoSrc.
============================================================ */
function TTLoveLoading({
visible = true,
text = "處理中…",
subText = "SPREAD LOVE. INSPIRE BEAUTY.",
fullscreen = true,
size = "md",
variant = "halo",
logoSrc = "/assets/ttlove-logo.jpg",
}) {
const cls = [
"tt-loading",
"tt-loading--" + size,
"tt-loading--" + (variant === "halo" ? "halo" : variant),
fullscreen ? "tt-loading--fullscreen" : "tt-loading--inline",
visible ? "" : "tt-loading--hidden",
].filter(Boolean).join(" ");
const sparks = [1, 2, 3, 4, 5, 6, 7, 8];
return (
{text}
{subText ?
{subText}
: null}
);
}
Object.assign(window, { TTLoveLoading });