forked from vuejsdevelopers/poster-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (74 loc) · 3.6 KB
/
index.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
<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="referrer" content="never" />
<title>Vue.js Poster Shop</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="/public/favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,700,800" rel="stylesheet"
type="text/css">
<link href="https://fonts.googleapis.com/css?family=Baloo+Bhaina" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/public/style.css">
</head>
<body>
<div id="app">
<div class="header">
<div class="container">
<div class="title">
<img src="public/logo.png">
<h1>Vue.js Poster Shop</h1>
</div>
<form class="search-bar" @submit.prevent="onSubmit">
<input type="text" placeholder="Search for posters" required v-model="search">
<input type="submit" value="Search" class="btn">
</form>
<p>Try search terms <em>cat, dog, flower</em></p>
</div>
</div>
<div class="main container">
<div class="products">
<div class="" v-if="loading">Loading...</div>
<div v-else-if="products.length" class="search-results">Found {{products.length}} results for search
term →
<em class="green">{{lastSearch}}</em>.
</div>
<div class="product" v-for="product in products" :key="product.id">
<div class="">
<div class="product-image">
<img :src="product.thumb" alt="">
</div>
</div>
<div class="">
<h4 class="product-title">{{product.title}}</h4>
<p class="product-price"><strong>{{product.price | currency}}</strong></p>
<button @click="addToCart(product)" class="btn add-to-cart">add to cart</button>
</div>
</div>
<div id="product-list-bottom"></div>
</div>
<div class="cart">
<h2>Shopping Cart</h2>
<div v-if="cart.length === 0" class="empty-cart">No items in the cart</div>
<transition-group tag='ul' name="fade">
<li v-for="item in cart" :key="item.id" class="cart-item">
<div class="item-title">{{item.title}}</div>
<span class="item-qty">{{item.price | currency}} x {{item.qty}}</span>
<button class="btn btn-w" @click="inc(item)">+</button>
<button class="btn btn-w" @click="dec(item)">-</button>
</li>
</transition-group>
<transition name="fade">
<div v-if="cart.length" class="cart-total">Total: {{total | currency}}</div>
</transition>
</div>
</div>
</div>
<!-- Scripts -->
<script src="/reload/reload.js"></script>
<script type="text/javascript" src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/vue-resource/dist/vue-resource.js"></script>
<script type="text/javascript" src="node_modules/scrollmonitor/scrollMonitor.js"></script>
<script type="text/javascript" src="public/script.js"></script>
</body>
</html>