-
Notifications
You must be signed in to change notification settings - Fork 0
/
buttons.js
26 lines (23 loc) · 902 Bytes
/
buttons.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function redirectToPage(url) {
window.open(url, '_blank');
}
function setupButtonListeners() {
const buttons = {
button_one: 'https://end-us3r.github.io/Inked-Art-Homepage-Project/',
button_two: 'https://end-us3r.github.io/Message-Generator/',
button_three: 'projects-folder/coffeeBot.html',
button_four: 'projects-folder/gpaCalculator.html',
button_five: 'projects-folder/boredlessTourist.html',
button_six: 'projects-folder/rps.html',
button_seven: 'projects-folder/nightmareGame.html',
};
for (const buttonId in buttons) {
buttonElement = document.getElementById(buttonId);
if (buttonElement) {
buttonElement.addEventListener('click', () => {
redirectToPage(buttons[buttonId]);
});
}
}
}
document.addEventListener('DOMContentLoaded', setupButtonListeners);