-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (33 loc) · 1.14 KB
/
script.js
File metadata and controls
38 lines (33 loc) · 1.14 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
35
36
37
38
// Fungsi utama untuk pindah halaman biasa
function nextPage(pageNumber) {
const currentPage = document.querySelector('.dynamic-page.active');
if (currentPage) {
currentPage.classList.remove('active');
}
const targetPage = document.getElementById(`page-${pageNumber}`);
if (targetPage) {
targetPage.classList.add('active');
}
}
// Fungsi kalau di Halaman 2 jawab "Tidak" (Tanya kenapa)
function showSakitPage() {
const currentPage = document.querySelector('.dynamic-page.active');
if (currentPage) {
currentPage.classList.remove('active');
}
const sakitPage = document.getElementById('page-sakit');
if (sakitPage) {
sakitPage.classList.add('active');
}
}
// Fungsi kalau di Halaman 4 jawab "Tidak" (Reminder makan)
function showReminderPage() {
const currentPage = document.querySelector('.dynamic-page.active');
if (currentPage) {
currentPage.classList.remove('active');
}
const reminderPage = document.getElementById('page-reminder');
if (reminderPage) {
reminderPage.classList.add('active');
}
}