Integrate <ruby-switch> into the templates

This commit is contained in:
Eryn Wells 2023-10-14 14:55:54 -07:00
parent abb85f701d
commit 8022a8f84a
5 changed files with 25 additions and 25 deletions

View file

@ -1,3 +1,5 @@
// Eryn Wells <eryn@erynwells.me>
class RubySwitch extends HTMLElement {
static controlSizeInPixels = 32;
static thumbTransitionDuration = 0.1;
@ -11,7 +13,7 @@ class RubySwitch extends HTMLElement {
{
id: "ruby-switch-both",
value: "both",
label: "あa",
label: "<ruby>あ<rt>a</rt></ruby>",
default: true
},
{
@ -94,6 +96,9 @@ class RubySwitch extends HTMLElement {
z-index: 2;
text-align: center;
}
#ruby-switch-both {
}
`;
}
@ -140,7 +145,7 @@ class RubySwitch extends HTMLElement {
}, { capture: true });
const label = document.createElement("b");
label.textContent = desc.label;
label.innerHTML = desc.label;
control.appendChild(label);
}