-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
234 lines (216 loc) · 5.95 KB
/
main.js
File metadata and controls
234 lines (216 loc) · 5.95 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
import "./app.scss";
import Typed from 'typed.js';
import ScrollReveal from "scrollreveal";
import "waypoints/lib/noframework.waypoints";
import * as bootstrap from 'bootstrap';
let typed = new Typed('.element', {
strings: ['Dishes ...', 'Food ...'],
typeSpeed: 30,
backSpeed: 30,
backDelay:3000,
loop:true
});
let toDown = {
distance: '50px',
origin: 'top',
interval : 300,
duration : 800
};
ScrollReveal().reveal('.to-Down', toDown);
let toRight = {
distance: '50px',
origin: 'left',
interval : 300,
duration : 800
};
ScrollReveal().reveal('.to-Right', toRight);
let toLeft = {
distance: '50px',
origin: 'right',
interval : 300,
duration : 800
};
ScrollReveal().reveal('.to-Left', toLeft);
new Waypoint({
element: document.getElementById('home-content'),
handler: function(direction) {
let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
if(oldNavLink != null){
oldNavLink.classList.remove('active');
}
let currentNavLink = document.querySelector(`[href='#home']`);
currentNavLink.classList.add('active');
},
offset: "10%"
})
new Waypoint({
element: document.getElementById('about'),
handler: function(direction) {
let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
oldNavLink.classList.remove('active');
let currentNavLink = document.querySelector(`[href='#about']`);
currentNavLink.classList.add('active');
},
offset: "50%"
})
new Waypoint({
element: document.getElementById('services'),
handler: function(direction) {
let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
oldNavLink.classList.remove('active');
let currentNavLink = document.querySelector(`[href='#services']`);
currentNavLink.classList.add('active');
},
offset: "50%"
})
new Waypoint({
element: document.getElementById('menus'),
handler: function(direction) {
let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
oldNavLink.classList.remove('active');
let currentNavLink = document.querySelector(`[href='#menus']`);
currentNavLink.classList.add('active');
},
offset: "50%"
})
new Waypoint({
element: document.getElementById('contact'),
handler: function(direction) {
let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
oldNavLink.classList.remove('active');
let currentNavLink = document.querySelector(`[href='#contact']`);
currentNavLink.classList.add('active');
},
offset: "50%"
})
// let sections = ['about','services','menus','contact'];
// sections.forEach(function (section) {
// new Waypoint({
// element: document.getElementById('section'),
// handler: function (direction) {
// let oldNavLink = document.querySelector(".navbar-nav .nav-link.active, .navbar-nav .nav-link.show ");
// oldNavLink.classList.remove('active');
// let currentNavLink = document.querySelector(`[href='${section}']`);
// currentNavLink.classList.add('active');
// },
// offset: "75%"
// });
// })
let menuList =[
{
id :1,
img : "/public/img/bc-salad-2.png",
title : "Barbecue Salad",
description : "Special Delicius Dish",
price : 22.2,
currency : "$"
},
{
id :2,
img : "/public/img/fish.png",
title : "Salad with fish",
description : "Special Delicius Dish",
price : 35.3,
currency : "$"
},
{
id :3,
img : "/public/img/spanish salad-1.png",
title : "Spainish Salad",
description : "Special Delicius Dish",
price : 45.2,
currency : "$"
},
{
id :4,
img : "/public/img/kevin-s-natural-foods-heat-eat-entree-chicken-tikka-masala-37922990031062_1400x Background Removed.png",
title : "Chicken tikka masala",
description : "Special Delicius Dish",
price : 25.5,
currency : "$"
},
{
id :5,
img : "/public/img/dosa.png",
title : "Dosa",
description : "Special Delicius Dish",
price : 6,
currency : "$"
},
{
id :6,
img : "/public/img/grilled paella.png",
title : "Grilled Paellad",
description : "Special Delicius Dish",
price : 25.1,
currency : "$"
},
{
id :7,
img : "/public/img/Gulab Jamun.png",
title : "Gulab jamun",
description : "Special Delicius Dish",
price : 8.5,
currency : "$"
},
{
id :8,
img : "/public/img/poutine.png",
title : "Poutine",
description : "Special Delicius Dish",
price : 15.9,
currency : "$"
},
{
id :9,
img : "/public/img/adobo-1.png",
title : "Philippine adobo",
description : "Special Delicius Dish",
price : 35.2,
currency : "$"
},
{
id :10,
img : "/public/img/butter chicken new .png",
title : "Butter chicken",
description : "Special Delicius Dish",
price : 45,
currency : "$"
},
{
id :11,
img : "/public/img/kabab-1 .png",
title : "Kebab",
description : "Special Delicius Dish",
price : 9,
currency : "$"
},
{
id :12,
img : "/public/img/momo new.png",
title : "Momo",
description : "Special Delicius Dish",
price :10,
currency : "$"
}
];
let menuRow = document.getElementById('menuRow');
menuLists.forEach(function(menuList){
let div = document.createElement('div');
div.classList.add("col-8", "col-md-4", "col- lg-4");
div.innerHTML = `
<div class="card to-Down">
<img src="${menuList.img}" class="w-75 mx-auto d-block" alt="">
<div class="card-body">
<p class="fw-bold">${menuList.title}</p>
<p class="text-black-50 small">${menuList.description}</p>
<div class="d-flex justify-content-between align-items-center">
<p class="mb-0">${menuList.currency} ${menuList.price}</p>
<button class="btn btn-outline-primary">
<i class="bi bi-cart-plus"></i>
</button>
</div>
</div>
`;
menuRow.append(div)
})