-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinal.html
100 lines (85 loc) · 3.37 KB
/
final.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<title>My Little Coding Shop</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Custom styles for this template -->
<link href="jumbotron.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="final.html">My Little Coding Shop</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="final.html">Shop</a></li>
<li><a href="final_basket.html">Basket £<span id="total"></span></a></li>
</ul>
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>My Little Coding Shop</h1>
<p>
The best coding resources avaliable for puchase online.
</p>
<p><a class="btn btn-primary btn-lg" role="button" href="final_shop.html">Shop Now »</a></p>
</div>
</div>
<div class="container text-center">
<!-- Example row of columns -->
<div class="row">
<h2>Our products</h2>
<div class="col-md-4">
<img src="images/style.jpg">
<p>A very style-ish tee. Get it?</p>
<a title="Style tee" price="17.90" class="item btn btn-default" href="#" role="button">£17.90 Add to cart</a>
</div>
<div class="col-md-4">
<img src="images/jsbook.jpg">
<p>A great book on JavaScript and jQuery</p>
<a title="JS Book" price="21.20" class="item btn btn-default" href="#" role="button">£21.20 Add to cart</a>
</div>
<div class="col-md-4">
<img src="images/github.jpg">
<p>Grab your GitHub membership now!</p>
<a title="GitHub membership" price="5.00" class="item btn btn-default" href="#" role="button">£5.00 Add to cart</a>
</div>
</div>
<hr>
<footer>
<p>© Coding Shop 2014</p>
</footer>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<script>
var total = localStorage.getItem('total') || 0.00;
var items = JSON.parse(localStorage.getItem('items')) || [];
function handleClick() {
var price = parseFloat($(this).attr('price'));
var title = $(this).attr('title');
total = parseFloat(total);
total = total + price;
total = total.toFixed(2);
localStorage.setItem('total', total);
items.push({title: title, price: price});
localStorage.setItem('items', JSON.stringify(items));
$('#total').text(total);
}
$('.item').click(handleClick);
$('#total').text(total)
</script>
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>