File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
staticresources/smsSweeperForce Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 11# SMS - SweeperForce Changelog
22
3+ ## v1.0.4
4+
5+ ### Added
6+
7+ - Add Confetti when winning the game (currently only working in Digital Experience sites).
8+
9+ ### Fixed
10+
11+ - Fixed Enable Sound FX setting not saving when turned off.
12+
313## v1.0.3
414
515### Added
Original file line number Diff line number Diff line change 88import { LightningElement } from "lwc" ;
99import SmsSweeperForceModal from "c/smsSweeperForceModal" ;
1010import SmsAssets from "@salesforce/resourceUrl/smsSweeperForce" ;
11+ import { loadScript } from "lightning/platformResourceLoader" ;
1112
1213export default class SmsSweeperForce extends LightningElement {
1314 // --- Private Properties ---
@@ -40,6 +41,7 @@ export default class SmsSweeperForce extends LightningElement {
4041 exposed = [ ] ;
4142 flagged = [ ] ;
4243 questioned = [ ] ;
44+ jsConfetti ;
4345
4446 /**
4547 * Immutable setup data.
@@ -58,10 +60,20 @@ export default class SmsSweeperForce extends LightningElement {
5860 renderedCallback ( ) {
5961 if ( ! this . isRendered ) {
6062 this . isRendered = true ;
63+
64+ Promise . all ( [ loadScript ( this , `${ SmsAssets } /js-confetti.browser.js` ) ] )
65+ . then ( ( ) => {
66+ setTimeout ( ( ) => {
67+ this . jsConfetti = new JSConfetti ( ) ;
68+ } , 1000 ) ;
69+ } )
70+ . catch ( ( error ) => console . error ( error ) ) ;
71+
6172 const jsonString = localStorage . getItem ( "sms-sweeper-force-settings" ) ;
6273 if ( jsonString ) {
6374 this . applySettings ( jsonString ) ;
6475 }
76+
6577 this . setUpGame ( ) ;
6678 this . isInit = true ;
6779 }
@@ -481,6 +493,7 @@ export default class SmsSweeperForce extends LightningElement {
481493 if ( this . useSfx ) {
482494 this . sfxWin . play ( ) ;
483495 }
496+ this . jsConfetti . addConfetti ( ) ;
484497 } else {
485498 this . gameOver ( ) ;
486499 }
You can’t perform that action at this time.
0 commit comments