Skip to content

Commit

Permalink
Better popups on request page
Browse files Browse the repository at this point in the history
  • Loading branch information
clj13001 committed Dec 2, 2016
1 parent c250299 commit 37a59f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
14 changes: 11 additions & 3 deletions html/javascript/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ function addToCart(){
var cart = getCartItems(); //this is an array
cart.push(id); //push to bottom of cart
localStorage.setItem('cart', JSON.stringify(cart));
$('#added').fadeIn(1000);
$('#added').fadeIn(1000);
$('#added').fadeOut(1000);
}
else{
$('#already').fadeIn(1000);
$('#already').fadeIn(1000);
$('#already').fadeOut(1000);
}
else
alert("That item is already in your cart!");
}

function inCart(id){
Expand Down Expand Up @@ -137,4 +143,6 @@ function isUnavailable(id){
}
}
return 0;
}
}

//this code allows a message to appear that indicates that the item was successfully placed in the shopping cart.
24 changes: 23 additions & 1 deletion html/webpages/requestPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<title>Synchrony Financial</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel = "stylesheet" type = "text/css" href = "../css/stylesheet.css">
<style>
Expand Down Expand Up @@ -56,6 +56,20 @@
background-color: #E9EAEB;
}

div.cartConfirm{
display: none;
top: 50%;
left: 50%;
position: fixed;
width: 100px;
height: 70px;
line-height: 70px;
text-align: center;
background-color: #FBC600;
border: solid;
border-color: #3B3C43;
}

ul.nav{
padding: 0px;
}
Expand Down Expand Up @@ -84,6 +98,14 @@ <h4>Operating Systems</h4>
<h2>Available Devices</h2>
<div id = "devContainer"></div>
</div>

<div class = "cartConfirm" id = "added">
<p>Added to Cart</p>
</div>

<div class = "cartConfirm" id = "already">
<p>Already in Cart</p>
</div>

<script src="../javascript/request.js"></script>
<script src = "../javascript/navbar.js"></script>
Expand Down

0 comments on commit 37a59f0

Please sign in to comment.