This commit is contained in:
Dasha 2024-01-12 14:27:01 +04:00
parent 3fd3ff52d4
commit 056cac6cc8
29 changed files with 6482 additions and 0 deletions

45
lab3/.gitignore vendored Normal file
View File

@ -0,0 +1,45 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db
# Ignore dist
dist/

BIN
lab3/Images/flower.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
lab3/Images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
lab3/Images/rose.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

74
lab3/aboutUs.html Normal file
View File

@ -0,0 +1,74 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>О нас</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link active" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Войти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<div class="d-flex justify-content-center align-items-center">
<h1 class="text-success font-weight-bold">О нас</h1>
</div>
<div class="container">
<div class="row">
<div class="div d-flex justify-content-center">
<img src="Images/flower.jpg" class="img-fluid" alt="flower" width="600">
</div>
</div>
</div>
<div class="container">
<div class="col">
<p class="text-black" style="font-size: 25px; margin-left: 40px; margin-top: 40px;">Интернет-магазин Flora предлагает огромный выбор цветочных композиций.
Всегда рады помочь с покупкой букета для любого повода.
</p>
<p class="text-black" style="font-size: 25px; margin-left: 40px; margin-top: 40px;">Мы выполняем доставку цветов по Ульяновску и Ульяновской области,
поэтому можете быть уверены, что ваш сюрприз удастся. Среди нашего разнообразия легко подобрать вариант
для дня рождения, юбилея, первого свидания и многих других важных событий. Наши курьеры привезут заказ по
указанному адресу. Это может быть офис, дом, ресторан или другое место. Кроме того, доставка цветов может
быть анонимной, а оплата возможна онлайн банковской картой.
</p>
<p class="text-black" style="font-size: 25px; margin-left: 40px; margin-top: 40px;">Над каждой композицией работают наши флористы, которые уделяют
особое внимание составу букета и его оформлению. Выбирайте цветы с бесплатной доставкой по Ульяновску в магазине
Flora и вы останетесь довольны их качеством и нашим обслуживанием.
</p>
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

98
lab3/account.html Normal file
View File

@ -0,0 +1,98 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Личный кабинет</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<section class="h-100">
<div class="mask d-flex align-items-center h-100 gradient-custom-3">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-md-9 col-lg-7 col-xl-6">
<div class="card" style="border-radius: 15px; border-color:rgb(95, 206, 123);">
<div class="card-body p-5">
<h2 class="text-center text-success mb-5">Личный кабинет</h2>
<form>
<div class="form-outline mb-4">
<input type="text" id="form3Example1cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example1cg">Ваше имя</label>
</div>
<div class="form-outline mb-4">
<input type="text" id="form3Example1cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example1cg">Ваша фамилия</label>
</div>
<div class="form-outline mb-4">
<input type="email" id="form3Example3cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example3cg">Ваш адрес электронной почты</label>
</div>
<div class="form-outline mb-4">
<input type="date" id="form3Example4cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example4cg">Дата рождения</label>
</div>
<div class="form-outline mb-2">
<input type="tel" id="form3Example5cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example5cg">Номер телефона</label>
</div>
<div class="d-flex justify-content-center">
<button class="btn btn-outline-light" type="button" id="saveButton">Сохранить</button>
</div>
<div class="d-flex justify-content-center">
<a class="btn btn-outline-light" type="button" href="index.html">Выйти</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

86
lab3/accountLogin.html Normal file
View File

@ -0,0 +1,86 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Личный кабинет - Вход</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<section class="h-100">
<div class="mask d-flex align-items-center h-100 gradient-custom-3">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-md-9 col-lg-7 col-xl-6">
<div class="card" style="border-radius: 15px; border-color:rgb(95, 206, 123);">
<div class="card-body p-5">
<h2 class="text-success text-center mb-5">Войти</h2>
<form>
<div class="form-outline mb-4">
<input type="email" id="form3Example3cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example3cg">Ваш адрес электронной почты</label>
</div>
<div class="form-outline mb-4">
<input type="password" id="form3Example4cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example4cg">Пароль</label>
</div>
<p class="text-center text-muted mb-0">Забыли пароль? <a href="recoveryPassword.html"
class="fw-bold text-body"><u>Восстановление пароля</u></a></p>
<div class="d-flex justify-content-center">
<a class="btn" href="account.html">Войти</a>
</div>
<p class="text-center text-muted mb-0">У вас нет аккаунта? <a href="accountRegister.html"
class="fw-bold text-body"><u>Регистрация</u></a></p>
<p class="text-center"><a class="fw-bold text-body" href="admin.html">Администратор</a></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

