Skip to content

Commit

Permalink
Update pricingPage.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SF-Duijkersloot authored Jan 28, 2024
1 parent 73dc6ec commit 4b564b8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Scripts/pricingPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// FAQ click handler
// FAQ click handler //
const questionItems = document.querySelectorAll(".question-wrapper");

// simpele code om de faq sub items te openen en sluiten
questionItems.forEach(item => {
item.addEventListener("click", () => {
item.classList.toggle("open");
Expand All @@ -11,23 +12,26 @@ questionItems.forEach(item => {
});
});

// Pricing method code

// Pricing method code //
const monthlyButton = document.querySelector(".monthly-button");
const yearlyButton = document.querySelector(".yearly-button");
const backgroundDiv = document.querySelector(".button-background");
const starterPrice = document.querySelector(".starter-price");
const scalePrice = document.querySelector(".scale-price");

// code om de tekst te veranderen voor de monthly pricing scheme
monthlyButton.addEventListener("click", (e) => {
e.preventDefault();
e.preventDefault(); // default behavior van de <a> tag stoppen
starterPrice.innerHTML = '<p class="starter-price">$1,299 <span>/ month</span></p>';
scalePrice.innerHTML = '<p class="scale-price">$2,999 <span>/ month</span></p>';
backgroundDiv.classList.remove("translate-right");
backgroundDiv.classList.remove("translate-right"); // class voor de switch animation
});

// code om de tekst te veranderen voor de yearly pricing scheme
yearlyButton.addEventListener("click", (e) => {
e.preventDefault();
e.preventDefault(); // default behavior van de <a> tag stoppen
starterPrice.innerHTML = '<p class="starter-price">$14,388 <span>/ year</span></p>';
scalePrice.innerHTML = '<p class="scale-price">$32,388 <span>/ year</span></p>';
backgroundDiv.classList.add("translate-right");
backgroundDiv.classList.add("translate-right"); // class voor de switch animation
});

0 comments on commit 4b564b8

Please sign in to comment.