animation stuff works!

This commit is contained in:
CatAClock 2025-05-25 19:31:47 -07:00
parent 66dfbb6372
commit faba7267e8
2 changed files with 14 additions and 4 deletions

View file

@ -26,11 +26,11 @@
} }
@keyframes Next { @keyframes Next {
0% { 0% {
left: 0vw; left: 85vw;
} }
100% { 100% {
left: -85vw; left: 0vw;
} }
} }
@ -44,11 +44,11 @@
} }
@keyframes Back { @keyframes Back {
0% { 0% {
left: 0vw; left: -85vw;
} }
100% { 100% {
left: 85vw; left: 0vw;
} }
} }

View file

@ -92,6 +92,7 @@ function Music() {
// Clicking the next button // Clicking the next button
ArrowsButton[1].onclick = (event) => { ArrowsButton[1].onclick = (event) => {
if (!ContainerContainer.classList.contains("NextAnimation")) { if (!ContainerContainer.classList.contains("NextAnimation")) {
UpdateOtherContainers(1);
ContainerContainer.classList.add("NextAnimation"); ContainerContainer.classList.add("NextAnimation");
ButtonSound.play(); ButtonSound.play();
setTimeout(() => { setTimeout(() => {
@ -104,6 +105,7 @@ ArrowsButton[1].onclick = (event) => {
// Clicking the back button // Clicking the back button
ArrowsButton[0].onclick = (event) => { ArrowsButton[0].onclick = (event) => {
if (!ContainerContainer.classList.contains("BackAnimation")) { if (!ContainerContainer.classList.contains("BackAnimation")) {
UpdateOtherContainers(3);
ContainerContainer.classList.add("BackAnimation"); ContainerContainer.classList.add("BackAnimation");
ButtonSound.play(); ButtonSound.play();
setTimeout(() => { setTimeout(() => {
@ -113,6 +115,14 @@ ArrowsButton[0].onclick = (event) => {
} }
} }
function UpdateOtherContainers(Num) {
let Posts = ContainerContainer.getElementsByClassName("PostContainer")[Num].children;
for (let i = 0; i < ClickableContainers.length; i++) {
Posts[i].getElementsByClassName("Username")[0].innerHTML = ClickableContainers[i].getElementsByClassName("Username")[0].innerHTML;
Posts[i].getElementsByClassName("PostContent")[0].innerHTML = ClickableContainers[i].getElementsByClassName("PostContent")[0].innerHTML;
}
}
// These numbers are here so you don't go back. // These numbers are here so you don't go back.
let MastodonLoadedFeed = []; let MastodonLoadedFeed = [];
let BlueskyLoadedFeed = []; let BlueskyLoadedFeed = [];