-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
273 lines (258 loc) · 13.1 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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kojima</title>
<!-- style -->
<link rel="stylesheet" href="./style/reset.css">
<link rel="stylesheet" href="./style/header.css">
<link rel="stylesheet" href="./style/main.css">
<link rel="stylesheet" href="./style/products.css">
<link rel="stylesheet" href="./style/about.css">
<link rel="stylesheet" href="./style/loginReg.css">
<link rel="stylesheet" href="./style/errors.css">
<link rel="stylesheet" href="./style/cart.css">
<link rel="stylesheet" href="./style/admin.css">
<link rel="stylesheet" href="./style/profile.css">
<!-- script -->
<script src="./scripts/vue.global.js"></script>
<script src="./scripts/app.js" type="module"></script>
</head>
<body id="app">
<div class="errorsPage" v-if="errorShow">
<div class="error-background">
<p class="error-inf" style="font-size: 26px;">Oh...</p>
<p class="error-inf">{{error}}</p>
<button class="btn" @click="error = '', errorShow = false">Okay</button>
</div>
</div>
<img src="./assets/imgs/BACKGROUND.jpg" alt="backgroun-img" class="background-img" v-if="currentPage == 'Main'">
<header class="header">
<div class="container">
<nav class="header__nav">
<img src="./assets/imgs/LOGO.png" alt="logo" class="header__logo">
<div class="nav-items-container">
<a class="nav-item" @click="currentPage = 'Main'" :class='{"nav-item-active": currentPage == "Main"}'>Main</a>
<a class="nav-item" @click="currentPage = 'Products'" :class='{"nav-item-active": currentPage == "Products"}'>Products</a>
<a class="nav-item" @click="currentPage = 'About'" :class='{"nav-item-active": currentPage == "About"}'>About Us</a>
<a class="nav-item" @click="currentPage = 'Admin'" :class='{"nav-item-active": currentPage == "Admin"}' v-if="isAdmin">Admin Panel</a>
<a class="nav-item" @click="currentPage = 'Cart'" :class='{"nav-item-active": currentPage == "Cart"}' v-if="isAuth">Cart</a>
<a class="nav-item" @click="currentPage = 'Profile'" :class='{"nav-item-active": currentPage == "Profile"}' v-if="isAuth">Profile</a>
<a class="nav-item" @click="currentPage = 'Login'" :class='{"nav-item-active": currentPage == "Login"}' v-if="!isAuth">Login</a>
<a class="nav-item" @click="currentPage = 'Registration'" :class='{"nav-item-active": currentPage == "Registration"}' v-if="!isAuth">Registration</a>
<a class="nav-item" @click="exit" v-if="isAuth">Exit</a>
</div>
</nav>
</div>
</header>
<section class="page" v-if="currentPage == 'Main'">
<div class="container">
<div class="slogan-container">
<h1 class="main-slogan">KOJIMA IS GENIUS</h1>
<p class="slogan-inf">You gotta buy Kojimas's games and then you'll become GENIUS as well</p>
</div>
<div class="slider">
<div class="slider-container">
<div class="slide" v-for="el in sliderImgArray" :style="tSlide" :key="el">
<img :src="'./assets/imgs/' + el" alt="slide">
</div>
</div>
</div>
</div>
</section>
<section class="page" v-if="currentPage == 'Products'">
<div class="container">
<div class="filters-container">
<div class="category-container">
<p class="filters">Filters: </p>
<button class="btn" v-for="el in filtersArray" @click="currentFilter = el" :class='{"btn-active": currentFilter == el}'>{{el}}</button>
</div>
<div class="category-container">
<p class="filters">Category: </p>
<button class="btn" v-for="el in categoriesArray" @click="currentCategory = el" :class='{"btn-active": currentCategory == el}'>{{el}}</button>
</div>
<button class="btn" @click="currentFilter = '', currentCategory = ''">clear filters</button>
</div>
<div class="products-container">
<div class="product-container" v-for="el in copyProductsArray">
<img @click="currentProduct = [], showProductAbout(el)" :src="'./assets/imgs/' + el.img" alt="product-img" class="product-img">
<p class="product-name">{{el.name}}</p>
<p class="product-price">{{el.price}}$</p>
<button class="btn" @click="addToCart({...el, quantity: 1})">Add to cart</button>
</div>
</div>
</div>
</section>
<section class="page" v-if="currentPage == 'productAbout'">
<div class="container">
<div class="productAbout-container" v-for="el in currentProduct">
<img @click="showProductAbout(el)" :src="'./assets/imgs/' + el.img" alt="product-img" class="product-img">
<div class="productAboutInf-container">
<p class="product-name" style="font-size: 26px;">{{el.name}}</p>
<p class="product-name">information about product - {{el.inf}}</p>
<p class="product-name">product's category - {{el.category}}</p>
<p class="product-price">{{el.price}}$</p>
<div class="productAboutQuantity-container">
<button class="btn" @click="el.quantity <= 1 ? el.quantity = 1 : el.quantity--">-</button>
<p class="product-name">{{el.quantity}}</p>
<button class="btn" @click="el.quantityInShop <= el.quantity ? el.quantity = el.quantityInShop : el.quantity++">+</button>
</div>
<button class="btn" @click="addToCart(el)">Add to cart</button>
</div>
</div>
</div>
</section>
<section class="page" v-if="currentPage == 'About'">
<div class="container">
<div class="about-container">
<img src="./assets/imgs/map.jpg" alt="map" class="about-img">
<div class="about-inf-container">
<p class="about-inf">Our location - secret</p>
<p class="about-inf">Our email - [email protected]</p>
<p class="about-inf">Our number - secret</p>
</div>
</div>
</div>
</section>
<section class="page" v-if="currentPage == 'Login'">
<div class="container">
<h2 class="login-inf">Log In</h2>
<form action="#" class="form" @submit.prevent="login">
<div class="form-container">
<label for="email" class="form-label">Email</label>
<input type="email" id="email" v-model="formLogin.userEmail" placeholder='write ur email' class="form-input" required>
</div>
<div class="form-container">
<label for="password" class="form-label">Password</label>
<input type="password" id="password" v-model="formLogin.userPassword" placeholder='write ur password' class="form-input" required>
</div>
<div class="form-container">
<button class="btn" type="submit">Log In</button>
<p>{{ifWrongEmailOrPassword}}</p>
</div>
</form>
</div>
</section>
<section class="page" v-if="currentPage == 'Registration'">
<div class="container">
<h2 class="login-inf">Registration</h2>
<form action="#" class="form" @submit.prevent="reg">
<div class="form-container">
<label for="name" class="form-label">Name</label>
<input type="text" id="name" v-model="formReg.userName" placeholder='write ur name' class="form-input" required>
</div>
<div class="form-container">
<label for="Phone" class="form-label">Phone</label>
<input type="tel" id="Phone" v-model="formReg.userPhone" placeholder='write ur phone number' class="form-input" required>
</div>
<div class="form-container">
<label for="email" class="form-label">Email</label>
<input type="email" id="email" v-model="formReg.userEmail" placeholder='write ur email' class="form-input" required>
</div>
<div class="form-container">
<label for="password" class="form-label">Password</label>
<input type="password" id="password" v-model="formReg.userPassword" placeholder='write ur password' class="form-input" required>
</div>
<div class="form-container">
<label for="repassword" class="form-label">RePassword</label>
<input type="password" id="repassword" v-model="formReg.userRePassword" placeholder='confirm ur password' class="form-input" required>
</div>
<div class="form-container form-last-container">
<label for="check" class="form-label form-checkbox">Agree with rules of this website</label>
<input type="checkbox" id="check" v-model="formReg.userCheck" placeholder='confirm ur password' class="form-input" required>
</div>
<div class="form-container">
<button class="btn" type="submit">Registration</button>
<p>{{ifWrongRegistration}}</p>
</div>
</form>
</div>
</section>
<section class="Page" v-if="currentPage == 'Cart'">
<div class="container">
<div class="cart-inf-container">
<h2 class="cart-inf">Cart</h2>
<button class="btn" @click="cartItemsArray = []" v-if="cartItemsArray.length">clear cart</button>
</div>
<div class="cart-items-container">
<div class="cart-item-container" v-for="el in cartItemsArray">
<img :src="'./assets/imgs/' + el.img" alt="cart img" class="cart-item-img">
<p class="cart-item-name" >{{el.name}}</p>
<p class="cart-item-totalPrice">Total Price: <span style="color: red;">{{el.price * el.quantity}}</span></p>
<div class="cart-change-quantity-container">
<button class="btn" @click="el.quantity <= 1 ? el.quantity = 1 : el.quantity--">-</button>
<p class="cart-item-quantity">{{el.quantity}}</p>
<button class="btn" @click="el.quantityInShop <= el.quantity ? el.quantity = el.quantityInShop : el.quantity++">+</button>
</div>
<button class="btn" @click="deleteFromCart(el)">remove item</button>
</div>
</div>
<button class="btn" style="margin-top: 20px;" @click="addToPurchases" v-if="cartItemsArray.length">get order</button>
</div>
</section>
<section class="Page" v-if="currentPage == 'Admin'">
<div class="container">
<p class="admin-inf">Delete categories:</p>
<div class="admin__categories-container">
<div class="admin__category-container" v-for="el in categoriesArray">
<p class="admin__category-name">{{el}}</p>
<button class="btn" @click="deleteCategory(el)">Delete category</button>
</div>
</div>
<p class="admin-inf">Add category:</p>
<div class="admin__category-container">
<input type="text" v-model="addCategory" class="admin-input">
<button class="btn" @click="addCategoryToArray">Add category</button>
</div>
<p class="admin-inf">Add product:</p>
<form action="#" class="admin-form" @submit.prevent="addProductToArray">
<div class="admin__input-container">
<label for="name" class="admin-label">Add name:</label>
<input id="name" type="text" v-model="addProduct.name" class="admin-input">
</div>
<div class="admin__input-container">
<label for="category" class="admin-label">Add category:</label>
<input id="category" v-model="addProduct.category" type="text" class="admin-input">
</div>
<div class="admin__input-container">
<label for="price" class="admin-label">Add price:</label>
<input id="price" v-model="addProduct.price" type="text" class="admin-input">
</div>
<div class="admin__input-container">
<label for="inf" class="admin-label">Add inf:</label>
<input id="inf" v-model="addProduct.inf" type="text" class="admin-input">
</div>
<div class="admin__input-container">
<label for="quantity" class="admin-label">Add quantity in shop:</label>
<input id="quantity" v-model="addProduct.quantityInShop" type="text" class="admin-input">
</div>
<div class="admin__input-container">
<button class="btn" type="submit">Add Product</button>
</div>
</form>
</div>
</section>
<section class="Page" v-if="currentPage == 'Profile'">
<div class="container">
<div class="profile-inf-container">
<img src="./assets/imgs/user.jpg" alt="user" class="profile-img">
<div class="profile-user-container">
<p class="profile-inf">name: {{currentUser.userName}}</p>
<p class="profile-inf">email: {{currentUser.userEmail}}</p>
</div>
</div>
<h2 class="profile-purchases">Your purchases:</h2>
<p class="profile-inf" style="margin-top: 10px;" v-if="purchasesArray.length == 0">Here will be your purchases</p>
<div class="profile-purchases-container">
<div class="purchase-container" v-for="el in purchasesArray">
<img :src="'./assets/imgs/' + el.img" alt="purchase" class="Profile-purchase-img">
<p class="Profile-purchase-name">{{el.name}}</p>
<p class="Profile-purchase-activate">Activate code: HTTS-SDSA-23SA-SDO9</p>
</div>
</div>
</div>
</section>
</body>
</html>