implemented spaces, fixed login and signup, thought creation and space creation.
This commit is contained in:
@@ -1,16 +1,35 @@
|
||||
const nav = document.querySelector('nav');
|
||||
const nav_links = nav.querySelectorAll('ul li a');
|
||||
const theme_toggle = nav.querySelector('button');
|
||||
const nav = document.querySelector("nav");
|
||||
const nav_links = nav.querySelectorAll("ul li a");
|
||||
const theme_toggle = nav.querySelector("button");
|
||||
const back = document.querySelector("#backButton");
|
||||
const links = document.querySelectorAll(".fillDiv");
|
||||
|
||||
nav_links.forEach((el) => {
|
||||
el.addEventListener('click', () => {
|
||||
if (back)
|
||||
back.addEventListener("click", () => {
|
||||
console.log("back");
|
||||
history.back();
|
||||
});
|
||||
|
||||
links.forEach((el) => {
|
||||
el.addEventListener("click", () => {
|
||||
el.preventDefault();
|
||||
if ('startViewTransition' in document) {
|
||||
document.startViewTransition(() => {
|
||||
window.location.href = el.getAttribute('href');
|
||||
});
|
||||
} else {
|
||||
window.location.href = el.getAttribute('href');
|
||||
}
|
||||
applyTransition(el.getAttribute("href"));
|
||||
});
|
||||
});
|
||||
|
||||
nav_links.forEach((el) => {
|
||||
el.addEventListener("click", () => {
|
||||
el.preventDefault();
|
||||
applyTransition(el.getAttribute("href"));
|
||||
});
|
||||
});
|
||||
|
||||
function applyTransition(href) {
|
||||
if ("startViewTransition" in document) {
|
||||
document.startViewTransition(() => {
|
||||
window.location.href = href;
|
||||
});
|
||||
} else {
|
||||
window.location.href = href;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user