Skip to content

Commit

Permalink
Refactor index.js: Improve error handling and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Anto426 committed Oct 11, 2024
1 parent 89db9f7 commit c1d017a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,36 @@ const Textd = new TextClass();
// Variables
const githubusername = "anto426";
const AntoAboutFild = "I'm a high school student who likes programming 💻✨"
const defaultimeout = 1000;




// Function


// Function for show site
function showSite(loader, prymarybox, textFild) {
console.log("Site is ready");
setTimeout(() => {
loader.style.display = "none";
prymarybox.classList.add("fade-in");
prymarybox.style.display = "flex";
Textd.textWrriter(AntoAboutFild, textFild);
}, 1000);
}, defaultimeout);
}


// Function for error page
function seeErrorPage(loader, errmessagebox, errmessage, textmessage = "An error occurred while loading the page") {
setTimeout(() => {
loader.style.display = "none";
errmessage.innerHTML = textmessage;
errmessagebox.classList.add("fade-in");
errmessagebox.style.display = "flex";
console.error(textmessage);
}, 1000);
}, defaultimeout
);

}

Expand Down

0 comments on commit c1d017a

Please sign in to comment.