2020-04-11 00:11:40 -05:00
let textIndex = 1 ;
const textArray = [
2020-04-11 03:13:37 -05:00
"Hey guys, welcome to EB Games Real (dot) Live! (click to advance)" ,
2020-04-11 00:11:40 -05:00
"Feel free to browse our very real website, check out our links, and enjoy the experience." ,
"Here at EB Games, we are hard at work planning and creating updates, so check back often!" ,
"You might even find some things you didn't notice before." ,
2020-04-11 03:13:37 -05:00
"Thank you for choosing EB Games!" ,
2020-04-11 00:11:40 -05:00
] ;
const checkFadeInFinished = async function ( ) {
const ebgamesguySpeech = document . getElementById (
"ebgamesguy-txt-speech-container"
) ;
await new Promise ( ( resolve ) => setTimeout ( resolve , 15000 ) ) ;
if ( ebgamesguySpeech . id ) {
console . log ( "We did it" ) ;
ebgamesguySpeech . id = "" ;
}
} ;
2020-04-10 21:52:08 -05:00
const showSpeech = function ( ) {
2020-04-11 00:11:40 -05:00
const ebgamesguy = document . getElementById ( "ebgamesguy" ) ;
const ebgamesguySpeech = document . getElementById (
"ebgamesguy-txt-speech-container"
) ;
const ebgamesguyTxt = document . getElementById ( "ebgamesguy-txt" ) ;
if ( ! ebgamesguy . style . display ) {
2020-04-10 21:52:08 -05:00
ebgamesguy . style . display = "flex" ;
}
2020-04-11 00:11:40 -05:00
ebgamesguy . addEventListener ( "click" , function ( ) {
if ( textIndex < textArray . length ) {
if ( textIndex == 1 && ebgamesguySpeech . id ) {
ebgamesguySpeech . id = "" ;
ebgamesguy . id = "" ;
} else {
ebgamesguyTxt . innerHTML = textArray [ textIndex ] ;
textIndex = textIndex + 1 ;
}
} else {
ebgamesguySpeech . style . display = "none" ;
ebgamesguy . id = "ebgamesguy-done" ;
}
} ) ;
checkFadeInFinished ( ) ;
2020-04-10 21:52:08 -05:00
} ;
2020-04-10 14:46:27 -05:00
2020-04-11 03:13:37 -05:00
setSpecialPromo = function ( ) {
const specialPromo = document . getElementById ( "special-promo" ) ;
specialPromo . addEventListener ( "click" , function ( ) {
alert ( "Sorry! There are no special promotions running at this time. Please follow https://gamestop.store/@ebgamesguy for updates on our current promotions and sales!" )
} ) ;
} ;
2020-04-10 21:52:08 -05:00
window . addEventListener ( "load" , function ( ) {
console . log ( "Hello, world!" ) ;
2020-04-11 00:11:40 -05:00
const ebgamesguyTxt = document . getElementById ( "ebgamesguy-txt" ) ;
ebgamesguyTxt . innerHTML = textArray [ 0 ] ;
2020-04-10 21:52:08 -05:00
showSpeech ( ) ;
2020-04-11 03:13:37 -05:00
setSpecialPromo ( ) ;
2020-04-10 21:52:08 -05:00
} ) ;