diff --git a/starter-code/index.html b/starter-code/index.html index 189a3311..83d9c2b9 100755 --- a/starter-code/index.html +++ b/starter-code/index.html @@ -17,19 +17,19 @@

Pizza Builder

@@ -37,241 +37,249 @@

Pizza Builder

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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
-
-
- -
-
31
-
-
- -
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
-
33
- -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
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
+
+
+ +
+
31
+
+
+
+ +
+
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
+
33
+
+ +
-
+
+
diff --git a/starter-code/pizza.css b/starter-code/pizza.css index 2d125b3d..5dac7592 100755 --- a/starter-code/pizza.css +++ b/starter-code/pizza.css @@ -25,7 +25,10 @@ header, section, footer, article, details { body { line-height: 1; color: black; - background: white; + background-image: url("https://images.pexels.com/photos/1087897/pexels-photo-1087897.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"); + background-position: bottom; + background-repeat: no-repeat; + background-size: cover; } ol, ul { diff --git a/starter-code/pizza.js b/starter-code/pizza.js index b473d048..449e74a4 100755 --- a/starter-code/pizza.js +++ b/starter-code/pizza.js @@ -1 +1,90 @@ // Write your Pizza Builder JavaScript in this file. + +$("document").ready(function(){ + + $("#pep, #mushroom, #green-pepper").hide() + $(".green-pepper-price, .pepperonni-price, .mushroom-price, .white-sauce-price, .gluten-free-price").hide(); + + + function updatePrice() { + + var money = 10; + + if ($(".btn-pepperonni").hasClass("active")) { + money++; + $(".money").html(money); + } else { + $(".money").html(money); + }; + + if ($(".btn-mushrooms").hasClass("active")) { + money++; + $(".money").html(money); + } else { + $(".money").html(money); + }; + + if ($(".btn-green-peppers").hasClass("active")) { + money++; + $(".money").html(money); + } else { + $(".money").html(money); + }; + + if ($(".btn-sauce").hasClass("active")) { + money = money + 3; + $(".money").html(money); + } else { + $(".money").html(money); + }; + + if ($(".btn-crust").hasClass("active")) { + money = money + 5; + $(".money").html(money); + } else { + $(".money").html(money); + }; + + }; + + $(".btn-pepperonni").click(function() { + $("#pep").toggle(); + $(".btn-pepperonni").toggleClass("active"); + $(".pepperonni-price").toggle(); + // $(".price").html(); + + updatePrice(); + }); + + $(".btn-mushrooms").click(function() { + + $("#mushroom").toggle(); + $(".btn-mushrooms").toggleClass("active"); + $(".mushroom-price").toggle(); + + updatePrice(); + }); + + $(".btn-green-peppers").click(function() { + $("#green-pepper").toggle(); + $(".btn-green-peppers").toggleClass("active"); + $(".green-pepper-price").toggle(); + updatePrice(); + }); + + $(".btn-crust").click(function() { + $(".crust").toggleClass("crust-gluten-free"); + $(".btn-crust").toggleClass("active"); + $(".gluten-free-price").toggle(); + updatePrice(); + }); + + $(".btn-sauce").click(function(){ + $(".sauce").toggleClass("sauce-white"); + $(".btn-sauce").toggleClass("active"); + $(".white-sauce-price").toggle(); + updatePrice(); + }); + +}); +