From 7ece72a4ada95cd414db30f94eabb35eded05c25 Mon Sep 17 00:00:00 2001 From: pkzstar Date: Wed, 18 Sep 2024 23:45:23 -0500 Subject: [PATCH] smym + beachin date fix --- Calendar/Calendar.js | 60 ++++++++++++++++++++++++++++++++----- index js/indexEventsList.js | 11 +++++++ 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/Calendar/Calendar.js b/Calendar/Calendar.js index 5185481..881117b 100644 --- a/Calendar/Calendar.js +++ b/Calendar/Calendar.js @@ -1856,7 +1856,7 @@ function showCalendar(month, year) { // Beachin - } else if (month === 10 && (date === 9) && year === 2024) { + } else if (month === 10 && (date === 1 || date === 2 || date === 3) && year === 2024) { let link = document.createElement("a"); @@ -1872,22 +1872,66 @@ function showCalendar(month, year) { link.appendChild(image); cell.appendChild(link); - //Homecoming + //Homecoming & show me your moves } else if (month === 10 && (date === 9) && year === 2024) { + const events = [ + { + link: "https://smashboards.com/threads/homecoming-p-hdr-nov-9th-2024.523550/", + imageSrc: "https://github.com/pkzstar/plus-side/blob/main/images/upcoming%20events/homecominglogo.png?raw=true" + }, + { + link: "https://www.start.gg/tournament/show-me-your-moves-24-1/details", + imageSrc: "https://www.bing.com/th?pid=Sgg&qlt=100&u=https%3A%2F%2Fimages.start.gg%2Fimages%2Ftournament%2F698361%2Fimage-d2e2c3e64de1dc9428c9460ea5c42180-optimized.jpg&ehk=i1VdSzAZQGuklEvHYhFum3SBQvSjxHcoDLlRYbWuOKA%3D&w=280&h=280&r=0" + } + ]; + let currentIndex = 0; // Initialize current index + let link = document.createElement("a"); - link.href = "https://smashboards.com/threads/homecoming-p-hdr-nov-9th-2024.523550/"; link.target = "_blank"; - + let image = document.createElement("img"); - image.src = "https://github.com/pkzstar/plus-side/blob/main/images/upcoming%20events/homecominglogo.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 + } //BL9 else if (month === 10 && (date === 16 || date === 17) && year === 2024) { diff --git a/index js/indexEventsList.js b/index js/indexEventsList.js index e0b456b..c06c859 100644 --- a/index js/indexEventsList.js +++ b/index js/indexEventsList.js @@ -272,6 +272,17 @@ const eventsData = [ trailer: "", stream: "" }, + { + name: "Show Me Your Moves 24", + date: "11/9/24", + location: "Urbana, IL, USA", + description: "Show Me Your Moves features Super Smash Bros. Melee and Super Smash Bros. Ultimate as always, and we're thrilled to be bringing you Project+ once more!", + imageUrl: "https://www.bing.com/th?pid=Sgg&qlt=100&u=https%3A%2F%2Fimages.start.gg%2Fimages%2Ftournament%2F698361%2Fimage-d2e2c3e64de1dc9428c9460ea5c42180-optimized.jpg&ehk=i1VdSzAZQGuklEvHYhFum3SBQvSjxHcoDLlRYbWuOKA%3D&w=280&h=280&r=0", + link: "https://www.start.gg/tournament/show-me-your-moves-24-1/details", + rankImg: false, + trailer: "", + stream: "" + }, { name: "Blacklisted 9", date: "11/16/24 - 11/17/24",