-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
42 lines (36 loc) · 1.22 KB
/
main.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import changePage from "./switchPages.js";
import toggle from "./year-monthToggle.js";
import planSelect from "./planSelect.js";
import check from "./add-on.js";
import { planChoice } from "./planSelect.js";
import { monthly } from "./year-monthToggle.js";
import { backBtn } from "./switchPages.js";
import { planMonthPrice } from "./planSelect.js";
import { planYearPrice } from "./planSelect.js";
const nextBtn = document.querySelector(".next-btn");
const toggleContainer = document.querySelector(".toggle-container");
const planItems = document.querySelectorAll(".plan-btn");
const addOn = document.querySelectorAll(".add-on-btn");
const checkboxes = document.querySelectorAll(".online-service");
planItems.forEach((item) => {
item.addEventListener("click", function (e) {
planSelect(e);
});
});
addOn.forEach((item) => {
item.addEventListener("click", function (e) {
check(e);
});
});
checkboxes.forEach((item) => {
item.addEventListener("click", function (e) {
check(e);
});
});
nextBtn.addEventListener("click", function () {
changePage("next", planChoice, monthly, planMonthPrice, planYearPrice);
});
backBtn.addEventListener("click", function () {
changePage("prev");
});
toggleContainer.addEventListener("click", toggle);