-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5da9dc5
commit ef1f66e
Showing
8 changed files
with
390 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
|
||
const toggleBtn = document.querySelector(".toggle-btn"); | ||
const toggleArea = document.querySelector(".toggle-area"); | ||
const basicPrice = document.querySelector(".price-1"); | ||
const profPrice = document.querySelector(".price-2"); | ||
const masterPrice = document.querySelector(".price-3"); | ||
|
||
toggleArea.addEventListener("click", function (e) { | ||
e.preventDefault(); | ||
if (toggleArea.classList.contains("monthly")) { | ||
toggleArea.classList.remove("monthly"); | ||
toggleArea.classList.add("anually"); | ||
basicPrice.innerHTML = `<p class="price-1"> <span class="dollar-sign">$</span>199.99</p>`; | ||
profPrice.innerHTML = ` <p class="price-2"> <span class="dollar-sign">$</span>249.99</p>`; | ||
masterPrice.innerHTML = ` <p class="price-3"> <span class="dollar-sign">$</span>399.99</p>`; | ||
} else { | ||
toggleArea.classList.add("monthly"); | ||
toggleArea.classList.remove("anually"); | ||
basicPrice.innerHTML = `<p class="price-1"> <span class="dollar-sign">$</span>19.99</p>`; | ||
profPrice.innerHTML = ` <p class="price-2"> <span class="dollar-sign">$</span>24.99</p>`; | ||
masterPrice.innerHTML = ` <p class="price-3"> <span class="dollar-sign">$</span>39.99</p>`; | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="description" content="Frontend Mentor - Pricing Component With Toggle"> | ||
<meta name="keywords" content="Pricing Component With Toggle, Frontend Mentor"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png"> | ||
<link rel="stylesheet" href="styles.css"> | ||
<title>Pricing Component With Toggle</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<header> | ||
<h1> Our Pricing</h1> | ||
<nav> | ||
<p>Annually</p> | ||
<button class="toggle-area monthly"> | ||
<div class="toggle-btn"></div> | ||
</button> | ||
<p>Monthly</p> | ||
</nav> | ||
</header> | ||
<main> | ||
<section class="pricing-container"> | ||
<!-- Container 1 --> | ||
<article class="pricing container-1"> | ||
<h2>Basic</h2> | ||
<p class="price-1"><span class="dollar-sign">$</span>19.99</p> | ||
<ul> | ||
<hr> | ||
<li> 500 GB Storage</li> | ||
<hr> | ||
<li> 2 Users Allowed</li> | ||
<hr> | ||
<li> Send up to 3 GB</li> | ||
<hr> | ||
</ul> | ||
<button>Learn more</button> | ||
</article> | ||
<!-- Container 2 --> | ||
<article class="pricing container-2"> | ||
<h2>Professional</h2> | ||
<p class="price-2"> <span class="dollar-sign">$</span>24.99</p> | ||
<ul> | ||
<hr> | ||
<li> 1 TB Storage</li> | ||
<hr> | ||
<li> 5 Users Allowed</li> | ||
<hr> | ||
<li> Send up to 10 GB</li> | ||
<hr> | ||
</ul> | ||
<button>Learn more</button> | ||
</article> | ||
<!-- Container 3 --> | ||
<article class="pricing container-3"> | ||
<h2>Master</h2> | ||
<p class="price-3"><span class="dollar-sign">$</span>39.99</p> | ||
<ul> | ||
<hr> | ||
<li> 2 TB Storage</li> | ||
<hr> | ||
<li>10 Users Allowed</li> | ||
<hr> | ||
<li> Send up to 20 GB</li> | ||
<hr> | ||
</ul> | ||
<button>Learn more</button> | ||
</article> | ||
</section> | ||
</main> | ||
|
||
<script src="app.js"></script> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.