-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
34 lines (30 loc) · 1.25 KB
/
script.js
File metadata and controls
34 lines (30 loc) · 1.25 KB
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
27
28
29
30
31
32
33
34
// script.js
document.addEventListener('DOMContentLoaded', function() {
const homePage = document.getElementById('home-page');
const thingsPage = document.getElementById('things-page');
const situationPage = document.getElementById('situation-page');
const thingsBtn = document.getElementById('things-btn');
const situationBtn = document.getElementById('situation-btn');
const backThings = document.getElementById('back-things');
const backSituation = document.getElementById('back-situation');
// Show things page
thingsBtn.addEventListener('click', function() {
homePage.classList.remove('active');
thingsPage.classList.add('active');
});
// Show situation page
situationBtn.addEventListener('click', function() {
homePage.classList.remove('active');
situationPage.classList.add('active');
});
// Go back to home from things page
backThings.addEventListener('click', function() {
thingsPage.classList.remove('active');
homePage.classList.add('active');
});
// Go back to home from situation page
backSituation.addEventListener('click', function() {
situationPage.classList.remove('active');
homePage.classList.add('active');
});
});