diff --git a/src/components/clue-net.js b/src/components/clue-net.js new file mode 100644 index 0000000..db6262e --- /dev/null +++ b/src/components/clue-net.js @@ -0,0 +1,55 @@ +// src/components/clue-net.js +import { analyzeClues } from '../clues/safety-net.js'; +import { escapeHtml } from '../core/escape-html.js'; + +export class ClueNet extends HTMLElement { + constructor() { + super(); + this._clues = []; + this._revealed = []; + } + connectedCallback() { this.render(); } + + set clues(v) { this._clues = Array.isArray(v) ? v : []; this.render(); } + get clues() { return this._clues; } + set revealed(v) { this._revealed = Array.isArray(v) ? v : []; this.render(); } + get revealed() { return this._revealed; } + + render() { + if (this._clues.length === 0) { + this.innerHTML = `