File tree Expand file tree Collapse file tree 5 files changed +22
-1
lines changed
TriangleArtMorphTest2-MorphLib Expand file tree Collapse file tree 5 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11node_modules
2+ src /lib /.DS_Store
3+ src /lib /logo /.DS_Store
4+ src /apps /makelogo /.DS_Store
Original file line number Diff line number Diff line change 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 ">
Original file line number Diff line number Diff 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+
206218setup ( ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments