sync
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const nav = document.querySelector('nav');
|
||||
const nav_links = nav.querySelectorAll('ul li a');
|
||||
const theme_toggle = nav.querySelector('button');
|
||||
|
||||
nav_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');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user