Skip to content

Commit 4efbaae

Browse files
committed
Added checkbox to turn off art message label
1 parent e6e3ad2 commit 4efbaae

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
node_modules
2+
src/lib/.DS_Store
3+
src/lib/logo/.DS_Store
4+
src/apps/makelogo/.DS_Store

src/apps/makelogo/.DS_Store

2 KB
Binary file not shown.

src/apps/makelogo/TriangleArtMorphTest2-MorphLib/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<option value="../../../lib/logo/art_data/santa.json">Santa (Christmas)</option>
1919
<option value="../../../lib/logo/art_data/uw.json">UW Purple W</option>
2020
</select>
21+
<label for="showMessage" style="margin-left: 12px;">
22+
<input type="checkbox" id="showMessage" checked> Show message
23+
</label>
2124
</div>
2225

2326
<div class="container">

src/apps/makelogo/TriangleArtMorphTest2-MorphLib/sketch.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ async function setup() {
5353
if (selector) {
5454
selector.addEventListener('change', (e) => loadShape(e.target.value));
5555
await loadShape(selector.value);
56+
57+
const msgToggle = document.getElementById('showMessage');
58+
if (msgToggle) {
59+
msgToggle.addEventListener('change', () => updateMessageVisibility());
60+
}
5661
} else {
5762
initRandom();
5863
}
@@ -154,6 +159,12 @@ function initMorpher(artData) {
154159
morpher.update(0);
155160
}
156161

162+
function updateMessageVisibility() {
163+
if (!morpher) return;
164+
const msgToggle = document.getElementById('showMessage');
165+
morpher._artMessageVisible = msgToggle ? msgToggle.checked : true;
166+
}
167+
157168
// =============================================================================
158169
// Animation loop
159170
// =============================================================================
@@ -203,4 +214,5 @@ function onKeyPressed(e) {
203214
if (e.key === 'h') morpher.makeLabLogo.visible = !morpher.makeLabLogo.visible;
204215
}
205216

217+
206218
setup();

src/lib/logo/makelab-logo-morpher.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ export class MakeabilityLabLogoMorpher {
115115
*/
116116
this._artMessage = null;
117117

118+
/** @type {boolean} Whether to display the art message. */
119+
this._artMessageVisible = true;
120+
118121
/** @type {string|null} */
119122
this._artMessageColor = null;
120123

@@ -485,7 +488,7 @@ export class MakeabilityLabLogoMorpher {
485488
}
486489

487490
// 5. Art message: fades out as the morph progresses
488-
if (this._artMessage) {
491+
if (this._artMessage && this._artMessageVisible) {
489492
this._drawArtMessage(ctx, lerpAmt);
490493
}
491494

0 commit comments

Comments
 (0)