Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add styled checkboxes

Scott Petrovic07086c5accf9
diff --git a/src/index.html b/src/index.html
index 0bda842..e5f9ff3 100644
--- a/src/index.html
+++ b/src/index.html
@@ -61,9 +61,11 @@
- <div style="display: flex; flex-direction: row; align-items: center;">
+ <div class="styled-checkbox">
+
<input type="checkbox" id="load-model-debug-checkbox" name="load-model-debug-checkbox">
<label for="load-model-debug-checkbox">Debug</label>
+
<div class="tooltip">
<span class="material-symbols-outlined" style="font-size: 16px;">help</span>
<span class="tooltiptext">Replaces all materials with normal shaders for debugging</span>
@@ -109,7 +111,7 @@
<p class="step-instructions">Right click on a joint to select and move it with controls.</p>
- <div style="display: flex; flex-direction: row">
+ <div class="styled-checkbox">
<input type="checkbox" id="mirror-skeleton" name="mirror-skeleton" value="mirror" checked>
<label for="mirror-skeleton">Mirror Left/Right Joints</label>
</div>
@@ -169,7 +171,7 @@
<button id="action_back_to_edit_skeleton" >Back to edit skeleton</button>
<!-- checkbox option to show skeleton -->
- <div style="display: flex; flex-direction: row">
+ <div class="styled-checkbox">
<input type="checkbox" id="show-skeleton-checkbox" name="show-skeleton" value="show" checked>
<label for="show-skeleton-checkbox">Show skeleton</label>
</div>
@@ -186,7 +188,7 @@
<div id="animations-listing">
<div id="animations-listing-header">
<span>Animations</span>
- <div>Export</div>
+ <div style="margin-right: 1rem;">Export</div>
</div>
<!-- javascript will populate this item with animations
diff --git a/src/lib/UI.ts b/src/lib/UI.ts
index 25e8f22..9e099a5 100644
--- a/src/lib/UI.ts
+++ b/src/lib/UI.ts
@@ -151,7 +151,7 @@ export class UI {
<button class="secondary-button play" data-index="${index}">&#9658;</button>
<span style="align-self: center">${animation_clip.name}</span>
</div>
- <div>
+ <div class="styled-checkbox">
<input type="checkbox" name="${animation_clip.name}" value="${index}">
</div>
</div>`
diff --git a/src/styles.css b/src/styles.css
index ead6a44..e1d8299 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -10,7 +10,7 @@
#skinned-step-animation-export-options {
position: fixed;
- top: 20px;
+ top: 70px;
right: 20px;
background: #0b1822;
padding: 1rem;
@@ -391,5 +391,24 @@ input[type="file"] {
}
.step-instructions {
- max-width: 180px;
+ max-width: 220px;
+}
+
+/* style checkbox */
+.styled-checkbox {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem; /* Space between checkbox and label */
+}
+
+.styled-checkbox input[type="checkbox"] {
+ width: 20px; /* Increase checkbox size */
+ height: 20px;
+ cursor: pointer;
+}
+
+.styled-checkbox label {
+ cursor: pointer; /* Make the label clickable */
+ padding: 0.2rem 0.5rem; /* Add padding for a larger clickable area */
+ font-size: 1rem; /* Adjust font size for better readability */
}
\ No newline at end of file