-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
169 lines (147 loc) · 5.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<html>
<head>
<title>Namma Organic Store</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="description" content="Organic Vegetables and Grocery">
<meta property="og:title" content="Namma Organic Store"/>
<meta property="og:url" content="https://nammaorganic.netlify.app/"/>
<meta property="og:description" content="Organic Vegetables and Grocery">
<meta property="og:image" content="/codefiles/assets/ogicon.png">
<meta property="og:type" content="website" />
<meta name="twitter:card" content="app"></meta>
<meta property="twitter:image" content="/codefiles/assets/ogbg.png">
<link rel="shortcut icon" type="image/png" href="/codefiles/assets/icon.png"/>
<link rel="stylesheet" type="text/css" href="/codefiles/css/main.css"/>
<script src="/codefiles/js/hnav.js"></script>
<!--
<script src="/codefiles/js/papaparse.min.js"></script>
-->
<script src="/codefiles/js/tabletop.min.js"></script>
<script src="/codefiles/js/vue.min.js"></script>
<script src="/codefiles/js/main.js"></script>
</head>
<body onload="init()">
<div id="loading">
<img src="/codefiles/assets/icon.png"><br>
<h2>Loading</h2>
</div>
<div id="app">
<header>
<a href="#home">
<strong> Namma Organic Store </strong>
</a>
<a href="#home" v-if="page=='shop'" style="color: var(--theme);">
HOME
</a>
<a href="#shop" v-else style="color: var(--theme);">
SHOP
</a>
</header>
<section id="home" class="hnav">
<h3>
Organic Vegetables and Grocery
<br>
</h3>
<a href="#shop" class="btn">Order now</a>
<br><br><br>
<img src="/inventory/images/map.svg">
<br>
<p>36, 7th Cross, 6th Main, Malleshwaram</p>
<a href="https://www.google.com/maps/place/Namma+Organic+Store/@12.9980882,77.5672775,18z/data=!4m8!1m2!2m1!1s36,+7th+Cross,+6th+Main,+Malleshwaram!3m4!1s0x3bae16310cd4d1ad:0xe5ec1852cd223d82!8m2!3d12.9982613!4d77.5670685" class="btn">Open in Maps</a>
</section>
<section id="shop" class="hnav" hnav:start>
<p>
<input type="name" id="searchquery" v-on:input="filter_items" placeholder="Search" autocomplete="off">
<select v-model="activeCategory" v-on:change="filter_items" style="text-align-last: right;">
<option value="All Categories">All Categories</option>
<option v-for="category in categories" v-bind:value="category">
{{category}}
</option>
</select>
</p>
<div v-bind:empty-message="'No matching items in '+activeCategory">
<shop-item
v-for="i in items"
v-bind:name="i.Name"
v-bind:farm="i['Farm Name']"
v-bind:image="i.Image"
v-if="i.match && i['In Stock']=='yes'"
v-bind:description="i.Description"
v-bind:unitprice="i['Unit Price']"
v-bind:unit="i['Unit']"
v-bind:instock="i['In Stock']"
v-model:value="i.quantity"
>
</shop-item>
</div>
</section>
<section id="checkout" class="hnav" hnav:on="app.cartpage=true;" hnav:off="app.cartpage=false;">
<h1>Your Cart</h1>
<button v-if="nitems!=0" onclick="goToOrder()">Review & Place Order</button><br>
<shop-item
v-for="i in items"
v-if="i.quantity>0"
v-bind:name="i.Name"
v-bind:farm="i['Farm Name']"
v-bind:description="i.Description"
v-bind:unitprice="i['Unit Price']"
v-bind:unit="i['Unit']"
v-bind:instock="i['In Stock']"
v-model:value="i.quantity"
v-bind:compact="true"
>
</shop-item>
<div v-if="nitems==0">
Your cart is empty
</div>
<div v-else id="placeorder">
<span>Total: {{settings.currency}}{{carttotal}}</span>
<h2>Place order</h2>
<input type="text" v-model="name" placeholder="(Your Name)"><br>
<textarea v-model="address" placeholder="(Your Address)"></textarea>
<button v-on:click="orderwa">Order Via WhatsApp</button><br>
</div>
</section>
<div id="footer" v-if="nitems>0 && !cartpage">
<span>{{nitems}} item<span v-if="nitems>1">s</span> in cart</span>
<a href="#checkout">Checkout</a>
</div>
</div>
<script type="text/x-template" id="shop-item-template">
<div class="shopitem" v-bind:class="{compact:compact}">
<img
class="image-holder"
style="grid-area: 1 / 1 / 4 / 2;"
v-bind:src="image"
/>
<span class="name">
{{name}}
<br v-if="!compact">
<span v-if="!compact" style="color: var(--fg);">{{farm}}</span>
</span>
<span class="price">{{$parent.settings.currency}}{{unitprice}}/{{unit}}</span>
<div style="grid-area: 3 / 2 / 4 / 3;" v-if="instock=='yes' && value<=0">
<button v-on:click="increment" class="addtocart" style="width: 100%; padding: 0.5mm 3mm; font-size: 80%;">Add to cart</button>
</div>
<div style="grid-area: 3 / 2 / 4 / 3;" v-else-if="instock!='yes'">
<span style="grid-area: 3 / 2 / 4 / 3;" class="outofstock">Out of Stock</span>
</div>
<div class="qctrl" v-else>
<span class="icon" v-on:click="decrement">r</span>
<span class="qty-display">{{value}}</span>
<span class="icon" v-on:click="increment">a</span>
</div>
<span class="total"
style="justify-self: right; padding-right: 5mm;"
v-if="value>0">
{{$parent.settings.currency}}{{(value*unitprice).toFixed(2)}}
</span>
<details v-if="!compact && $root.settings.showDescription" style="grid-area: 4 / 1 / 5 / 4 ;">
<summary>Description</summary>
{{description}}
</details>
</div>
</script>
</body>
</html>