2020-04-11 00:11:40 -05:00
|
|
|
let textIndex = 1;
|
|
|
|
|
|
|
|
const textArray = [
|
|
|
|
"Hey guys, welcome to EB Games! (click to advance)",
|
|
|
|
"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.",
|
|
|
|
"Thank you for choosing EB Games!"
|
|
|
|
];
|
|
|
|
|
|
|
|
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-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();
|
|
|
|
});
|