93
lab3/accountRegister.html Normal file
View File

@ -0,0 +1,93 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Личный кабинет - Регистрация</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<section class="h-100">
<div class="mask d-flex align-items-center h-100 gradient-custom-3">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-md-9 col-lg-7 col-xl-6">
<div class="card" style="border-radius: 15px; border-color: rgb(95, 206, 123);">
<div class="card-body p-5">
<h2 class="text-success text-center mb-5">Регистрация</h2>
<form>
<div class="form-outline mb-4">
<input type="text" id="form3Example1cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example1cg">Ваше имя</label>
</div>
<div class="form-outline mb-4">
<input type="email" id="form3Example3cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example3cg">Ваш адрес электронной почты</label>
</div>
<div class="form-outline mb-4">
<input type="password" id="form3Example4cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example4cg">Пароль</label>
</div>
<div class="form-outline mb-4">
<input type="password" id="form3Example4cdg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example4cdg">Повторите свой пароль</label>
</div>
<div class="d-flex justify-content-center">
<button type="button"
class="btn btn-block text-body mb-0">Регистрация</button>
</div>
<p class="text-center text-muted mb-0">У вас уже есть учетная запись? <a href="accountLogin.html"
class="fw-bold text-body"><u>Войдите здесь</u></a></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

119
lab3/admin.html Normal file
View File

@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Страница администратора</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Выйти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<h1 class="text-success text-center font-weight-bold">Страница администратора</h1>
<div class="text-center">
<div class="btn-group" role="group">
<a class="btn" href="/page-edit.html">Добавить товар</a>
</div>
</div>
<div>
<h2 class="text-success text-center font-weight-bold" style="padding-top: 10px;">Таблица данных</h2>
<table id="items-table" class="table table-striped">
<thead>
<th scope="col"></th>
<th scope="col" class="w-25">Товар</th>
<th scope="col" class="w-25">Цена</th>
<th scope="col" class="w-25">Количество</th>
<th scope="col" class="w-25">Сумма</th>
<th scope="col"></th>
<th scope="col"></th>
</thead>
<tbody></tbody>
</table>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
<div id="items-update" class="modal fade" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog">
<form id="items-form" class="needs-validation" novalidate>
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="items-update-title"></h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="text-center">
<img id="image-preview" src="https://via.placeholder.com/200" class="rounded rounded-circle"
alt="placeholder">
</div>
<input id="items-line-id" type="number" hidden>
<div class="mb-2">
<label for="item" class="form-label">Товары</label>
<select id="item" class="form-select" name="selected" required>
</select>
</div>
<div class="mb-2">
<label class="form-label" for="price">Цена</label>
<input id="price" name="price" class="form-control" type="number" value="99.00" min="99.00"
step="1.00" required>
</div>
<div class="mb-2">
<label class="form-label" for="count">Количество</label>
<input id="count" name="count" class="form-control" type="number" value="0" min="1" step="1"
required>
</div>
<div class="mb-2">
<label class="form-label" for="image">Изображение</label>
<input id="image" type="file" name="image" class="form-control" accept="image/*">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
<button type="submit" class="btn btn-primary">Сохранить</button>
</div>
</div>
</form>
</div>
</div>
<script type="module">
import validation from "./js/validation";
import { linesForm } from "./js/lines";
document.addEventListener('DOMContentLoaded', () => {
validation();
linesForm();
});
</script>
</body>
</html>

197
lab3/basket.html Normal file
View File

