laba4
25
.eslintrc.cjs
Normal file
@ -0,0 +1,25 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: { browser: true, es2020: true },
|
||||
extends: [
|
||||
'airbnb-base',
|
||||
'plugin:react/recommended',
|
||||
'plugin:react/jsx-runtime',
|
||||
'plugin:react-hooks/recommended',
|
||||
],
|
||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||
parserOptions: { ecmaVersion: 12, sourceType: 'module' },
|
||||
settings: { react: { version: '18.2' } },
|
||||
plugins: ['react-refresh'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
'indent': 'off',
|
||||
'no-console': 'off',
|
||||
'arrow-body-style': 'off',
|
||||
'implicit-arrow-linebreak': 'off',
|
||||
'linebreak-style': 'off',
|
||||
},
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": "airbnb-base",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"quotes": "off",
|
||||
"indent": "off",
|
||||
"no-console": "off",
|
||||
"no-use-before-define": "off",
|
||||
"no-alert": "off",
|
||||
"no-restricted-globals": "off",
|
||||
"quote-props": "off"
|
||||
}
|
||||
}
|
68
Film.html
@ -1,68 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark film fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<div class="film rows container item">
|
||||
<div class="Rating" style="">
|
||||
<div>
|
||||
<img class="prevFilm" src="img/Prev.png" alt="превью">
|
||||
</div>
|
||||
<div class="rat">
|
||||
Рейтинг
|
||||
</div>
|
||||
<div class="rat">
|
||||
10 из 10
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<div class="rat">
|
||||
Название фильма
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-warning watch" type="button"><a class="nav-link" aria-current="page" href="media.html" style="text-decoration: none">Просмотр</a></button>
|
||||
</div>
|
||||
<div class="description_info">
|
||||
Описание фильма
|
||||
</div>
|
||||
</div>
|
||||
<div class="actorList">
|
||||
<div class="actor">
|
||||
Актерский состав
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
8
IP.iml
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
81
Input.html
@ -1,81 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark HeadInput input fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
<div class="text-center">
|
||||
<img id="image-preview" src="https://via.placeholder.com/200" class="rounded rounded-circle"
|
||||
alt="placeholder" style="max-width: 200px; max-height: 200px">
|
||||
</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 for="title" class="form-label">Название видео</label>
|
||||
<input id="title" class="form-control" name="selected" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label" for="cast">Актерский состав</label>
|
||||
<input id="cast" name="price" class="form-control" type="text" style="height: 10%" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label" for="description">Описание</label>
|
||||
<input id="description" name="description" class="form-control" type="text" style="height: 10%" 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 class="mb-2">
|
||||
<label class="form-label" for="video">Видеофайл</label>
|
||||
<input id="video" type="file" name="video" class="form-control" accept="video/*">
|
||||
</div>
|
||||
<a href="admin.html" class="btn btn-secondary" style="height: 7%;font-size: 16px">Назад</a>
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
</form>
|
||||
</main>
|
||||
<script type="module">
|
||||
import validation from "./js/validation";
|
||||
import { linesPageForm } from "./js/lines"
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
validation();
|
||||
linesPageForm();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
25
Join.html
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Вход в OKPO</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="CSS/style.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F"></body>
|
||||
<main>
|
||||
<div class="Join">
|
||||
<center><a href="index.html"><img src="img/Title_black.png" alt="название" class="Title"></a></center>
|
||||
<div>
|
||||
<input class="name" placeholder="Логин / почта пользователя" tabindex="1" name="username" type="text"/>
|
||||
<input class="pass" placeholder="Пароль" tabindex="1" name="password" type="password"/>
|
||||
<a class="Mistake">Забыли пароль?</a>
|
||||
<button class="ButtonJoin" type="submit">Войти</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</html>
|
99
LK.html
@ -1,99 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark LK2 fixed-top">
|
||||
<div class="container-fluid LK">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<div class="DobPhoto rows">
|
||||
<form id="upload-container" class="upload-container" method="POST" action="send.php">
|
||||
<img id="upload-image" src="img/icons8-загрузить-64.png">
|
||||
<div>
|
||||
<input id="file-input" type="file" name="file" multiple>
|
||||
<label for="file-input">Выберите файл</label>
|
||||
<span>или перетащите его сюда</span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="info">
|
||||
<div class="FIO">Иван Иванов</div>
|
||||
<div class="info_list-item" style="margin-top: 5%">Дата рождения - 25.09.2018</div>
|
||||
<div class="info_list-item" style="margin-top: 5%">Просмотрено фильмов - 123</div>
|
||||
<div class="info_list-item" style="margin-top: 5%; margin-bottom: 5%">Просмотрено сериалов - 123</div>
|
||||
<button class="btn btn-outline-warning button_add" type="button"><a class="nav-link" aria-current="page" href="admin.html" style="text-decoration: none">Панель администратора</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<div class="blocks rows">
|
||||
<div class="LK_block" style="">
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 10%">
|
||||
Любимые фильмы
|
||||
</div>
|
||||
</div>
|
||||
<div class="LK_block">
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 10%">
|
||||
Любимые сериалы
|
||||
</div>
|
||||
</div>
|
||||
<div class="LK_block">
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="img/Prev.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 20%">
|
||||
Ожидаемое
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
29
README.md
@ -1,2 +1,29 @@
|
||||
# Internet-programming
|
||||
#### Окружение:
|
||||
- nodejs 18;
|
||||
- VSCode;
|
||||
- ESLint плагин для VSCode;
|
||||
- для отладки необходимы бразузеры Chrome или Edge.
|
||||
|
||||
#### Создание пустого проекта:
|
||||
|
||||
```commandline
|
||||
npm create vite@latest ./ -- --template react
|
||||
```
|
||||
|
||||
#### Установка зависимостей:
|
||||
|
||||
```commandline
|
||||
npm install
|
||||
```
|
||||
|
||||
#### Запуск проекта:
|
||||
|
||||
```commandline
|
||||
npm run dev
|
||||
```
|
||||
|
||||
#### Сборка проекта:
|
||||
|
||||
```commandline
|
||||
npm run build
|
||||
```
|
@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F"></body>
|
||||
<main>
|
||||
<div class="Join">
|
||||
<center><a href="index.html"><img src="img/Title_black.png" alt="название" class="Title"></a></center>
|
||||
<div>
|
||||
<input class="reg_name" placeholder="Имя" tabindex="1" name="username" type="text"/>
|
||||
<input class="reg_login" placeholder="Логин" tabindex="2" name="login" type="text"/>
|
||||
<input class="reg_mail" placeholder="Почта пользователя" tabindex="3" name="mail" type="email">
|
||||
<input class="reg_pass" placeholder="Пароль" tabindex="4" name="password" type="password"/>
|
||||
<button class="reg_ButtonJoin" type="submit">Регистрация</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</html>
|
65
admin.html
@ -1,65 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark admin fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
<div class="button_input">
|
||||
<button class="btn btn-outline-warning AdminPanel" type="button"><a class="nav-link" aria-current="page" href="Input.html" style="text-decoration: none">Добавить фильм</a></button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="items-table" class="table table-striped" style="--bs-table-bg: #03001F; --bs-table-border-color: #03001F; --bs-table-color: white; --bs-table-striped-color: white; border-color: white">
|
||||
<thead>
|
||||
<th scope="col" class="colums">№</th>
|
||||
<th scope="col" class="w-25 colums">Жанр</th>
|
||||
<th scope="col" class="w-25 colums">Название</th>
|
||||
<th scope="col" class="w-25 colums">Актерский состав</th>
|
||||
<th scope="col" class="w-25 colums">Описание</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
<script type="module">
|
||||
import validation from "./js/validation";
|
||||
import { linesForm } from "./js/lines";
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
validation();
|
||||
linesForm();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
70
dist/Film.html
vendored
@ -1,70 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/bootstrap.min-913b42e3.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark film fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<div class="film rows container item">
|
||||
<div class="Rating" style="">
|
||||
<div>
|
||||
<img class="prevFilm" src="/assets/Prev-505d4927.png" alt="превью">
|
||||
</div>
|
||||
<div class="rat">
|
||||
Рейтинг
|
||||
</div>
|
||||
<div class="rat">
|
||||
10 из 10
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<div class="rat">
|
||||
Название фильма
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-warning watch" type="button"><a class="nav-link" aria-current="page" href="media.html" style="text-decoration: none">Просмотр</a></button>
|
||||
</div>
|
||||
<div class="description_info">
|
||||
Описание фильма
|
||||
</div>
|
||||
</div>
|
||||
<div class="actorList">
|
||||
<div class="actor">
|
||||
Актерский состав
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
78
dist/Input.html
vendored
@ -1,78 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/input-edca0df3.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/bootstrap.min-913b42e3.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/lines-rest-api-38f971a9.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/lines-d024f035.js">
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark HeadInput input fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
<div class="text-center">
|
||||
<img id="image-preview" src="https://via.placeholder.com/200" class="rounded rounded-circle"
|
||||
alt="placeholder" style="max-width: 200px; max-height: 200px">
|
||||
</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 for="title" class="form-label">Название видео</label>
|
||||
<input id="title" class="form-control" name="selected" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label" for="cast">Актерский состав</label>
|
||||
<input id="cast" name="price" class="form-control" type="text" style="height: 10%" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label" for="description">Описание</label>
|
||||
<input id="description" name="description" class="form-control" type="text" style="height: 10%" 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 class="mb-2">
|
||||
<label class="form-label" for="video">Видеофайл</label>
|
||||
<input id="video" type="file" name="video" class="form-control" accept="video/*">
|
||||
</div>
|
||||
<a href="admin.html" class="btn btn-secondary" style="height: 7%;font-size: 16px">Назад</a>
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
27
dist/Join.html
vendored
@ -1,27 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Вход в OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="module" crossorigin src="/assets/bootstrap.min-913b42e3.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F"></body>
|
||||
<main>
|
||||
<div class="Join">
|
||||
<center><a href="index.html"><img src="/assets/Title_black-416c6e2d.png" alt="название" class="Title"></a></center>
|
||||
<div>
|
||||
<input class="name" placeholder="Логин / почта пользователя" tabindex="1" name="username" type="text"/>
|
||||
<input class="pass" placeholder="Пароль" tabindex="1" name="password" type="password"/>
|
||||
<a class="Mistake">Забыли пароль?</a>
|
||||
<button class="ButtonJoin" type="submit">Войти</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</html>
|
101
dist/LK.html
vendored
@ -1,101 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/bootstrap.min-913b42e3.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark LK2 fixed-top">
|
||||
<div class="container-fluid LK">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<div class="DobPhoto rows">
|
||||
<form id="upload-container" class="upload-container" method="POST" action="send.php">
|
||||
<img id="upload-image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAABJklEQVR4nO2YQUrEQBBFX+eWYsZruC1dudBZKQh6kzmSK/UAJUItQpjOrHrodP0HBQkJpOt3VX06IIQQQgghxLUpwC1wE9epKMAb4BGfwETS5D2TCKWSfAoRyoXkhxahAO+rRL8q1x7vlpF3/gN4WNwb8DpiJZRK8lMkvRSgjCjCy0ZprwWotcqRHfO70dfnBDgnwjc75hH4iUpYD7WaAMS7zyHg+tkw2IYAKTAJgCrA1QJoBriGIHIBIyEmF0Au4HIB5AIuF0AuYCTEsrvAYSHATEKmSHze+4/PNExRtodOd6z5+u4WPfv/kd5ovj7rfGo3X59JAFQBrhZAM8A1BJELGMlt8ATcdxanawrgnYe1Pr565zG3PL4+dR46XgshhBBCCC7zB9eCREG4l8/PAAAAAElFTkSuQmCC">
|
||||
<div>
|
||||
<input id="file-input" type="file" name="file" multiple>
|
||||
<label for="file-input">Выберите файл</label>
|
||||
<span>или перетащите его сюда</span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="info">
|
||||
<div class="FIO">Иван Иванов</div>
|
||||
<div class="info_list-item" style="margin-top: 5%">Дата рождения - 25.09.2018</div>
|
||||
<div class="info_list-item" style="margin-top: 5%">Просмотрено фильмов - 123</div>
|
||||
<div class="info_list-item" style="margin-top: 5%; margin-bottom: 5%">Просмотрено сериалов - 123</div>
|
||||
<button class="btn btn-outline-warning button_add" type="button"><a class="nav-link" aria-current="page" href="admin.html" style="text-decoration: none">Панель администратора</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<div class="blocks rows">
|
||||
<div class="LK_block" style="">
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 10%">
|
||||
Любимые фильмы
|
||||
</div>
|
||||
</div>
|
||||
<div class="LK_block">
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 10%">
|
||||
Любимые сериалы
|
||||
</div>
|
||||
</div>
|
||||
<div class="LK_block">
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%; margin-bottom: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="rows">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью" style="margin-right: 2%">
|
||||
<img src="/assets/Prev-505d4927.png" class="LK-img" alt="превью">
|
||||
</div>
|
||||
<div class="Title_blocks" style="color: white; margin-left: 20%">
|
||||
Ожидаемое
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
30
dist/Register.html
vendored
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/bootstrap.min-913b42e3.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F"></body>
|
||||
<main>
|
||||
<div class="Join">
|
||||
<center><a href="index.html"><img src="/assets/Title_black-416c6e2d.png" alt="название" class="Title"></a></center>
|
||||
<div>
|
||||
<input class="reg_name" placeholder="Имя" tabindex="1" name="username" type="text"/>
|
||||
<input class="reg_login" placeholder="Логин" tabindex="2" name="login" type="text"/>
|
||||
<input class="reg_mail" placeholder="Почта пользователя" tabindex="3" name="mail" type="email">
|
||||
<input class="reg_pass" placeholder="Пароль" tabindex="4" name="password" type="password"/>
|
||||
<button class="reg_ButtonJoin" type="submit">Регистрация</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</html>
|
62
dist/admin.html
vendored
@ -1,62 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/admin-091b7884.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/bootstrap.min-913b42e3.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/lines-rest-api-38f971a9.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/lines-d024f035.js">
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark admin fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
<div class="button_input">
|
||||
<button class="btn btn-outline-warning AdminPanel" type="button"><a class="nav-link" aria-current="page" href="Input.html" style="text-decoration: none">Добавить фильм</a></button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="items-table" class="table table-striped" style="--bs-table-bg: #03001F; --bs-table-border-color: #03001F; --bs-table-color: white; --bs-table-striped-color: white; border-color: white">
|
||||
<thead>
|
||||
<th scope="col" class="colums">№</th>
|
||||
<th scope="col" class="w-25 colums">Жанр</th>
|
||||
<th scope="col" class="w-25 colums">Название</th>
|
||||
<th scope="col" class="w-25 colums">Актерский состав</th>
|
||||
<th scope="col" class="w-25 colums">Описание</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
dist/assets/Prev-505d4927.png
vendored
Before Width: | Height: | Size: 489 KiB |
BIN
dist/assets/Title-7a451a58.png
vendored
Before Width: | Height: | Size: 17 KiB |
BIN
dist/assets/Title_black-416c6e2d.png
vendored
Before Width: | Height: | Size: 15 KiB |
1
dist/assets/admin-091b7884.js
vendored
@ -1 +0,0 @@
|
||||
import"./bootstrap.min-913b42e3.js";import{v as o,a as t}from"./lines-d024f035.js";import"./lines-rest-api-38f971a9.js";document.addEventListener("DOMContentLoaded",()=>{o(),t()});
|
9
dist/assets/bootstrap-3c5274c7.css
vendored
5
dist/assets/bootstrap.min-913b42e3.js
vendored
BIN
dist/assets/fa-brands-400-003f1154.ttf
vendored
BIN
dist/assets/fa-brands-400-faae6fc0.woff2
vendored
BIN
dist/assets/fa-regular-400-7d81a1a7.ttf
vendored
BIN
dist/assets/fa-regular-400-9169d8be.woff2
vendored
BIN
dist/assets/fa-solid-900-886c8611.woff2
vendored
BIN
dist/assets/fa-solid-900-cea79b34.ttf
vendored
BIN
dist/assets/fa-v4compatibility-335fd7d9.woff2
vendored
BIN
dist/assets/fa-v4compatibility-455e8e72.ttf
vendored
1
dist/assets/input-edca0df3.js
vendored
@ -1 +0,0 @@
|
||||
import"./bootstrap.min-913b42e3.js";import{v as o,l as t}from"./lines-d024f035.js";import"./lines-rest-api-38f971a9.js";document.addEventListener("DOMContentLoaded",()=>{o(),t()});
|
1
dist/assets/lines-d024f035.js
vendored
@ -1 +0,0 @@
|
||||
import{a as g,b as h,g as v,c as w,u as y,d as E}from"./lines-rest-api-38f971a9.js";function F(){const t=document.querySelectorAll("form.needs-validation");for(let e=0;e<t.length;e+=1){const o=t[e];o.addEventListener("submit",n=>{o.checkValidity()||(n.preventDefault(),n.stopPropagation()),o.classList.add("was-validated")})}}const a={button:document.getElementById("items-add"),table:document.querySelector("#items-table tbody"),form:document.getElementById("items-form"),lineId:document.getElementById("items-line-id"),genre:document.getElementById("item"),title:document.getElementById("title"),cast:document.getElementById("cast"),description:document.getElementById("description"),image:document.getElementById("image"),video:document.getElementById("video"),imagePreview:document.getElementById("image-preview")},m="https://via.placeholder.com/200";function u(t,e="",o=!1){const n=document.createElement("option");return n.value=e||"",n.selected=o,n.text=t,n}function f(t,e){const o=document.createElement("i");o.classList.add("fa-solid",t);const n=document.createElement("a");n.href="#",n.appendChild(o),n.onclick=l=>{l.preventDefault(),l.stopPropagation(),e()};const i=document.createElement("td");return i.appendChild(n),i}function d(t){const e=document.createElement("td");return e.textContent=t,e}function b(t,e,o,n,i){const l=document.createElement("th");l.scope="row",l.textContent=e+1;const c=document.createElement("tr");return c.id=`line-${t.id}`,c.appendChild(l),c.appendChild(d(t.items.name)),c.appendChild(d(t.title)),c.appendChild(d(t.cast)),c.appendChild(d(t.description)),c.appendChild(f("fa-pen-to-square",n)),c.appendChild(f("fa-trash",i)),c}async function C(){const t=await h();a.genre.appendChild(u("Выберите значение","",!0)),t.forEach(e=>{a.genre.appendChild(u(e.name,e.id))})}async function s(){if(console.info("Try to load data"),!a.table)return;const t=await v();a.table.innerHTML="",t.forEach((e,o)=>{a.table.appendChild(b(e,o,()=>location.assign(`Input.html?id=${e.id}`),()=>location.assign(`Input.html?id=${e.id}`),()=>P(e.id)))})}async function I(t,e,o,n,i,l){console.info("Try to add item");const c=await w(t,e,o,n,i,l);console.info("Added"),console.info(c),s()}async function L(t,e,o,n,i,l,c){console.info("Try to update item");const r=await y(t,e,o,n,i,l,c);console.info("Updated"),console.info(r),s()}async function P(t){if(!confirm("Do you really want to remove this item?")){console.info("Canceled");return}console.info("Try to remove item");const e=await E(t);console.info(e),s()}async function p(t){const e=new FileReader;return new Promise((o,n)=>{e.onloadend=()=>{const i=e.result;o(i)},e.onerror=()=>{n(new Error("oops, something went wrong with the file reader."))},e.readAsDataURL(t)})}async function B(){const t=a.image.files[0],e=await p(t);console.info("base64 ",e),a.imagePreview.src=e}function A(){console.info("linesForm"),s()}async function k(){console.info("linesPageForm"),C();const t=()=>location.assign("/admin.html");a.image.addEventListener("change",()=>B());const o=new URLSearchParams(location.search).get("id");if(o)try{const n=await g(o);a.genre.value=n.itemsId,a.title.value=n.title,a.cast.value=n.cast,a.description.value=n.description,a.imagePreview.src=n.image?n.image:m}catch{t()}a.form.addEventListener("submit",async n=>{if(console.info("Form onSubmit"),n.preventDefault(),n.stopPropagation(),!a.form.checkValidity())return;let i="imageTag",l="videoTag";if(a.imagePreview.src!==m){const r=await(await fetch(a.imagePreview.src)).blob();i=await p(r)}o?await L(o,a.genre.value,a.title.value,a.cast.value,a.description.value,i,l):await I(a.genre.value,a.title.value,a.cast.value,a.description.value,i,l),t()})}export{A as a,k as l,F as v};
|
1
dist/assets/lines-rest-api-38f971a9.js
vendored
@ -1 +0,0 @@
|
||||
const s="http://localhost:8081";function f(t,e,n,o,i,a){return{itemsId:t,title:e,cast:n,description:o,image:i,video:a}}async function h(){const t=await fetch(`${s}/items`);if(!t.ok)throw t.statusText;return t.json()}async function l(){const t=await fetch(`${s}/lines?_expand=items`);if(!t.ok)throw t.statusText;return t.json()}async function d(t){const e=await fetch(`${s}/lines/${t}?_expand=items`);if(!e.ok)throw e.statusText;return e.json()}async function j(t,e,n,o,i,a){const r=f(t,e,n,o,i,a),p={method:"POST",body:JSON.stringify(r),headers:{Accept:"application/json","Content-Type":"application/json"}},c=await fetch(`${s}/lines`,p);if(!c.ok)throw c.statusText;return c.json()}async function y(t,e,n,o,i,a,r){const p=f(e,n,o,i,a,r),c={method:"PUT",body:JSON.stringify(p),headers:{Accept:"application/json","Content-Type":"application/json"}},u=await fetch(`${s}/lines/${t}`,c);if(!u.ok)throw u.statusText;return u.json()}async function w(t){const e={method:"DELETE"},n=await fetch(`${s}/lines/${t}`,e);if(!n.ok)throw n.statusText;return n.json()}export{d as a,h as b,j as c,w as d,l as g,y as u};
|
13
dist/assets/main-36e18992.js
vendored
@ -1,13 +0,0 @@
|
||||
import"./bootstrap.min-913b42e3.js";import{g as n}from"./lines-rest-api-38f971a9.js";async function o(a,t,e){const r=document.querySelector(".images");e==""&&(e="img/korotysh.png");const c=`
|
||||
<button class="prev" style="background-color: #03001F; border: none; margin-left: 1%">
|
||||
<a href="Film.html">
|
||||
<div class="card text-bg-dark" style="max-width: 20rem">
|
||||
<img src="${e}" class="card-img" alt="превью">
|
||||
<div class="card-img-overlay">
|
||||
<h5 class="card-title">${a}</h5>
|
||||
<p class="card-text">${t}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</button>
|
||||
`;r.insertAdjacentHTML("beforeend",c)}async function s(){const a=await n();console.log(a),a.forEach(t=>{o(t.title,t.description,t.image)})}document.addEventListener("DOMContentLoaded",()=>{s()});
|
BIN
dist/assets/sobaka-letit_(VIDEOMIN.NET)-7f240fdc.mp4
vendored
82
dist/index.html
vendored
@ -1,82 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/main-36e18992.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/bootstrap.min-913b42e3.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/lines-rest-api-38f971a9.js">
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark index fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
|
||||
<span class="text">Рекомендуемое</span>
|
||||
<div class="card-group rows images">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
<footer>
|
||||
<span class="text">Жанры</span>
|
||||
<div class="genreselection">
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem;margin: 0 0 0 0.5%">Комедия</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Боевик</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Фэнтези</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Романтика</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Драма</button>
|
||||
</div>
|
||||
<div class="d-grid gap-2 d-md-flex">
|
||||
<button class="btn btn-light me-md-2" type="button">Сериалы</button>
|
||||
<button class="btn btn-light" type="button">Спорт</button>
|
||||
</div>
|
||||
<div class="d-grid gap-2 d-md-flex">
|
||||
<button class="btn btn-light me-md-2" type="button">Ужасы</button>
|
||||
<button class="btn btn-light" type="button">Триллеры</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group dropup">
|
||||
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" style="font-size: 20px">
|
||||
Жанры
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><button type="button" class="btn btn-secondary" >Комедия</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Боевик</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Фэнтези</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Романтика</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Драма</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
44
dist/media.html
vendored
@ -1,44 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<script type="module" crossorigin src="/assets/bootstrap.min-913b42e3.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-3c5274c7.css">
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top">
|
||||
<div class="container-fluid mediaLK">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="/assets/Title-7a451a58.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
<div class='video-container'>
|
||||
<video controls src="/assets/sobaka-letit_(VIDEOMIN.NET)-7f240fdc.mp4" class='video-player' id='video-player' preload='metadata'></video>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
81
index.html
@ -1,78 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>OKPO</title>
|
||||
</head>
|
||||
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark index fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="container-fluid p-2">
|
||||
|
||||
<span class="text">Рекомендуемое</span>
|
||||
<div class="card-group rows images">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
<footer>
|
||||
<span class="text">Жанры</span>
|
||||
<div class="genreselection">
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem;margin: 0 0 0 0.5%">Комедия</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Боевик</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Фэнтези</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Романтика</button>
|
||||
<button type="button" class="btn btn-secondary" style="width: 17rem; margin: 0 0 0 2%;">Драма</button>
|
||||
</div>
|
||||
<div class="d-grid gap-2 d-md-flex">
|
||||
<button class="btn btn-light me-md-2" type="button">Сериалы</button>
|
||||
<button class="btn btn-light" type="button">Спорт</button>
|
||||
</div>
|
||||
<div class="d-grid gap-2 d-md-flex">
|
||||
<button class="btn btn-light me-md-2" type="button">Ужасы</button>
|
||||
<button class="btn btn-light" type="button">Триллеры</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group dropup">
|
||||
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" style="font-size: 20px">
|
||||
Жанры
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><button type="button" class="btn btn-secondary" >Комедия</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Боевик</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Фэнтези</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Романтика</button></li>
|
||||
<li><button type="button" class="btn btn-secondary" >Драма</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</footer>
|
||||
<div id="root" class="h-100 d-flex flex-column"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
<script type="module" src="js/Cards.js"></script>
|
||||
|
||||
</html>
|
41
js/Cards.js
@ -1,41 +0,0 @@
|
||||
import {
|
||||
getAllLines
|
||||
} from "./lines-rest-api";
|
||||
|
||||
|
||||
async function createCard(title, description, image) {
|
||||
const cardContainer = document.querySelector('.images');
|
||||
|
||||
if (image === "") {
|
||||
image = "img/korotysh.png"
|
||||
}
|
||||
|
||||
const cardItem =
|
||||
`
|
||||
<button class="prev" style="background-color: #03001F; border: none; margin-left: 1%">
|
||||
<a href="Film.html">
|
||||
<div class="card text-bg-dark" style="max-width: 20rem">
|
||||
<img src="${image}" class="card-img" alt="превью">
|
||||
<div class="card-img-overlay">
|
||||
<h5 class="card-title">${title}</h5>
|
||||
<p class="card-text">${description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</button>
|
||||
`;
|
||||
|
||||
cardContainer.insertAdjacentHTML('beforeend', cardItem);
|
||||
}
|
||||
|
||||
async function createCards() {
|
||||
const data = await getAllLines();
|
||||
console.log(data)
|
||||
data.forEach(item => {
|
||||
createCard( item.title, item.description, item.image);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
createCards();
|
||||
});
|
46
js/banner.js
@ -1,46 +0,0 @@
|
||||
// модуль для смены изображения в баннере по таймеру
|
||||
|
||||
import "../css/banner.css";
|
||||
|
||||
// указывается блок, в котором будет баннер
|
||||
// блок должен содержать изображения
|
||||
function myBanner(root) {
|
||||
console.info("Loaded");
|
||||
|
||||
// получение всех изображений внутри баннера
|
||||
const banners = document.querySelectorAll(`${root} img`);
|
||||
|
||||
// всем изображениям устанавливается класс banner-hide
|
||||
// если были другие классы, то они будут удалены
|
||||
for (let i = 0; i < banners.length; i += 1) {
|
||||
banners[i].setAttribute("class", "banner-hide");
|
||||
}
|
||||
|
||||
let old = banners.length - 1;
|
||||
let current = 0;
|
||||
|
||||
// функция меняет изображения в цикле
|
||||
// изображение с классом banner-show будет показано
|
||||
// изображение с классом banner-hide будет скрыто
|
||||
// функция запускает таймер, который через 5 секунд
|
||||
// запускает функцию, снова создается таймер и т. д.
|
||||
function loop() {
|
||||
banners[current].setAttribute("class", "banner-show");
|
||||
banners[old].setAttribute("class", "banner-hide");
|
||||
|
||||
console.info("Banner changed");
|
||||
|
||||
old = current;
|
||||
current += 1;
|
||||
|
||||
if (current === banners.length) {
|
||||
current = 0;
|
||||
}
|
||||
|
||||
setTimeout(loop, 5000);
|
||||
}
|
||||
|
||||
loop();
|
||||
}
|
||||
|
||||
export default myBanner;
|
@ -1,59 +0,0 @@
|
||||
// Модуль для работы с модальным окном
|
||||
|
||||
// импорт компонента Modal из bootstrap
|
||||
import { Modal } from "bootstrap";
|
||||
import { cntrls, imagePlaceholder } from "./lines-ui";
|
||||
|
||||
// поиск модального окна на странице
|
||||
const modal = document.getElementById("items-update");
|
||||
// если он найден, то создается экземпляр компонента Modal
|
||||
// для программного управления модальным окном
|
||||
const myModal = modal ? new Modal(modal, {}) : null;
|
||||
|
||||
// поиск тега с заголовком модального кона для его смены
|
||||
const modalTitle = document.getElementById("items-update-title");
|
||||
|
||||
// обнуление значений модального окна, т. к.
|
||||
// используется одно окно для всех операций
|
||||
function resetValues() {
|
||||
cntrls.lineId.value = "";
|
||||
cntrls.itemsType.value = "";
|
||||
cntrls.price.value = parseFloat(0).toFixed(2);
|
||||
cntrls.count.value = 0;
|
||||
cntrls.image.value = "";
|
||||
cntrls.imagePreview.src = imagePlaceholder;
|
||||
}
|
||||
|
||||
// функция для показа модального окна
|
||||
// перед показом происходит заполнение формы для редактирования
|
||||
// если объект item не пуст
|
||||
export function showUpdateModal(item) {
|
||||
modalTitle.innerHTML = item === null ? "Добавить" : "Изменить";
|
||||
console.info(item);
|
||||
|
||||
if (item) {
|
||||
cntrls.lineId.value = item.id;
|
||||
cntrls.itemsType.value = item.itemsId;
|
||||
cntrls.price.value = item.price;
|
||||
cntrls.count.value = item.count;
|
||||
// заполнение превью
|
||||
// Если пользователь выбрал изображение, то оно загружается
|
||||
// в тэг image с id image - preview
|
||||
// иначе устанавливается заглушка, адрес которой указан в imagePlaceholder
|
||||
cntrls.imagePreview.src = item.image ? item.image : imagePlaceholder;
|
||||
} else {
|
||||
resetValues();
|
||||
}
|
||||
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
// функция для скрытия модального окна
|
||||
export function hideUpdateModal() {
|
||||
resetValues();
|
||||
|
||||
// удаление класса was-validated для скрытия результатов валидации
|
||||
cntrls.form.classList.remove("was-validated");
|
||||
|
||||
myModal.hide();
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
// модуль для работы с REST API сервера
|
||||
|
||||
// адрес сервера
|
||||
const serverUrl = "http://localhost:8081";
|
||||
|
||||
// функция возвращает объект нужной структуры для отправки на сервер
|
||||
function createLineObject(genre, title, cast, description, image, video) {
|
||||
return {
|
||||
itemsId: genre,
|
||||
title,
|
||||
cast,
|
||||
description,
|
||||
image,
|
||||
video,
|
||||
};
|
||||
}
|
||||
|
||||
// обращение к серверу для получения всех типов товара (get)
|
||||
export async function getAllItemTypes() {
|
||||
const response = await fetch(`${serverUrl}/items`);
|
||||
if (!response.ok) {
|
||||
throw response.statusText;
|
||||
}
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// обращение к серверу для получения всех записей (get)
|
||||
export async function getAllLines() {
|
||||
const response = await fetch(`${serverUrl}/lines?_expand=items`);
|
||||
if (!response.ok) {
|
||||
throw response.statusText;
|
||||
}
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// обращение к серверу для получения записи по первичному ключу (id) (get)
|
||||
// id передается в качестве части пути URL get-запроса
|
||||
export async function getLine(id) {
|
||||
const response = await fetch(`${serverUrl}/lines/${id}?_expand=items`);
|
||||
if (!response.ok) {
|
||||
throw response.statusText;
|
||||
}
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// обращение к серверу для создания записи (post)
|
||||
// объект отправляется в теле запроса (body)
|
||||
export async function createLine(genre, title, cast, description, image, video) {
|
||||
const itemObject = createLineObject(genre, title, cast, description, image, video);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// обращение к серверу для обновления записи по id (put)
|
||||
// объект отправляется в теле запроса (body)
|
||||
// id передается в качестве части пути URL get-запроса
|
||||
export async function updateLine(id,genre, title, cast, description, image, video) {
|
||||
const itemObject = createLineObject(genre, title, cast, description, image, video);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// обращение к серверу для удаления записи по id (delete)
|
||||
// id передается в качестве части пути URL get-запроса
|
||||
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();
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
// модуль для работы с элементами управления
|
||||
|
||||
// объект для удобного получения элементов
|
||||
// при обращении к атрибуту объекта вызывается
|
||||
// нужная функция для поиска элемента
|
||||
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"),
|
||||
genre: document.getElementById("item"),
|
||||
title: document.getElementById("title"),
|
||||
cast: document.getElementById("cast"),
|
||||
description: document.getElementById("description"),
|
||||
image: document.getElementById("image"),
|
||||
video: document.getElementById("video"),
|
||||
imagePreview: document.getElementById("image-preview"),
|
||||
};
|
||||
|
||||
// Дефолтное превью
|
||||
export const imagePlaceholder = "https://via.placeholder.com/200";
|
||||
|
||||
// функция создает тег option для select
|
||||
// <option value="" selected>name</option>
|
||||
export function createItemsOption(name, value = "", isSelected = false) {
|
||||
const option = document.createElement("option");
|
||||
option.value = value || "";
|
||||
option.selected = isSelected;
|
||||
option.text = name;
|
||||
return option;
|
||||
}
|
||||
|
||||
// функция создает ссылку (a) для таблицы
|
||||
// содержимое тега a заполняется необходимой иконкой (icon)
|
||||
// при нажатии вызывается callback
|
||||
// ссылка "оборачивается" тегом td
|
||||
// <td><a href="#" onclick="callback()"><i class="fa-solid icon"></i></a></td>
|
||||
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) => {
|
||||
// чтобы в URL не добавлялась решетка
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
callback();
|
||||
};
|
||||
|
||||
const td = document.createElement("td");
|
||||
td.appendChild(a);
|
||||
return td;
|
||||
}
|
||||
|
||||
// функция создает колонку таблицы с текстом value
|
||||
// <td>value</td>
|
||||
function createTableColumn(value) {
|
||||
const td = document.createElement("td");
|
||||
td.textContent = value;
|
||||
return td;
|
||||
}
|
||||
|
||||
// функция создает строку таблицы
|
||||
// <tr>
|
||||
// <th scope="row">index + 1</th>
|
||||
// <td>item.items.name</td>
|
||||
// <td>parseFloat(item.price).toFixed(2))</td>
|
||||
// <td>item.count</td>
|
||||
// <td>parseFloat(item.sum).toFixed(2))</td>
|
||||
// <td><a href="#" onclick="editCallback()"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
// <td><a href="#" onclick="editPageCallback()"><i class="fa-solid fa-pen-to-square"></i></a></td>
|
||||
// <td><a href="#" onclick="deleteCallback()"><i class="fa-solid fa-trash"></i></a></td>
|
||||
// </tr>
|
||||
export function createTableRow(item, index, editCallback, editPageCallback, 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(item.title));
|
||||
row.appendChild(createTableColumn(item.cast));
|
||||
row.appendChild(createTableColumn(item.description));
|
||||
|
||||
// редактировать на странице page-edit
|
||||
row.appendChild(createTableAnchor("fa-pen-to-square", editPageCallback));
|
||||
// удаление
|
||||
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
|
||||
return row;
|
||||
}
|
245
js/lines.js
@ -1,245 +0,0 @@
|
||||
// модуль с логикой
|
||||
|
||||
import {
|
||||
createLine, deleteLine, getAllItemTypes, getAllLines, getLine, updateLine,
|
||||
} from "./lines-rest-api";
|
||||
import {
|
||||
cntrls, createItemsOption, createTableRow, imagePlaceholder,
|
||||
} from "./lines-ui";
|
||||
|
||||
async function drawItemsSelect() {
|
||||
// вызов метода REST API для получения списка типов товаров
|
||||
const data = await getAllItemTypes();
|
||||
// очистка содержимого select
|
||||
// удаляется все, что находится между тегами <select></select>
|
||||
// но не атрибуты
|
||||
//cntrls.itemsType.innerHTML = "";
|
||||
// пустое значение
|
||||
cntrls.genre.appendChild(createItemsOption("Выберите значение", "", true));
|
||||
// цикл по результату ответа от сервера
|
||||
// используется лямбда-выражение
|
||||
// (item) => {} аналогично function(item) {}
|
||||
data.forEach((item) => {
|
||||
cntrls.genre.appendChild(createItemsOption(item.name, item.id));
|
||||
});
|
||||
}
|
||||
|
||||
async function drawLinesTable() {
|
||||
console.info("Try to load data");
|
||||
if (!cntrls.table) {
|
||||
return;
|
||||
}
|
||||
// вызов метода REST API для получения всех записей
|
||||
const data = await getAllLines();
|
||||
// очистка содержимого table
|
||||
// удаляется все, что находится между тегами <table></table>
|
||||
// но не атрибуты
|
||||
cntrls.table.innerHTML = "";
|
||||
// цикл по результату ответа от сервера
|
||||
// используется лямбда-выражение
|
||||
// (item, index) => {} аналогично function(item, index) {}
|
||||
data.forEach((item, index) => {
|
||||
cntrls.table.appendChild(
|
||||
createTableRow(
|
||||
item,
|
||||
index,
|
||||
// функции передаются в качестве параметра
|
||||
// это очень удобно, так как аргументы функций доступны только
|
||||
// в данном месте кода и не передаются в сервисные модули
|
||||
() => location.assign(`Input.html?id=${item.id}`),
|
||||
() => location.assign(`Input.html?id=${item.id}`),
|
||||
() => removeLine(item.id),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async function addLine(genre, title, cast, description, image, video) {
|
||||
console.info("Try to add item");
|
||||
// вызов метода REST API для добавления записи
|
||||
const data = await createLine(genre, title, cast, description, image, video);
|
||||
console.info("Added");
|
||||
console.info(data);
|
||||
// загрузка и заполнение table
|
||||
drawLinesTable();
|
||||
}
|
||||
|
||||
async function editLine(id,genre, title, cast, description, image, video) {
|
||||
console.info("Try to update item");
|
||||
// вызов метода REST API для обновления записи
|
||||
const data = await updateLine(id,genre, title, cast, description, image, video);
|
||||
console.info("Updated");
|
||||
console.info(data);
|
||||
// загрузка и заполнение table
|
||||
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");
|
||||
// вызов метода REST API для удаления записи
|
||||
const data = await deleteLine(id);
|
||||
console.info(data);
|
||||
// загрузка и заполнение table
|
||||
drawLinesTable();
|
||||
}
|
||||
|
||||
// функция для получения содержимого файла в виде base64 строки
|
||||
// https://ru.wikipedia.org/wiki/Base64
|
||||
async function readFile(file) {
|
||||
const reader = new FileReader();
|
||||
|
||||
// создание Promise-объекта для использования функции
|
||||
// с помощью await (асинхронно) без коллбэков (callback)
|
||||
// https://learn.javascript.ru/promise
|
||||
return new Promise((resolve, reject) => {
|
||||
// 2. "Возвращаем" содержимое когда файл прочитан
|
||||
// через вызов resolve
|
||||
// Если не использовать Promise, то всю работу по взаимодействию
|
||||
// с REST API пришлось бы делать в обработчике (callback) функции
|
||||
// onloadend
|
||||
reader.onloadend = () => {
|
||||
const fileContent = reader.result;
|
||||
// Здесь могла бы быть работа с REST API
|
||||
// Чтение заканчивает выполняться здесь
|
||||
resolve(fileContent);
|
||||
};
|
||||
// 3. Возвращаем ошибку
|
||||
reader.onerror = () => {
|
||||
// Или здесь в случае ошибки
|
||||
reject(new Error("oops, something went wrong with the file reader."));
|
||||
};
|
||||
// Шаг 1. Сначала читаем файл
|
||||
// Чтение начинает выполняться здесь
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
// функция для обновления блока с превью выбранного изображения
|
||||
async function updateImagePreview() {
|
||||
// получение выбранного файла
|
||||
// возможен выбор нескольких файлов, поэтому необходимо получить только первый
|
||||
const file = cntrls.image.files[0];
|
||||
// чтение содержимого файла в виде base64 строки
|
||||
const fileContent = await readFile(file);
|
||||
console.info("base64 ", fileContent);
|
||||
// обновление атрибута src для тега img с id image-preview
|
||||
cntrls.imagePreview.src = fileContent;
|
||||
}
|
||||
|
||||
// Функция для обработки создания и редактирования элементов таблицы через модальное окно
|
||||
// Если хотите делать через страницу, то удалите эту функцию
|
||||
export function linesForm() {
|
||||
console.info("linesForm");
|
||||
|
||||
// загрузка и заполнение select со списком товаров
|
||||
//drawItemsSelect();
|
||||
// загрузка и заполнение table
|
||||
drawLinesTable();
|
||||
}
|
||||
|
||||
// Функция для обработки создания и редактирования элементов таблицы через страницу page-edit.html
|
||||
// Если хотите делать через модальное окно, то удалите эту функцию
|
||||
export async function linesPageForm() {
|
||||
console.info("linesPageForm");
|
||||
|
||||
// загрузка и заполнение select со списком товаров
|
||||
drawItemsSelect();
|
||||
|
||||
// func1 = (id) => {} аналогично function func1(id) {}
|
||||
const goBack = () => location.assign("/admin.html");
|
||||
|
||||
// Вызов функции обновления превью изображения при возникновении
|
||||
// события onchange в тэге input с id image
|
||||
cntrls.image.addEventListener("change", () => updateImagePreview());
|
||||
|
||||
// получение параметров GET-запроса из URL
|
||||
// параметры перечислены после символа ? (?id=1&color=black&...)
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
|
||||
// получение значения конкретного параметра (id)
|
||||
// указан только при редактировании
|
||||
const currentId = urlParams.get("id");
|
||||
// если id задан
|
||||
if (currentId) {
|
||||
try {
|
||||
// вызов метода REST API для получения записи по первичному ключу(id)
|
||||
const line = await getLine(currentId);
|
||||
// заполнение формы для редактирования
|
||||
cntrls.genre.value = line.itemsId;
|
||||
cntrls.title.value = line.title;
|
||||
cntrls.cast.value = line.cast;
|
||||
cntrls.description.value = line.description;
|
||||
// заполнение превью
|
||||
// Если пользователь выбрал изображение, то оно загружается
|
||||
// в тэг image с id image - preview
|
||||
// иначе устанавливается заглушка, адрес которой указан в imagePlaceholder
|
||||
cntrls.imagePreview.src = line.image ? line.image : imagePlaceholder;
|
||||
} catch {
|
||||
// в случае ошибки происходит возврат к page4
|
||||
goBack();
|
||||
}
|
||||
}
|
||||
|
||||
// обработчик события отправки формы
|
||||
// возникает при нажатии на кнопку (button) с типом submit
|
||||
// кнопка должна находится внутри тега form
|
||||
cntrls.form.addEventListener("submit", async (event) => {
|
||||
console.info("Form onSubmit");
|
||||
// отключение стандартного поведения формы при отправке
|
||||
// при отправке страница обновляется и JS перестает работать
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
// если форма не прошла валидацию, то ничего делать не нужно
|
||||
if (!cntrls.form.checkValidity()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let imageBase64 = "imageTag";
|
||||
let videoBase64 = "videoTag";
|
||||
// Получение выбранного пользователем изображения в виде base64 строки
|
||||
// Если пользователь ничего не выбрал, то не нужно сохранять в БД
|
||||
// дефолтное изображение
|
||||
if (cntrls.imagePreview.src !== imagePlaceholder) {
|
||||
// Загрузка содержимого атрибута src тэга img с id image-preview
|
||||
// Здесь выполняется HTTP запрос с типом GET
|
||||
const result = await fetch(cntrls.imagePreview.src);
|
||||
// Получение из HTTP-ответа бинарного содержимого
|
||||
const blob = await result.blob();
|
||||
// Получение base64 строки для файла
|
||||
// Здесь выполняется Promise из функции readFile
|
||||
// Promise позволяет писать линейный код для работы с асинхронными методами
|
||||
// без использования обработчиков (callback) с помощью await
|
||||
imageBase64 = await readFile(blob);
|
||||
}
|
||||
|
||||
// если значение параметра запроса не задано,
|
||||
// то необходимо выполнить добавление записи
|
||||
// иначе обновление записи
|
||||
if (!currentId) {
|
||||
await addLine(
|
||||
cntrls.genre.value,
|
||||
cntrls.title.value,
|
||||
cntrls.cast.value,
|
||||
cntrls.description.value,
|
||||
imageBase64,
|
||||
videoBase64,
|
||||
);
|
||||
} else {
|
||||
await editLine(
|
||||
currentId,
|
||||
cntrls.genre.value,
|
||||
cntrls.title.value,
|
||||
cntrls.cast.value,
|
||||
cntrls.description.value,
|
||||
imageBase64,
|
||||
videoBase64,
|
||||
);
|
||||
}
|
||||
// возврат к странице page4
|
||||
goBack();
|
||||
});
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
// модуль используется для валидации форма на странице
|
||||
|
||||
function validation() {
|
||||
// поиск всех форма с классом .needs-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();
|
||||
// предотвращает распространение preventDefault
|
||||
// на другие объекты
|
||||
event.stopPropagation();
|
||||
}
|
||||
// добавляет к форме класс was-validated
|
||||
form.classList.add("was-validated");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default validation;
|
@ -3,7 +3,7 @@
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"target": "ES2020",
|
||||
"jsx": "preserve",
|
||||
"jsx": "react",
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
|
42
media.html
@ -1,42 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OKPO</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<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="CSS/style.css">
|
||||
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="./node_modules/@popperjs/core/dist/umd/popper.min.js" ></script>
|
||||
</head>
|
||||
<body class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top">
|
||||
<div class="container-fluid mediaLK">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img class="MainTitle" src="img/Title.png" alt="название">
|
||||
</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-end" id="navbarNav">
|
||||
<div class="navbar-nav">
|
||||
<button class="btn btn-outline-info" type="submit"><a class="nav-link" aria-current="page" href="Join.html" style="text-decoration: none">Вход</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="Register.html" style="text-decoration: none">Регистрация</a></button>
|
||||
<button class="btn btn-outline-info" type="button"><a class="nav-link" aria-current="page" href="LK.html" style="text-decoration: none">Личный кабинет</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="h-100 d-flex flex-column" style="background-color: #03001F">
|
||||
<div class='video-container'>
|
||||
<video controls src="media/sobaka-letit_(VIDEOMIN.NET).mp4" class='video-player' id='video-player' preload='metadata'></video>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/media" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6730
package-lock.json
generated
38
package.json
@ -1,26 +1,32 @@
|
||||
{
|
||||
"name": "int-prog",
|
||||
"version": "1.0.0",
|
||||
"name": "lec4",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"vite": "vite",
|
||||
"serve": "http-server -p 3000 ./dist/",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"rest": "json-server --watch data.json -p 8081",
|
||||
"dev": "npm-run-all --parallel rest vite",
|
||||
"prod": "npm-run-all build --parallel serve rest"
|
||||
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "5.3.2",
|
||||
"@fortawesome/fontawesome-free": "6.4.2"
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.18.0",
|
||||
"bootstrap": "^5.3.2",
|
||||
"react-bootstrap": "^2.9.1",
|
||||
"react-bootstrap-icons": "^1.10.3",
|
||||
"prop-types": "^15.8.1"
|
||||
},
|
||||
"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"
|
||||
"@types/react": "^18.2.15",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@vitejs/plugin-react": "^4.0.3",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-react": "^7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.3",
|
||||
"vite": "^4.4.5"
|
||||
}
|
||||
}
|
4
public/favicon.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-0-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895"/>
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.012 4.158c1.858 0 2.96-1.582 2.96-3.99V7.84c0-2.426-1.079-3.996-2.936-3.996-1.864 0-2.965 1.588-2.965 3.996v.328c0 2.42 1.09 3.99 2.941 3.99"/>
|
||||
</svg>
|
After Width: | Height: | Size: 476 B |
0
src/App.css
Normal file
22
src/App.jsx
Normal file
@ -0,0 +1,22 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { Container } from 'react-bootstrap';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import './App.css';
|
||||
import Navigation from './components/navigation/Navigation.jsx';
|
||||
|
||||
const App = ({ routes }) => {
|
||||
return (
|
||||
<>
|
||||
<Navigation routes={routes}></Navigation>
|
||||
<Container className='p-2' as="main" fluid>
|
||||
<Outlet />
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
App.propTypes = {
|
||||
routes: PropTypes.array,
|
||||
};
|
||||
|
||||
export default App;
|
Before Width: | Height: | Size: 714 KiB After Width: | Height: | Size: 714 KiB |
Before Width: | Height: | Size: 489 KiB After Width: | Height: | Size: 489 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
19
src/components/Card/Cards.jsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { Button } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const createCard = ({ Title, Description, Image }) => {
|
||||
return (
|
||||
<>
|
||||
<Button className="prev" as={Link} to="/Film" style={{ backgroundColor: '#03001F', border: 'none', marginLeft: '1%' }}>
|
||||
<div className="card text-bg-dark" style={{ maxWidth: '20rem' }}>
|
||||
<img src={Image.img} className="card-img" alt="превью" />
|
||||
<div className="card-img-overlay">
|
||||
<h5 className="card-title">${Title}</h5>
|
||||
<p className="card-text">${Description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default createCard;
|
12
src/components/navigation/Navigation.css
Normal file
@ -0,0 +1,12 @@
|
||||
.my-navbar {
|
||||
background-color: #3c3c3c !important;
|
||||
}
|
||||
|
||||
.my-navbar .link a:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
.my-navbar .logo {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
42
src/components/navigation/Navigation.jsx
Normal file
@ -0,0 +1,42 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Container, Nav, Navbar, Button,
|
||||
} from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
import title from '../../assets/Title.png';
|
||||
|
||||
const Navigation = ({ routes }) => {
|
||||
const indexPageLink = routes.filter((route) => route.index === false).shift();
|
||||
|
||||
return (
|
||||
<header>
|
||||
<Navbar expand='md' className='my-navbar fixed-top' style={{ backgroundColor: '#03001F' }}>
|
||||
<Container fluid>
|
||||
<Navbar.Brand as={Link} to={indexPageLink?.path ?? '/'}>
|
||||
<img className="MainTitle" src={title} alt="название" aria-controls='main-navbar'/>
|
||||
</Navbar.Brand>
|
||||
<Navbar.Toggle aria-controls='main-navbar' />
|
||||
<Navbar.Collapse id='main-navbar' style={{ flexGrow: '0' }}>
|
||||
<Nav className="navbar-nav">
|
||||
<Button className="btn nav-link" variant="outline-info" style={{
|
||||
borderWidth: '2px', borderColor: '#0dcaf0', borderStyle: 'solid',
|
||||
}}><Link to="/Join" style={{ color: 'white', textDecoration: 'none' }}>Вход</Link></Button>{' '}
|
||||
<Button className="btn nav-link" variant="outline-info" style={{
|
||||
borderWidth: '2px', borderColor: '#0dcaf0', borderStyle: 'solid',
|
||||
}}><Link to="/Register" style={{ color: 'white', textDecoration: 'none' }}>Регистрация</Link></Button>{' '}
|
||||
<Button className="btn nav-link" variant="outline-info" style={{
|
||||
borderWidth: '2px', borderColor: '#0dcaf0', borderStyle: 'solid',
|
||||
}}><Link to="/LK" style={{ color: 'white', textDecoration: 'none' }}>Личный кабинет</Link></Button>{' '}
|
||||
</Nav>
|
||||
</Navbar.Collapse>
|
||||
</Container>
|
||||
</Navbar >
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
Navigation.propTypes = {
|
||||
routes: PropTypes.array,
|
||||
};
|
||||
|
||||
export default Navigation;
|
@ -1,8 +1,29 @@
|
||||
*,*:before,*after{
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.btn-mw {
|
||||
width: 100%;
|
||||
}
|
||||
.mt-2{
|
||||
--bs-table-bg: #03001F;
|
||||
--bs-table-color: white;
|
||||
--bs-table-striped-color: white;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.btn-mw {
|
||||
width: 30%;
|
||||
}
|
||||
}
|
||||
|
||||
.selector-for-some-widget {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
@ -158,15 +179,18 @@ header nav a:hover {
|
||||
.text{
|
||||
display: none;
|
||||
}
|
||||
.btn-group{
|
||||
.btn-groups{
|
||||
margin-left: 20%;
|
||||
margin-top: 20%;
|
||||
width: 60%;
|
||||
height: 60%;
|
||||
}
|
||||
.dropbutton{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1020px){
|
||||
.btn-group{
|
||||
.btn-groups{
|
||||
display: none;
|
||||
}
|
||||
.genreselection{
|
||||
@ -184,7 +208,7 @@ header nav a:hover {
|
||||
height: 50%;
|
||||
font-size: 7px;
|
||||
}
|
||||
.btn-group{
|
||||
.btn-groups{
|
||||
margin-left: 20%;
|
||||
margin-top: 20%;
|
||||
width: 60%;
|
||||
@ -345,16 +369,15 @@ header nav a:hover {
|
||||
}
|
||||
@media (min-width: 990px){
|
||||
.MainTitle{
|
||||
width: 200px;
|
||||
height: 70px;
|
||||
margin: 2% 0 0 3%;
|
||||
width: 150px;
|
||||
height: 50px;
|
||||
margin-left: 5%;
|
||||
}
|
||||
}
|
||||
@media (max-width: 990px){
|
||||
.MainTitle{
|
||||
width: 200px;
|
||||
height: 70px;
|
||||
margin-top: 5%;
|
||||
width: 150px;
|
||||
height: 50px;
|
||||
}
|
||||
.Rating{
|
||||
width: 70%;
|
||||
@ -476,7 +499,7 @@ header nav a:hover {
|
||||
@media (max-width: 550px){
|
||||
.video-player{
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
.video-container{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -558,7 +581,6 @@ header nav a:hover {
|
||||
.Title{
|
||||
width:150px;
|
||||
height:50px;
|
||||
margin: 5% 25% 1% 25%;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
@ -567,14 +589,13 @@ header nav a:hover {
|
||||
background-color: white;
|
||||
border-radius: 5%;
|
||||
margin: 12% 14% 12% 14%;
|
||||
height: 80%;
|
||||
height: 60%;
|
||||
width: 70%;
|
||||
}
|
||||
.name{
|
||||
background-color: #D9D9D9;
|
||||
color: black;
|
||||
font-size: 28px;
|
||||
margin: 30% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
border-radius: 50px;
|
||||
@ -582,7 +603,6 @@ header nav a:hover {
|
||||
.pass{
|
||||
background-color: #D9D9D9;
|
||||
color: black;
|
||||
font-size: 28px;
|
||||
margin: 25% 10% 5% 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
@ -591,7 +611,6 @@ header nav a:hover {
|
||||
.ButtonJoin{
|
||||
background-color: #03001F;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
margin: 15% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
@ -615,7 +634,6 @@ header nav a:hover {
|
||||
.ButtonJoin{
|
||||
background-color: #03001F;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
margin: 8% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
@ -639,7 +657,6 @@ header nav a:hover {
|
||||
.reg_ButtonJoin{
|
||||
background-color: #03001F;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
margin: 3% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
@ -657,7 +674,6 @@ header nav a:hover {
|
||||
.Title{
|
||||
width:150px;
|
||||
height:50px;
|
||||
margin: 5% 25% 1% 25%;
|
||||
}
|
||||
.reg_login{
|
||||
background-color: #D9D9D9;
|
||||
@ -691,8 +707,7 @@ header nav a:hover {
|
||||
.reg_ButtonJoin{
|
||||
background-color: #03001F;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
margin: 15% 10% 0 15%;
|
||||
margin: 5% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
border-radius: 50px;
|
||||
@ -709,7 +724,6 @@ header nav a:hover {
|
||||
.Title{
|
||||
width:200px;
|
||||
height:75px;
|
||||
margin: 10% 7% 1% 7%;
|
||||
}
|
||||
.reg_login{
|
||||
background-color: #D9D9D9;
|
||||
@ -743,7 +757,6 @@ header nav a:hover {
|
||||
.reg_ButtonJoin{
|
||||
background-color: #03001F;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
margin: 10% 10% 0 15%;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
@ -761,7 +774,6 @@ header nav a:hover {
|
||||
.Title{
|
||||
width:150px;
|
||||
height:75px;
|
||||
margin: 5% 7% 1% 7%;
|
||||
}
|
||||
.reg_login{
|
||||
background-color: #D9D9D9;
|
||||
@ -836,7 +848,6 @@ header nav a:hover {
|
||||
outline: 2px dashed #5d5d5d;
|
||||
outline-offset: -12px;
|
||||
background-color: #e0f2f7;
|
||||
font-family: 'Segoe UI';
|
||||
color: #1f3c44;
|
||||
|
||||
}
|
||||
@ -861,14 +872,6 @@ header nav a:hover {
|
||||
padding: 0 0 0 10%;
|
||||
}
|
||||
|
||||
#upload-container input[type=file] {
|
||||
width: 0.1px;
|
||||
height: 0.1px;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
z-index: -10;
|
||||
|
||||
}
|
||||
.button_input{
|
||||
margin-top: 2%;
|
||||
}
|
||||
@ -880,3 +883,9 @@ header nav a:hover {
|
||||
.text-center{
|
||||
margin-top: 1%;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.btn-mw {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
73
src/main.jsx
Normal file
@ -0,0 +1,73 @@
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
|
||||
import App from './App.jsx';
|
||||
import './index.css';
|
||||
import ErrorPage from './pages/ErrorPage.jsx';
|
||||
import Index from './pages/Index.jsx';
|
||||
import LK from './pages/LK.jsx';
|
||||
import Film from './pages/Film.jsx';
|
||||
import Admin from './pages/Admin.jsx';
|
||||
import Input from './pages/Input.jsx';
|
||||
import Join from './pages/Join.jsx';
|
||||
import Register from './pages/Register.jsx';
|
||||
import Media from './pages/Media.jsx';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
index: true,
|
||||
path: '/',
|
||||
element: <Index />,
|
||||
title: 'Главная страница',
|
||||
},
|
||||
{
|
||||
path: '/LK',
|
||||
element: <LK />,
|
||||
title: 'Личный кабинет',
|
||||
},
|
||||
{
|
||||
path: '/Film',
|
||||
element: <Film />,
|
||||
title: 'Страница фильма',
|
||||
},
|
||||
{
|
||||
path: '/Join',
|
||||
element: <Join />,
|
||||
title: 'Страница входа',
|
||||
},
|
||||
{
|
||||
path: '/Register',
|
||||
element: <Register />,
|
||||
title: 'Страница регистрации',
|
||||
},
|
||||
{
|
||||
path: '/Media',
|
||||
element: <Media />,
|
||||
title: 'Страница видеоплеера',
|
||||
},
|
||||
{
|
||||
path: '/Admin',
|
||||
element: <Admin />,
|
||||
title: 'Админ-панель',
|
||||
},
|
||||
{
|
||||
path: '/Input',
|
||||
element: <Input />,
|
||||
},
|
||||
];
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: '/',
|
||||
element: <App routes={routes} />,
|
||||
children: routes,
|
||||
errorElement: <ErrorPage />,
|
||||
},
|
||||
]);
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<RouterProvider router={router} />
|
||||
</React.StrictMode>,
|
||||
);
|
28
src/pages/Admin.jsx
Normal file
@ -0,0 +1,28 @@
|
||||
import { Button, ButtonGroup, Table } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const Admin = () => {
|
||||
return (
|
||||
<>
|
||||
<ButtonGroup className="button_input">
|
||||
<Button as={Link} to="/Input" variant="outline-warning" className="btn AdminPanel" >Добавить фильм</Button>
|
||||
</ButtonGroup>
|
||||
<Table className="mt-2" striped id="items-table">
|
||||
<thead style={{ backgroundColor: '#03001F' }}>
|
||||
<tr>
|
||||
<th scope="col" className="colums" style={{ color: 'white' }}>№</th>
|
||||
<th scope="col" className="w-25 colums" style={{ color: 'white' }}>Жанр</th>
|
||||
<th scope="col" className="w-25 colums" style={{ color: 'white' }}>Название</th>
|
||||
<th scope="col" className="w-25 colums" style={{ color: 'white' }}>Актерский состав</th>
|
||||
<th scope="col" className="w-25 colums" style={{ color: 'white' }}>Описание</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</Table>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Admin;
|
19
src/pages/ErrorPage.jsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { Alert, Button, Container } from 'react-bootstrap';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const ErrorPage = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<Container fluid className="p-2 row justify-content-center">
|
||||
<Container className='col-md-6'>
|
||||
<Alert variant="danger">
|
||||
Страница не найдена
|
||||
</Alert>
|
||||
<Button className="w-25 mt-2" variant="primary" onClick={() => navigate(-1)}>Назад</Button>
|
||||
</Container>
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
export default ErrorPage;
|
35
src/pages/Film.jsx
Normal file
@ -0,0 +1,35 @@
|
||||
const Film = () => {
|
||||
return (
|
||||
<div className="film rows container item">
|
||||
<div className="Rating" style="">
|
||||
<div>
|
||||
<img className="prevFilm" src="img/Prev.png" alt="превью"/>
|
||||
</div>
|
||||
<div className="rat">
|
||||
Рейтинг
|
||||
</div>
|
||||
<div className="rat">
|
||||
10 из 10
|
||||
</div>
|
||||
</div>
|
||||
<div className="description">
|
||||
<div className="rat">
|
||||
Название фильма
|
||||
</div>
|
||||
<div>
|
||||
<button className="btn btn-warning watch" type="button"><a className="nav-link" aria-current="page" href="media.html" style={{ textDecoration: 'none' }}>Просмотр</a></button>
|
||||
</div>
|
||||
<div className="description_info">
|
||||
Описание фильма
|
||||
</div>
|
||||
</div>
|
||||
<div className="actorList">
|
||||
<div className="actor">
|
||||
Актерский состав
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Film;
|
36
src/pages/Index.jsx
Normal file
@ -0,0 +1,36 @@
|
||||
import { Button } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const Index = () => {
|
||||
return (
|
||||
<>
|
||||
<span className="text">Рекомендуемое</span>
|
||||
<div className="card-group rows images">
|
||||
<Link to='/'>Заглушка</Link>
|
||||
</div>
|
||||
<span className="text">Жанры</span>
|
||||
<div className="genreselection">
|
||||
<Button className="btn" variant="secondary" style={{ width: '17rem', margin: '0 0 0 0.5%' }}>Комедия</Button>
|
||||
<Button className="btn" variant="secondary" style={{ width: '17rem', margin: '0 0 0 2%' }}>Боевик</Button>
|
||||
<Button className="btn" variant="secondary" style={{ width: '17rem', margin: '0 0 0 2%' }}>Фэнтези</Button>
|
||||
<Button className="btn" variant="secondary" style={{ width: '17rem', margin: '0 0 0 2%' }}>Романтика</Button>
|
||||
<Button className="btn" variant="secondary" style={{ width: '17rem', margin: '0 0 0 2%' }}>Драма</Button>
|
||||
</div>
|
||||
|
||||
<div className="btn-groups dropup">
|
||||
<Button className="btn dropbutton dropdown-toggle" variant="info" data-bs-toggle="dropdown" aria-expanded="false" style={{ fontSize: '20px' }}>
|
||||
Жанры
|
||||
</Button>
|
||||
<ul className="dropdown-menu">
|
||||
<li><Button className="btn" variant="secondary" >Комедия</Button></li>
|
||||
<li><Button className="btn" variant="secondary" >Боевик</Button></li>
|
||||
<li><Button className="btn" variant="secondary" >Фэнтези</Button></li>
|
||||
<li><Button className="btn" variant="secondary" >Романтика</Button></li>
|
||||
<li><Button className="btn" variant="secondary" >Драма</Button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
59
src/pages/Input.jsx
Normal file
@ -0,0 +1,59 @@
|
||||
import { useState } from 'react';
|
||||
import { Button, Form } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const Input = () => {
|
||||
const [validated, setValidated] = useState(false);
|
||||
|
||||
const handleSubmit = (event) => {
|
||||
const form = event.currentTarget;
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
setValidated(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="text-center">
|
||||
<img id="image-preview" src="https://via.placeholder.com/200" className="rounded rounded-circle"
|
||||
alt="placeholder" style={{ maxWidth: '200px', maxHeight: '200px' }}/>
|
||||
</div>
|
||||
<Form id="items-form" noValidate validated={validated} onSubmit={handleSubmit}>
|
||||
<Form.Group className="mb-2" controlId="Genre">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Жанр</Form.Label>
|
||||
<Form.Select id="Genre" className="form-select" name='selected' required>
|
||||
</Form.Select>
|
||||
</Form.Group>
|
||||
<Form.Group className="mb-2" controlId="Title">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Название продукта</Form.Label>
|
||||
<Form.Control type="text" name="Title" className="form-control" required />
|
||||
</Form.Group>
|
||||
<Form.Group className="mb-2" controlId="Cast">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Актерский состав</Form.Label>
|
||||
<Form.Control type="text" name="Cast" className="form-control" required />
|
||||
</Form.Group>
|
||||
<Form.Group className="mb-2" controlId="Description">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Описание</Form.Label>
|
||||
<Form.Control type="text" name="Description" className="form-control" required />
|
||||
</Form.Group>
|
||||
<Form.Group className="mb-2" controlId="Image">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Изображение</Form.Label>
|
||||
<Form.Control type="file" name="Image" className="form-control" accept="image/*" />
|
||||
</Form.Group>
|
||||
<Form.Group className="mb-2" controlId="Video">
|
||||
<Form.Label className="form-label" style={{ color: 'white' }}>Видеофайл</Form.Label>
|
||||
<Form.Control type="file" name="Video" className="form-control" accept="video/*" />
|
||||
</Form.Group>
|
||||
<Form.Group className="d-flex flex-md-row flex-column justify-content-center">
|
||||
<Button className="btn-mw me-md-3 mb-md-0 mb-2" as={Link} to="/Admin" style={{ height: '7%', fontSize: '16px' }} variant="secondary">Назад</Button>
|
||||
<Button className="btn-mw me-md-3" type="submit" variant="primary">Сохранить</Button>
|
||||
</Form.Group>
|
||||
</Form>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Input;
|
37
src/pages/Join.jsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { useState } from 'react';
|
||||
import { Button, Form, FormGroup } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
import titleBlack from '../assets/Title_black.png';
|
||||
|
||||
const Join = () => {
|
||||
const [validated, setValidated] = useState(false);
|
||||
|
||||
const handleSubmit = (event) => {
|
||||
const form = event.currentTarget;
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
setValidated(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form className="Join" noValidate validated={validated} onSubmit={handleSubmit}>
|
||||
<center><Button as={Link} to="/Index" style={{ backgroundColor: 'white', borderColor: 'white', marginTop: '20px' }}><img id="image_title" src={titleBlack} alt="название" className="Title"/></Button></center>
|
||||
<FormGroup className="name" controlId="userName">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="text" name="userName" className="form-control" placeholder="Логин / почта пользователя" required />
|
||||
</FormGroup>
|
||||
<FormGroup className="pass" controlId="Password">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="password" name="Password" placeholder="Пароль" className="form-control" required />
|
||||
</FormGroup>
|
||||
<Button className="ButtonJoin" as={Link} to="/" type="submit">Войти</Button>
|
||||
</Form>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Join;
|
29
src/pages/LK.jsx
Normal file
@ -0,0 +1,29 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import icons from '../assets/icons8-загрузить-64.png';
|
||||
|
||||
const LK = () => {
|
||||
return (
|
||||
<>
|
||||
<div className="DobPhoto rows">
|
||||
<form id="upload-container" className="upload-container" method="POST" action="send.php">
|
||||
<img id="upload-image" src={icons} alt=''/>
|
||||
<div>
|
||||
<input id="file-input" type="file" name="file" style={{ fontSize: '10px' }} multiple/>
|
||||
<label style={{ marginLeft: '10px' }}>Выберите файл</label>
|
||||
<div style={{ paddingLeft: '10px' }}> или перетащите его <br/> сюда</div>
|
||||
</div>
|
||||
</form>
|
||||
<div className="info">
|
||||
<div className="FIO">Иван Иванов</div>
|
||||
<div className="info_list-item" style={{ marginTop: '5%' }}>Дата рождения - 25.09.2018</div>
|
||||
<div className="info_list-item" style={{ marginTop: '5%' }}>Просмотрено фильмов - 123</div>
|
||||
<div className="info_list-item" style={{ marginTop: '5%', marginBottom: '5%' }}>Просмотрено сериалов - 123</div>
|
||||
<button className="btn btn-outline-warning button_add"><Link className="nav-link" to="/Admin" style={{ textDecoration: 'none' }}>Панель администратора</Link></button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line react-refresh/only-export-components
|
||||
export default LK;
|
15
src/pages/Media.jsx
Normal file
@ -0,0 +1,15 @@
|
||||
import sobaka from '../../media/sobaka-letit_(VIDEOMIN.NET).mp4';
|
||||
|
||||
const Media = () => {
|
||||
return (
|
||||
<>
|
||||
<main className="h-100 d-flex flex-column" style={{ backgroundColor: '#03001F' }}>
|
||||
<div className='video-container'>
|
||||
<video controls src={sobaka} className='video-player' id='video-player' preload='metadata'></video>
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Media;
|
45
src/pages/Register.jsx
Normal file
@ -0,0 +1,45 @@
|
||||
import { useState } from 'react';
|
||||
import { Button, Form, FormGroup } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
import titleBlack from '../assets/Title_black.png';
|
||||
|
||||
const Register = () => {
|
||||
const [validated, setValidated] = useState(false);
|
||||
|
||||
const handleSubmit = (event) => {
|
||||
const form = event.currentTarget;
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
setValidated(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form className="Join" noValidate validated={validated} onSubmit={handleSubmit}>
|
||||
<center><Button as={Link} to="/Index" style={{ backgroundColor: 'white', borderColor: 'white' }}><img id="image_title" src={titleBlack} alt="название" className="Title"/></Button></center>
|
||||
<FormGroup className="reg_name" controlId="userName">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="text" name="userName" className="form-control" placeholder="Имя" required />
|
||||
</FormGroup>
|
||||
<FormGroup className="reg_login" controlId="Login">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="text" name="Login" className="form-control" placeholder="Логин" required />
|
||||
</FormGroup>
|
||||
<FormGroup className="reg_mail" controlId="Mail">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="email" name="Mail" className="form-control" placeholder="Почта пользователя" required />
|
||||
</FormGroup>
|
||||
<FormGroup className="reg_pass" controlId="regPassword">
|
||||
<Form.Label className="form-label"></Form.Label>
|
||||
<Form.Control type="password" name="regPassword" className="form-control" placeholder="Пароль" required />
|
||||
</FormGroup>
|
||||
<Button className="reg_ButtonJoin" as={Link} to="/" type="submit">Регистрация</Button>
|
||||
</Form>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Register;
|
@ -1,19 +1,13 @@
|
||||
import { resolve } from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(__dirname, 'index.html'),
|
||||
input: resolve(__dirname, 'Input.html'),
|
||||
Join: resolve(__dirname, 'Join.html'),
|
||||
Reg: resolve(__dirname, 'Register.html'),
|
||||
LK: resolve(__dirname, 'LK.html'),
|
||||
Film: resolve(__dirname, 'Film.html'),
|
||||
Media: resolve(__dirname, 'media.html'),
|
||||
admin: resolve(__dirname, 'admin.html'),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
plugins: [react()],
|
||||
build: {
|
||||
sourcemap: true,
|
||||
chunkSizeWarningLimit: 1024,
|
||||
emptyOutDir: true,
|
||||
},
|
||||
});
|
||||
|