diff --git a/index.html b/index.html index 16b6bf2..7b86261 100755 --- a/index.html +++ b/index.html @@ -2,6 +2,7 @@ Quad's site + diff --git a/main.js b/main.js index e1871ee..87f454e 100755 --- a/main.js +++ b/main.js @@ -7,13 +7,12 @@ const button1 = document.getElementById('button1'); const button2 = document.getElementById('button2'); const button3 = document.getElementById('button3'); -// Make the base URL a variable because it's easier if I ever move the site -const baseUrl = "https://quad.moe/test/"; - // Create variables that will get populated by loadContent() later -var payload1; -var payload2; -var payload3; +var page1 = "pages/about.html"; +var page2 = "pages/about.html"; +var page3 = "pages/about.html"; + +const spinner = ''; // Very bad function to get rid of the "active" class wherever it is atm function resetButtons() { @@ -22,57 +21,22 @@ function resetButtons() { button3.className = "nav-button"; } -// Fetch all the page contents -async function loadContent(baseUrl) { - const http1 = fetch("pages/about.html"); - const http2 = fetch("pages/about.html"); - const http3 = fetch("pages/about.html"); - - const requests = [http1, http2, http3]; - - const responses = await Promise.all(requests); - - return responses; -} - function setContent(navbutt, payload) { - document.getElementById("page").innerHTML = payload; + document.getElementById("page").innerHTML = spinner; resetButtons(); navbutt.className += " active"; } -function initialContent() { - - // Get the HTML we need - - // This returns Response { type: "basic", url: "https://example.com", redirected: false... etc. - loadContent().then((res) => {console.log(res);}); - - // This returns a Promise object with : "pending" - loadContent().then((res) => {console.log(res[0].text());}); - - contents = loadContent(); - // Can't figure out how to make sure that each web request in loadContent() - // has returned proper HTML before it actually proceeds executing the rest of this funciton - - // Then store the text only for later use - payload1 = contents[0].text(); - payload2 = contents[1].text(); - payload3 = contents[2].text(); - - console.log(payload1); +function initialContent() { // Slap on all the event listeners button1.addEventListener('click', function() { - setContent(button1, payload1); + setContent(button1, page1); }, false); button2.addEventListener('click', function() { - setContent(button2, payload2); + setContent(button2, page2); }, false); button3.addEventListener('click', function() { - setContent(button3, payload3); + setContent(button3, page3); }, false); - - // And finally enable the first tab - setContent(button1, payload1); } diff --git a/style.css b/style.css index 754292b..7f7f455 100755 --- a/style.css +++ b/style.css @@ -98,6 +98,14 @@ h1, h2, h3, h4, h5, p { margin-bottom: 50px; } +.loading { + font-size: 26pt; + color: #FF5555; + text-align: center; + margin-top: 50px; + margin-bottom: 50px; +} + .notice { color: #3b3b3b; text-align: right;