Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add HTML by default for theme label instead of through js

Scott Petroviceeb6643c1972
diff --git a/src/create.html b/src/create.html
index 3fd9752..3ea40cc 100644
--- a/src/create.html
+++ b/src/create.html
@@ -66,6 +66,7 @@
<button id="theme-toggle" class="settings-dropdown-row">
<!-- icon will fill in here-->
<span class="theme-icon"></span>
+ <span class="theme-label"></span>
</button>
<div class="settings-dropdown-row light-intensity-setting">
diff --git a/src/index.html b/src/index.html
index 8dd04bb..2ab34fd 100644
--- a/src/index.html
+++ b/src/index.html
@@ -50,6 +50,7 @@
<button id="theme-toggle" class="settings-dropdown-row">
<!-- icon will fill in here-->
<span class="theme-icon"></span>
+ <span class="theme-label"></span>
</button>
diff --git a/src/lib/ThemeManager.ts b/src/lib/ThemeManager.ts
index 7bbdcd0..5797ab6 100644
--- a/src/lib/ThemeManager.ts
+++ b/src/lib/ThemeManager.ts
@@ -17,12 +17,6 @@ export class ThemeManager extends EventTarget {
this.theme_icon = this.theme_toggle_button?.querySelector('.theme-icon') ?? null
this.theme_label = this.theme_toggle_button?.querySelector('.theme-label') ?? null
- if (this.theme_toggle_button !== null && this.theme_label === null) {
- this.theme_label = document.createElement('span')
- this.theme_label.className = 'theme-label'
- this.theme_toggle_button.appendChild(this.theme_label)
- }
-
// Load saved theme preference
this.load_theme_preference()
diff --git a/src/retarget/index.html b/src/retarget/index.html
index 43b1808..0f808f6 100644
--- a/src/retarget/index.html
+++ b/src/retarget/index.html
@@ -48,6 +48,7 @@
<button id="theme-toggle" class="settings-dropdown-row">
<!-- icon will fill in here-->
<span class="theme-icon"></span>
+ <span class="theme-label"></span>
</button>
<div class="settings-dropdown-row light-intensity-setting">