@ -0,0 +1,197 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Корзина</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Войти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container">
<div class="d-flex justify-content-center align-items-center">
<h1 class="text-success font-weight-bold">Корзина</h1>
</div>
<div class="row">
<div class="col-10">
<div class="card rounded-3 mb-4">
<div class="card-body p-4">
<div class="row d-flex justify-content-between align-items-center">
<div class="col-md-2 col-lg-2 col-xl-2">
<img src="Images/rose.jpg" class="img-fluid rounded-3" alt="Flower">
</div>
<div class="col-md-auto col-lg-3 col-xl-3">
<p class="lead fw-normal mb-2">Название</p>
<p><span class="text-muted">Описание</span></p>
</div>
<div class="col-md-3 col-lg-3 col-xl-1 d-flex">
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepDown()">
<i class="fas fa-minus"></i>
</button>
<input id="form1" min="0" name="quantity" value="2" type="number"
class="form-control" style="width: 70px;" />
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepUp()">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="col-md-auto col-lg-2 col-xl-2 offset-lg-1">
<h5 class="mb-0">Цена ₽</h5>
</div>
<div class="col-md-auto col-lg-0 col-xl-0 text-end">
<a href="#!" class="text-muted"><i class="fas fa-delete-left fa-lg"></i></a>
</div>
</div>
</div>
</div>
<div class="card rounded-3 mb-4">
<div class="card-body p-4">
<div class="row d-flex justify-content-between align-items-center">
<div class="col-md-2 col-lg-2 col-xl-2">
<img src="Images/rose.jpg" class="img-fluid rounded-3" alt="Flower">
</div>
<div class="col-md-auto col-lg-3 col-xl-3">
<p class="lead fw-normal mb-2">Название</p>
<p><span class="text-muted">Описание</span></p>
</div>
<div class="col-md-3 col-lg-3 col-xl-1 d-flex">
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepDown()">
<i class="fas fa-minus"></i>
</button>
<input id="form1" min="0" name="quantity" value="2" type="number"
class="form-control" style="width: 70px;" />
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepUp()">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="col-md-auto col-lg-2 col-xl-2 offset-lg-1">
<h5 class="mb-0">Цена ₽</h5>
</div>
<div class="col-md-auto col-lg-0 col-xl-0 text-end">
<a href="#!" class="text-muted"><i class="fas fa-delete-left fa-lg"></i></a>
</div>
</div>
</div>
</div>
<div class="card rounded-3 mb-4">
<div class="card-body p-4">
<div class="row d-flex justify-content-between align-items-center">
<div class="col-md-2 col-lg-2 col-xl-2">
<img src="Images/rose.jpg" class="img-fluid rounded-3" alt="Flower">
</div>
<div class="col-md-auto col-lg-3 col-xl-3">
<p class="lead fw-normal mb-2">Название</p>
<p><span class="text-muted">Описание</span></p>
</div>
<div class="col-md-3 col-lg-3 col-xl-1 d-flex">
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepDown()">
<i class="fas fa-minus"></i>
</button>
<input id="form1" min="0" name="quantity" value="2" type="number"
class="form-control" style="width: 70px;" />
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepUp()">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="col-md-auto col-lg-2 col-xl-2 offset-lg-1">
<h5 class="mb-0">Цена ₽</h5>
</div>
<div class="col-md-auto col-lg-0 col-xl-0 text-end">
<a href="#!" class="text-muted"><i class="fas fa-delete-left fa-lg"></i></a>
</div>
</div>
</div>
</div>
<div class="card rounded-3 mb-4">
<div class="card-body p-4">
<div class="row d-flex justify-content-between align-items-center">
<div class="col-md-2 col-lg-2 col-xl-2">
<img src="Images/rose.jpg" class="img-fluid rounded-3" alt="Flower">
</div>
<div class="col-md-auto col-lg-3 col-xl-3">
<p class="lead fw-normal mb-2">Название</p>
<p><span class="text-muted">Описание</span></p>
</div>
<div class="col-md-3 col-lg-3 col-xl-1 d-flex">
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepDown()">
<i class="fas fa-minus"></i>
</button>
<input id="form1" min="0" name="quantity" value="2" type="number"
class="form-control" style="width: 70px;" />
<button class="btn px-1"
onclick="this.parentNode.querySelector('input[type=number]').stepUp()">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="col-md-auto col-lg-2 col-xl-2 offset-lg-1">
<h5 class="mb-0">Цена ₽</h5>
</div>
<div class="col-md-auto col-lg-0 col-xl-0 text-end">
<a href="#!" class="text-muted"><i class="fas fa-delete-left fa-lg"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-start align-items-center">
<div class="text-dark font-weight-bold" style="font-size: 24px;">
Сумма заказа:
</div>
<div class="text-end text-success" style="font-size: 24px;">
Сумма ₽
</div>
</div>
<a class="btn" style="margin-left: 25px; margin-bottom: 10px;" href="makingOrder.html">Оплатить</a>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

61
lab3/contacts.html Normal file
View File

@ -0,0 +1,61 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Контакты</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link active" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Войти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<div class="d-flex justify-content-center align-items-center">
<h1 class="text-success font-weight-bold">Контакты</h1>
</div>
<div class="container">
<div class="row">
<div class="div d-flex justify-content-center">
<iframe src="https://yandex.ru/map-widget/v1/?um=constructor%3Afa2d61fb6063802ddf9f646ff254a8764a6dfd399031b696dbda0a7c93474211&amp;source=constructor" class="img-fluid" style="width: 980; height: 505px;"></iframe>
</div>
<a href="tel:+79273456567" class="text-dark" style="font-size: 25px; margin-left: 10px; margin-top: 10px;">+7 (927) 345 65 67</a>
<h2 class="font-weight-bold" style="font-size: 35px; margin-left: 10px; margin-top: 10px;">г.Ульяновск, ул.Гончарова, 40</h2>
<p style="font-size: 25px; margin-left: 10px; margin-top: 10px;">Пн-Пт: 9:00 - 20:00</p>
<p style="font-size: 25px; margin-left: 10px; margin-top: 10px;">Сб-Вс: 10:00 - 19:00</p>
</div>
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

78
lab3/data.json Normal file

File diff suppressed because one or more lines are too long

54
lab3/index.html Normal file
View File

@ -0,0 +1,54 @@
<html lang="ru" class="h-100">
<head>
<meta charset="utf-8">
<title>Каталог</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
<script type="module" src="js/catalog/catalog.js" defer></script>
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link active" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Войти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<div class="d-flex justify-content-center align-items-center">
<h1 class="text-success font-weight-bold">Каталог</h1>
</div>
<div class="container">
<div class="row" id="catalog">
</div>
</div>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

View File

@ -0,0 +1,34 @@
import { getAllItemTypes, getAllLines } from "../lines-rest-api.js";
import { indexPageCatalog } from "../lines-ui.js";
import { getProductItem } from "./getProductItem.js";
// Проверка, есть ли вообще на странице каталога место,
// где будут отображаться карточки
if (indexPageCatalog) {
drawCatalog();
}
async function drawCatalog() {
try {
// Получаем все типы
const itemTypes = await getAllItemTypes();
// Получаем все товары
const lines = await getAllLines();
// Пробегаем по товарам через for
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Получаем его тип
const itemType = itemTypes.find(it => it.id === +line.itemsId);
// Если нужно понять, что лежит в itemType
// console.log(itemType);
// В сам каталог добавляем карточку через функцию,
// которую вынесли в отдельный файл
indexPageCatalog.innerHTML += getProductItem(line.image, itemType.name, line.price);
}
} catch (err) {
console.log(err);
}
}

View File

@ -0,0 +1,16 @@
export function getProductItem(image, name, price) {
return `
<div class="col-lg-3 col-md-4 col-sm-6 col-12 mb-4">
<div class="card">
<img src="${image}" class="card-img-top" alt="Product Image">
<div class="card-body">
<h5 class="card-title">${name}</h5>
</div>
<div class="card-footer">
<div class="text-success font-weight-bold">Цена ${price}</div>
<button class="btn">В корзину</button>
</div>
</div>
</div>
`;
}

85
lab3/js/lines-rest-api.js Normal file
View File

@ -0,0 +1,85 @@
const serverUrl = "http://localhost:8081";
function createLineObject(item, price, count, image) {
return {
itemsId: item,
price: parseFloat(price).toFixed(2),
count,
sum: parseFloat(price * count).toFixed(2),
image,
};
}
export async function getAllItemTypes() {
const response = await fetch(`${serverUrl}/items`);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function getAllLines() {
const response = await fetch(`${serverUrl}/lines?_expand=items`);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function getLine(id) {
const response = await fetch(`${serverUrl}/lines/${id}?_expand=items`);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function createLine(item, price, count, image) {
const itemObject = createLineObject(item, price, count, image);
const options = {
method: "POST",
body: JSON.stringify(itemObject),
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
};
const response = await fetch(`${serverUrl}/lines`, options);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function updateLine(id, item, price, count, image) {
const itemObject = createLineObject(item, price, count, image);
const options = {
method: "PUT",
body: JSON.stringify(itemObject),
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
};
const response = await fetch(`${serverUrl}/lines/${id}`, options);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function deleteLine(id) {
const options = {
method: "DELETE",
};
const response = await fetch(`${serverUrl}/lines/${id}`, options);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}

60
lab3/js/lines-ui.js Normal file
View File

@ -0,0 +1,60 @@
export const cntrls = {
button: document.getElementById("items-add"),
table: document.querySelector("#items-table tbody"),
form: document.getElementById("items-form"),
lineId: document.getElementById("items-line-id"),
itemsType: document.getElementById("item"),
price: document.getElementById("price"),
count: document.getElementById("count"),
image: document.getElementById("image"),
imagePreview: document.getElementById("image-preview"),
};
export const indexPageCatalog = document.querySelector('#catalog');
export const imagePlaceholder = "https://via.placeholder.com/200";
export function createItemsOption(name, value = "", isSelected = false) {
const option = document.createElement("option");
option.value = value || "";
option.selected = isSelected;
option.text = name;
return option;
}
function createTableAnchor(icon, callback) {
const i = document.createElement("i");
i.classList.add("fa-solid", icon);
const a = document.createElement("a");
a.href = "#";
a.appendChild(i);
a.onclick = (event) => {
event.preventDefault();
event.stopPropagation();
callback();
};
const td = document.createElement("td");
td.appendChild(a);
return td;
}
function createTableColumn(value) {
const td = document.createElement("td");
td.textContent = value;
return td;
}
export function createTableRow(item, index, editCallback, deleteCallback) {
const rowNumber = document.createElement("th");
rowNumber.scope = "row";
rowNumber.textContent = index + 1;
const row = document.createElement("tr");
row.id = `line-${item.id}`;
row.appendChild(rowNumber);
row.appendChild(createTableColumn(item.items.name));
row.appendChild(createTableColumn(parseFloat(item.price).toFixed(2)));
row.appendChild(createTableColumn(item.count));
row.appendChild(createTableColumn(parseFloat(item.sum).toFixed(2)));
row.appendChild(createTableAnchor("fa-pencil", editCallback));
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
return row;
}

172
lab3/js/lines.js Normal file
View File

@ -0,0 +1,172 @@
import {
createLine, deleteLine, getAllItemTypes, getAllLines, getLine, updateLine,
} from "./lines-rest-api";
import {
cntrls, createItemsOption, createTableRow, imagePlaceholder,
} from "./lines-ui";
async function drawItemsSelect() {
const data = await getAllItemTypes();
cntrls.itemsType.innerHTML = "";
cntrls.itemsType.appendChild(createItemsOption("Выберите значение", "", true));
data.forEach((item) => {
cntrls.itemsType.appendChild(createItemsOption(item.name, item.id));
});
}
async function drawLinesTable() {
console.info("Try to load data");
if (!cntrls.table) {
return;
}
const data = await getAllLines();
cntrls.table.innerHTML = "";
data.forEach((item, index) => {
cntrls.table.appendChild(
createTableRow(
item,
index,
() => location.assign(`page-edit.html?id=${item.id}`),
() => removeLine(item.id),
),
);
});
}
async function addLine(item, price, count, image) {
console.info("Try to add item");
const data = await createLine(item, price, count, image);
console.info("Added");
console.info(data);
drawLinesTable();
}
async function editLine(id, item, price, count, image) {
console.info("Try to update item");
const data = await updateLine(id, item, price, count, image);
console.info("Updated");
console.info(data);
drawLinesTable();
}
async function removeLine(id) {
if (!confirm("Do you really want to remove this item?")) {
console.info("Canceled");
return;
}
console.info("Try to remove item");
const data = await deleteLine(id);
console.info(data);
drawLinesTable();
}
async function readFile(file) {
const reader = new FileReader();
return new Promise((resolve, reject) => {
reader.onloadend = () => {
const fileContent = reader.result;
resolve(fileContent);
};
reader.onerror = () => {
reject(new Error("oops, something went wrong with the file reader."));
};
reader.readAsDataURL(file);
});
}
async function updateImagePreview() {
const file = cntrls.image.files[0];
const fileContent = await readFile(file);
console.info("base64 ", fileContent);
cntrls.imagePreview.src = fileContent;
}
export function linesForm() {
console.info("linesForm");
drawItemsSelect();
drawLinesTable();
cntrls.image.addEventListener("change", () => updateImagePreview());
cntrls.form.addEventListener("submit", async (event) => {
console.info("Form onSubmit");
event.preventDefault();
event.stopPropagation();
if (!cntrls.form.checkValidity()) {
return;
}
let imageBase64 = "";
if (cntrls.imagePreview.src !== imagePlaceholder) {
const result = await fetch(cntrls.imagePreview.src);
const blob = await result.blob();
imageBase64 = await readFile(blob);
}
const currentId = cntrls.lineId.value;
if (!currentId) {
await addLine(
cntrls.itemsType.value,
cntrls.price.value,
cntrls.count.value,
imageBase64,
);
} else {
await editLine(
currentId,
cntrls.itemsType.value,
cntrls.price.value,
cntrls.count.value,
imageBase64,
);
}
});
}
export async function linesPageForm() {
console.info("linesPageForm");
drawItemsSelect();
const goBack = () => location.assign("/admin.html");
cntrls.image.addEventListener("change", () => updateImagePreview());
const urlParams = new URLSearchParams(location.search);
const currentId = urlParams.get("id");
if (currentId) {
try {
const line = await getLine(currentId);
cntrls.itemsType.value = line.itemsId;
cntrls.price.value = line.price;
cntrls.count.value = line.count;
cntrls.imagePreview.src = line.image ? line.image : imagePlaceholder;
} catch {
goBack();
}
}
cntrls.form.addEventListener("submit", async (event) => {
console.info("Form onSubmit");
event.preventDefault();
event.stopPropagation();
if (!cntrls.form.checkValidity()) {
return;
}
let imageBase64 = "";
if (cntrls.imagePreview.src !== imagePlaceholder) {
const result = await fetch(cntrls.imagePreview.src);
const blob = await result.blob();
imageBase64 = await readFile(blob);
}
if (!currentId) {
await addLine(
cntrls.itemsType.value,
cntrls.price.value,
cntrls.count.value,
imageBase64,
);
} else {
await editLine(
currentId,
cntrls.itemsType.value,
cntrls.price.value,
cntrls.count.value,
imageBase64,
);
}
goBack();
});
}

16
lab3/js/validation.js Normal file
View File

@ -0,0 +1,16 @@
function validation() {
const forms = document.querySelectorAll("form.needs-validation");
for (let i = 0; i < forms.length; i += 1) {
const form = forms[i];
form.addEventListener("submit", (event) => {
if (!form.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add("was-validated");
});
}
}
export default validation;

14
lab3/jsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "preserve",
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}

151
lab3/makingOrder.html Normal file
View File

@ -0,0 +1,151 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Оформление заказа</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn custom-btn" href="account.html">Профиль</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<section class="h-100">
<div class="mask d-flex align-items-center h-100 gradient-custom-3">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-md-9 col-lg-7 col-xl-6">
<div class="card" style="border-radius: 15px; border-color:#7bca8c;">
<div class="card-body p-5">
<h2 class="text-success text-center mb-5">Оформление заказа</h2>
<form>
<div class="form-outline mb-4">
<input type="text" id="form3Example1cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example1cg">Ваше имя</label>
</div>
<div class="form-outline mb-4">
<input type="tel" id="form3Example5cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example5cg">Номер телефона</label>
</div>
<label class="form-check-label" for="creditCard">Вариант получения</label>
<div class="form-check mb-4">
<input class="form-check-input" type="radio" name="deliveryMethod" id="selfPickup" value="selfPickup">
<label class="form-check-label" for="selfPickup">Самовывоз</label>
</div>
<div class="form-check mb-4">
<input class="form-check-input" type="radio" name="deliveryMethod" id="delivery" value="delivery">
<label class="form-check-label" for="delivery">Доставка</label>
</div>
<div class="form-outline mb-4" id="deliveryAddress" style="display: none;">
<input type="text" id="form3ExampleAddress" class="form-control form-control-lg" />
<label class="form-label" for="form3ExampleAddress">Ваш адрес доставки</label>
</div>
<div class="row mb-4">
<div class="col">
<div class="form-outline">
<input type="text" id="formNameOnCard" class="form-control">
<label class="form-label" for="formNameOnCard">Имя держателя карты</label>
</div>
</div>
<div class="col">
<div class="form-outline">
<input type="text" id="formCardNumber" class="form-control" />
<label class="form-label" for="formCardNumber">Номер карты</label>
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-3">
<div class="form-outline">
<input type="text" id="formExpiration" class="form-control" />
<label class="form-label" for="formExpiration">Срок действия</label>
</div>
</div>
<div class="col-3">
<div class="form-outline">
<input type="text" id="formCVV" class="form-control" />
<label class="form-label" for="formCVV">CVV</label>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<button class="btn" style="margin-bottom: 20px;" type="button" id="saveButton">Оформить</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('input[type=radio][name=deliveryMethod]').change(function() {
if (this.value === 'delivery') {
$('#deliveryAddress').show();
$('#deliveryTimeOptions').show();
} else {
$('#deliveryAddress').hide();
$('#deliveryTimeOptions').hide();
}
});
$('input[type=radio][name=paymentMethod]').change(function() {
if (this.value === 'creditCard') {
$('#creditCardDetails').show();
} else {
$('#creditCardDetails').hide();
}
});
});
</script>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

4700
lab3/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

26
lab3/package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "int-prog",
"version": "1.0.0",
"type": "module",
"scripts": {
"start": "vite",
"serve": "http-server -p 3000 ./dist/",
"build": "vite build",
"rest": "json-server --watch data.json -p 8081",
"dev": "npm-run-all --parallel rest start",
"prod": "npm-run-all build --parallel serve rest"
},
"dependencies": {
"bootstrap": "5.3.2",
"@fortawesome/fontawesome-free": "6.4.2"
},
"devDependencies": {
"vite": "4.4.9",
"eslint": "8.50.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.28.1",
"http-server": "14.1.1",
"json-server": "0.17.4",
"npm-run-all": "4.1.5"
}
}

83
lab3/page-edit.html Normal file
View File

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Страница администратора</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Выйти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<h1 class="text-success text-center font-weight-bold">Добавление товара</h1>
<div class="text-center">
<img id="image-preview" src="https://via.placeholder.com/200" class="rounded rounded-circle"
alt="placeholder">
</div>
<form id="items-form" class="needs-validation" novalidate>
<div class="mb-2">
<label for="item" class="form-label">Товары</label>
<select id="item" class="form-select" name="selected" required>
</select>
</div>
<div class="mb-2">
<label class="form-label" for="price">Цена</label>
<input id="price" name="price" class="form-control" type="number" value="0.00" min="1000.00" step="0.50"
required>
</div>
<div class="mb-2">
<label class="form-label" for="count">Количество</label>
<input id="count" name="count" class="form-control" type="number" value="0" min="1" step="1" required>
</div>
<div class="mb-2">
<label class="form-label" for="image">Изображение</label>
<input id="image" type="file" name="image" class="form-control" accept="image/*">
</div>
<a href="admin.html" class="btn">Назад</a>
<button type="submit" class="btn">Сохранить</button>
</form>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
<script type="module">
import validation from "./js/validation";
import { linesPageForm } from "./js/lines"
document.addEventListener('DOMContentLoaded', () => {
validation();
linesPageForm();
});
</script>
</body>
</html>

View File

@ -0,0 +1,55 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Оплата и доставка</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link active" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="accountLogin.html">Войти</a>
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<div class="d-flex justify-content-center align-items-center">
<h1 class="text-success font-weight-bold">Оплата и доставка</h1>
</div>
<h4 class="text-success" style="font-size: 35px; margin-left: 50px; margin-top: 100px;">Способ оплаты</h4>
<p class="text-black" style="font-size: 25px; margin-left: 50px; margin-top: 40px;">Картой онлайн</p>
<h2 class="text-success" style="font-size: 35px; margin-left: 50px; margin-top: 70px;">Доставка</h2>
<p class="text-black" style="font-size: 25px; margin-left: 50px; margin-top: 40px;">Заказ на доставку принимается не менее, чем за 3 часа</p>
<p class="text-black" style="font-size: 25px; margin-left: 50px; margin-top: 50px;">Минимальная стоимость букета на доставку - 1500 р</p>
<p class="text-black" style="font-size: 25px; margin-left: 50px; margin-top: 50px;">Доставим ваш букет бесплатно с 10:00 до 19:00</p>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

View File

@ -0,0 +1,81 @@
<html lang="ru" class="h-100">
<head>
<meta charset="UTF-8">
<title>Личный кабинет - Восстановление пароля</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="./style.css">
</head>
<body class="d-flex flex-column h-100">
<header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<a class="navbar-brand" href="/">
<img src="Images/logo.png" alt="logo" width="128">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-start" id="navbarNav">
<div class="navbar-nav">
<a class="nav-link" href="index.html">Каталог</a>
<a class="nav-link" href="aboutUs.html">О нас</a>
<a class="nav-link" href="paymentAndDelivery.html">Оплата и доставка</a>
<a class="nav-link" href="contacts.html">Контакты</a>
</div>
</div>
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
<div class="navbar-nav">
<a class="btn" href="basket.html">Корзина</a>
</div>
</div>
</div>
</nav>
</header>
<main class="container-fluid p-2">
<section class="h-100">
<div class="mask d-flex align-items-center h-100 gradient-custom-3">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-12 col-md-9 col-lg-7 col-xl-6">
<div class="card" style="border-radius: 15px; border-color:green;">
<div class="card-body p-5">
<h2 class="text-success text-center mb-5">Восстановление пароля</h2>
<h4 class="text-black text-center mb-5">Введите свой адрес электронной почты, и мы вышлем вам электронное письмо с инструкциями по сбросу вашего пароля</h4>
<form>
<div class="form-outline mb-4">
<input type="email" id="form3Example3cg" class="form-control form-control-lg" />
<label class="form-label" for="form3Example3cg">Ваш адрес электронной почты</label>
</div>
<div class="d-flex justify-content-center">
<button type="button"
class="btn btn-block text-body mb-0">Сбросить</button>
</div>
<p class="text-center text-muted mb-0"><a href="accountLogin.html"
class="fw-bold text-body"><u>Войти</u></a></p>
<p class="text-center text-muted mb-0"><a href="accountRegister.html"
class="fw-bold text-body"><u>Регистрация</u></a></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center">
Все права защищены © 2023-2024
</footer>
</body>
</html>

61
lab3/style.css Normal file
View File

@ -0,0 +1,61 @@
header nav {
background-color: #e8fae0;
}
@media (min-width: 768px) {
header nav {
height: 100px;
}
}
header nav a:hover {
text-decoration: underline;
}
.navbar-brand img {
margin-left: 235px;
}
@media (max-width: 576px) {
.navbar-brand img {
margin-left: 25px;
}
}
@media (min-width: 577px) and (max-width: 992px) {
.navbar-brand img {
margin-left: 25px;
}
}
@media (min-width: 993px) and (max-width: 1200px) {
.navbar-brand img {
margin-left: 150px;
}
}
@media (min-width: 1201px) {
.navbar-brand img {
margin-left: 235px;
}
}
.navbar-nav {
margin-top: 25px;
}
.btn {
background-color: #7bca8c !important;
border-radius: 8px;
width: 130px;
height: 35px;
margin-right: 10px;
margin-left: 10px;
margin-top: 10px;
color: #FFFFFF !important;
}
footer {
background-color: #e8fae0;
color: #686464;
}

23
lab3/vite.config.js Normal file
View File

@ -0,0 +1,23 @@
import { resolve } from "path";
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from "vite";
export default defineConfig({
build: {
sourcemap: true,
emptyOutDir: true,
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
contacts: resolve(__dirname, "contacts.html"),
personalAccountLogin: resolve(__dirname, "accountLogin.html"),
personalAccountRegister: resolve(__dirname, "accountRegister.html"),
personalAccount: resolve(__dirname, "account.html"),
recoveryPassword: resolve(__dirname, "recoveryPassword.html"),
basket: resolve(__dirname, "basket.html"),
makingAnOrder: resolve(__dirname, "makingOrder.html"),
administrator: resolve(__dirname, "admin.html"),
},
},
},
});

BIN
отчеты/3 лаб.docx Normal file

Binary file not shown.