-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHomepage.html
More file actions
210 lines (183 loc) · 8.02 KB
/
Homepage.html
File metadata and controls
210 lines (183 loc) · 8.02 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!--BOOTSTRAP CDN-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!--PARSE SDK-->
<script src="https://unpkg.com/parse/dist/parse.min.js"></script>
<!--CUSTOM STYLESHEET-->
<link rel="stylesheet" href="css/onports-custom.css">
<!--OWL CAROUSEL-->
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
<title>Homepage | onports</title>
</head>
<body>
<!--Main Navigation-->
<nav class="navbar navbar-expand-md navbar-light">
<a class="navbar-brand" href="#">onports</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#CollapsedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="CollapsedContent">
<ul class="navbar-nav ml-auto">
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search anything in onports!" aria-label="Search">
<button class="btn my-2 my-sm-0" type="submit">Login</button>
<button class="btn my-2 my-sm-0" type="submit">Register</button>
</form>
</ul>
</div>
</nav>
<!--Categories Navigation-->
<nav class="nav">
<a class="nav-link" href="#">Where to Deliver?<span id="locate-me">Locate Me</span></a>
<a class="nav-link" href="#">General Stores</a>
<a class="nav-link" href="#">Clothing</a>
<a class="nav-link" href="#">Electronics</a>
<a class="nav-link" href="#">Food</a>
<a class="nav-link" href="#">Lifestyle</a>
</nav>
<!--Advertisement Carousel-->
<div id="newOffersAdvertisement">
<div class="container-fluid">
<div class="row">
<div class="owl-carousel owl-theme" id="newOffersAd">
<!--Offers Advertisement Here!-->
</div>
</div>
</div>
</div>
<!--Shops Carousel-->
<div id="findShopsNearYou">
<div class="container-fluid">
<h3 class="heading">Find Shops Near You.</h3>
<div class="row">
<div class="owl-carousel owl-theme" id="findShops">
<!--Find Shops Near You-->
</div>
</div>
</div>
</div>
<br>
<hr class="divider">
<br>
<!--Latest Products-->
<div id="latestProducts">
<div class="container-fluid">
<h3 class="heading">Latest Products</h3>
<div class="row" id="productContainer">
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<!--OWL CAROUSEL-->
<script src="js/owl.carousel.min.js"></script>
<script>
let newOffersAds = $('#newOffersAd').owlCarousel({
loop:true,
margin:10,
autoplay:true,
navigation:true,
singleItem:true,
responsive:{
0:{
items:1
},
600:{
items:1
},
1000:{
items:1
}
}
});
let findByShops = $('#findShops').owlCarousel({
loop:true,
margin:-40,
autoWidth:false,
navigation:true,
singleItem:true,
responsive:{
350:{
items:1
},
400:{
items:2
},
700:{
items:3
},
800:{
items:3
},
1000:{
items:4
},
1100:{
items:5
}
}
});
Parse.initialize("PgKKTeokkD5m9RwFUsdumjY4nik1KnYDtkW5LwGI", "rdCO861N9xGCA7N2waGl1yzShT8XvHTRGHimBfYz");
Parse.serverURL = "https://parseapi.back4app.com/";
var findOffers = new Parse.Query('Offers');
findOffers.find().then(function(result){
for(let i= 0; i < result.length; i++){
let offerImg = result[i].get("offerImage").url();
newOffersAds.trigger('add.owl.carousel','<div class="item"><img src="'+offerImg+'"></div>');
newOffersAds.trigger('refresh.owl.carousel');
}
});
var findShops = new Parse.Query('Shops');
findShops.find().then(function(result){
for(let i= 0; i < result.length; i++){
let shopImage = result[i].get('shopImage').url();
let shopName = result[i].get('shopName');
let shopAdd = result[i].get('shopAddress');
findByShops.trigger('add.owl.carousel',
'<div class="shop" style="width: 240px; margin-right: 10px;">'+
'<img src="'+shopImage+'">'+
'<h5 class="shop-name">'+shopName+'</h5>'+
'<h6 class="shop-add">'+shopAdd+'</h6>'+
'</div>');
findByShops.trigger('refresh.owl.carousel');
}
});
let productContainer = document.getElementById('productContainer');
let output = '';
let latestProducts = new Parse.Query('Products');
latestProducts.find().then(function(result){
for(let i in result){
let productImage = result[i].get('productImage').url();
let productName = result[i].get('productName');
let productMRP = result[i].get('productMRP');
let productOurPrice = result[i].get('productOnportsPrice');
output += `
<div class="col-6 col-sm-6 col-md-3 col-lg-3 col-xl-2">
<div class="product-wrapper">
<div class="product-image">
<a href="#"><img class="product-image-inside" src="${productImage}" alt="Product Image"></a>
</div>
<div class="product-name">
<h6 class="product-name">${productName}</h6>
</div>
<div class="product-price-box">
<span class="product-mrp-tag">MRP</span>
<span class="product-market-price">₹${productMRP}</span>
<span class="product-onports-price">₹${productOurPrice}</span>
</div>
</div>
</div>
`;
}
productContainer.innerHTML = output;
});
</script>
</body>
</html>