Last active
December 3, 2025 07:56
-
-
Save FlyingThunder/0d5845fea38e19dbe571600c95baff95 to your computer and use it in GitHub Desktop.
wxcc-widget-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| customElements.define("supervisor-control", class extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: "open" }); | |
| const button = document.createElement("button"); | |
| button.textContent = "Press Me"; | |
| button.style.padding = "10px 20px"; | |
| button.style.fontSize = "16px"; | |
| button.style.cursor = "pointer"; | |
| button.style.backgroundColor = "#3498db"; | |
| button.style.color = "white"; | |
| button.style.border = "none"; | |
| let toggled = false; | |
| button.addEventListener("click", () => { | |
| toggled = !toggled; | |
| button.style.backgroundColor = toggled ? "#e74c3c" : "#3498db"; | |
| }); | |
| this.shadowRoot.appendChild(button); | |
| } | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment