forked from vuejsdevelopers/vuejs-poster-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (68 loc) · 3.01 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="referrer" content="never" />
<title>Vue.js Poster Shop</title>
<link rel="icon" href="public/favicon.ico" type="image/x-icon">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Luckiest+Guy" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato|Montserrat" rel="stylesheet">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="public/style.css">
</head>
<body>
<div id="app" v-cloak>
<div class="header">
<h1>Vue.js Poster Store</h1>
<form v-on:submit.prevent="onSubmit" class="searchbar"><input v-model="currentSearch" type="search" placeholder="Search for posters..."><button class="btn" type="submit">search</button></form>
</div>
<div class="main">
<div class="products">
<p v-if="loading">Cargando...</p>
<p v-else>Mostrando {{ results.length }} resultados para búsqueda {{ lastSearch }}.</p>
<div v-for="(item, index) in products" class="product">
<div class="product-image">
<img :src=item.link class="product__image" alt="">
</div>
<div class="product-title">
<h4>{{ item.title }}</h4>
<p class="product__price">{{ price | currency }}</p>
<button type="button" v-on:click="addToKart(index)" class="btn">Add to cart</button>
</div>
</div>
<div class="product-list-end">
<p v-if="showNoMoreProducts">No más productos.</p>
</div>
</div>
<div class="cart">
<h2>Shopping Cart</h2>
<transition-group name="slidde" tag="ul" class="cart-list">
<li v-for="item in cart" class="cart-item" v-bind:key="item.id">
<h4 class="item-title product__title">{{ item.title }}</h4>
<p class="item-price product__price">{{ price | currency }} x {{ item.qty }}</p>
<button v-on:click="increment(item)" class="btn">+</button>
<button v-on:click="decrement(item)" class="btn">-</button>
</li>
</transition-group>
<transition name="fadde">
<div v-if="total">
{{ total | currency }}
</div>
</transition>
<div v-if="!total" class="empty-cart">
Your cart is empty
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script src="reload/reload.js"></script>
<script src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/pusher-js/dist/web/pusher.min.js"></script>
<script src="node_modules/vue-resource/dist/vue-resource.js"></script>
<script src="node_modules/scrollmonitor/scrollMonitor.js"></script>
<script type="text/javascript" src="public/script.js"></script>
</body>
</html>