homepage/res/index.js
2020-10-04 22:48:57 +03:00

33 lines
No EOL
926 B
JavaScript

const onButtonClick = (buttonId) => {
switch (buttonId) {
case 'button-home': {
A('#content-container').load('/pages/home.html');
break;
}
case 'button-file-server': {
A('#content-container').load('https://files.hippoz.xyz/');
break;
}
case 'button-git-server': {
window.location.href = 'https://git.hippoz.xyz/'
break;
}
case 'button-about-me': {
A('#content-container').load('/pages/about.html');
break;
}
case 'button-contact-me': {
A('#content-container').load('/pages/contact.html');
break;
}
}
};
A(() => {
A('#content-container').load('/pages/home.html');
A('.navigation-buttons .button-default').each((el) => {
A(el).on('click', () => {
onButtonClick(el.id);
});
})
});