From 9049445a5683967d8fecda7b245fdb71c0a13ff2 Mon Sep 17 00:00:00 2001 From: pkzstar Date: Mon, 29 Apr 2024 14:01:37 -0500 Subject: [PATCH] black market --- indexEventsList.js | 9 +++++++ script.js | 59 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/indexEventsList.js b/indexEventsList.js index 75ccdf7..223efe2 100644 --- a/indexEventsList.js +++ b/indexEventsList.js @@ -147,6 +147,15 @@ const eventsData = [ link: "https://www.start.gg/tournament/invincible-viii/details", rankImg: false }, + { + name: "The Black Market", + date: "6/22/24", + location: "Calgary, AB, Canada", + description: "A celebration of Smash Bros. fan games!Featuring HDR Singles, HDR Doubles and P+ Singles as paid events, along with plenty of free side events such as HDR Amateur brackets, Smash Remix, Rivals of Aether and Sonic Adventure 2!", + imageUrl: "https://github.com/pkzstar/plus-side/blob/main/images/upcoming%20events/blackmarket.png?raw=true", + link: "https://www.start.gg/tournament/the-black-market/details", + rankImg: false + }, { name: "SUPER CLOUDY SCUFFLE", date: "6/22/24", diff --git a/script.js b/script.js index 0677dc2..d71a9d2 100644 --- a/script.js +++ b/script.js @@ -290,22 +290,65 @@ function showCalendar(month, year) { link.appendChild(image); cell.appendChild(link); - //SUPER CLOUDY SCUFFLE + //SUPER CLOUDY SCUFFLE & Black Market } else if(month === 5 && date === 22 && year === 2024) { - // Example link with image + + const events = [ + { + link: "https://www.start.gg/tournament/super-cloudy-scuffle-a-durham-regional/details", + imageSrc: "https://github.com/pkzstar/HDReport/blob/main/images/upcoming%20events/super%20cloudy%20scuffle.png?raw=true" + + }, + { + link: "https://www.start.gg/tournament/the-black-market/details", + imageSrc: "https://github.com/pkzstar/plus-side/blob/main/images/upcoming%20events/blackmarket.png?raw=true" + } + ]; + let currentIndex = 0; // Initialize current index + let link = document.createElement("a"); - link.href = "https://www.start.gg/tournament/super-cloudy-scuffle-a-durham-regional/details"; link.target = "_blank"; - + let image = document.createElement("img"); - image.src = "https://github.com/pkzstar/HDReport/blob/main/images/upcoming%20events/super%20cloudy%20scuffle.png?raw=true"; - + image.classList.add("calendarImg"); - - + link.appendChild(image); cell.appendChild(link); + // Function to fade in/out the image and link + function fadeInOut(element) { + let opacity = 0; + let increasing = true; + let interval = setInterval(function() { + if (increasing) { + opacity += 0.05; + } else { + opacity -= 0.05; + } + element.style.opacity = opacity; + if (opacity >= 1) { + increasing = false; + setTimeout(() => { + increasing = true; + updateLinkAndImage(); // Update link and image after fully visible + }, 2000); // Image and link will be fully visible for 2 seconds before fading out + } else if (opacity <= 0) { + clearInterval(interval); + fadeInOut(element); // Restart the fading animation + } + }, 100); // Adjust the timing as needed + } + + // Function to update the link and image + function updateLinkAndImage() { + link.href = events[currentIndex].link; + image.src = events[currentIndex].imageSrc; + currentIndex = (currentIndex + 1) % events.length; // Move to the next event, looping back to the beginning if necessary + } + + updateLinkAndImage(); // Initially update link and image + fadeInOut(image); // Start fade-in/out animation // Start cycling events //Undertow 2024 } else if (month === 8 && (date === 6 || date === 7 || date === 8) && year === 2024) {