import { Buffer } from "tone/tone" ; class Loader { loaded : boolean ; constructor ( ) { const mask = document . querySelector ( "#mask" ) as HTMLElement ; const progBar = document . querySelector ( "#progressBar" ) as HTMLElement ; const prog = document . querySelector ( "#progress" ) as HTMLElement ; this . loaded = false ; /**
         * Remove the progress bar, mask and enable scroll after loaded
         */ Buffer . on ( "load" , ( ) => { this . loaded = true ; mask . remove ( ) ; prog . remove ( ) ; document . body . classList . remove ( "no-scroll" ) ; } ) ; /**
         * Update the progress bar
         */ Buffer . on ( "progress" , ( prog ) => { progBar . style . width = `${ ( prog * 100 ) . toFixed ( 2 ) }%` ; } ) ; } } export { Loader } ;