This commit is contained in:
Дмитрий Блохин 2024-01-10 21:47:43 +04:00
parent d5ee715c8a
commit ad5c433e74
66 changed files with 10633 additions and 0 deletions

20
.eslintrc.json Normal file
View File

@ -0,0 +1,20 @@
{
"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"
}
}

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/InetProga.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/InetProga.iml" filepath="$PROJECT_DIR$/.idea/InetProga.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

882
CSS/style.css Normal file
View File

@ -0,0 +1,882 @@
*,*:before,*after{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.selector-for-some-widget {
box-sizing: content-box;
}
header {
background-color: #03001F;
color: #ffffff;
height: 64px;
padding: 0.5em;
display: flex;
align-items: center;
}
.navbar-collapse{
background-color: #03001F;
}
.dropdown-menu{
background-color: #03001F;
}
header nav {
justify-content: flex-end !important;
display: flex !important;
flex-grow: 1;
}
@media (min-width: 768px) {
header nav {
height: 64px;
margin-top: 0;
}
.aboba{
height: 64px;
margin-top: 0;
}
}
@media (max-width: 1020px){
.card-group{
margin-top: 5%;
}
}
header nav a:hover {
text-decoration: underline;
}
.nav-link{
color: white;
}
.nav-item{
margin-right: 10px;
}
.btn-secondary{
font-size: 40px;
width: 15rem;
margin: 0 0 0 0.5%;
}
.btn-outline-info{
margin-right: 10px;
}
.btn-light{
max-width: 50rem;
width: 50rem;
font-size: 45px;
margin: 2% 2% 0 2%;
}
.card-group {
display: flex;
justify-content: space-around;
flex-grow: 1;
}
.rows{
display: flex;
flex-direction: row;
}
.images{
justify-content: space-around;
}
.prev{
max-width: 13rem;
}
@media (max-width: 1200px ){
.selector-for-some-widget {
box-sizing: content-box;
}
.nav-link{
color: white;
}
.navbar-nav{
margin-right: 10px;
}
.navbar{
margin-bottom: 5%;
}
.btn-secondary{
font-size: 40px;
}
.btn-light{
max-width: 50rem;
width: 50rem;
font-size: 45px;
margin: 2% 2% 0 2%;
}
.card-group {
display: flex;
justify-content: space-around;
}
.prev{
margin-left: 25%;
max-width: 13rem;
font-size: 13px;
}
}
@media (max-width: 1020px){
.selector-for-some-widget {
box-sizing: content-box;
}
.nav-link{
color: white;
}
.nav-item{
margin-right: 10px;
}
.btn-secondary{
font-size: 20px;
width: 17rem;
}
.btn-light{
max-width: 50rem;
width: 50rem;
font-size: 45px;
margin: 2% 2% 0 2%;
}
.prev{
display: flex;
flex-direction: column;
margin-left: 50%;
width: 50%;
height: 50%;
font-size: 13px;
}
.images{
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
.genreselection{
display: none;
}
.btn-light{
display: none;
}
.text{
display: none;
}
.btn-group{
margin-left: 20%;
margin-top: 20%;
width: 60%;
height: 60%;
}
}
@media (min-width: 1020px){
.btn-group{
display: none;
}
.genreselection{
display: flex;
font-family: Inter, serif;
}
}
@media (max-width: 510px){
.prev{
display: flex;
flex-direction: column;
margin-left: 50%;
width: 60%;
height: 50%;
font-size: 7px;
}
.btn-group{
margin-left: 20%;
margin-top: 20%;
width: 60%;
height: 60%;
}
.btn-secondary{
font-size: 20px;
width: 10rem;
}
.card-group{
margin-top: 10%;
}
.navbar-brand{
width: 120px;
}
}
@media (max-width: 1200px) {
}
.info{
padding-top: 0;
margin-left: 10%;
font-size: 25px;
color: white;
}
.FIO{
font-size: 40px;
margin-top: -15%;
}
.LK-img{
height: 30%;
width: 30%;
}
.LK_block{
margin-left: 8%;
margin-top: 10%;
}
@media (max-width: 990px){
.blocks{
display: flex;
flex-direction: column;
margin-left: 20%;
}
.LK-img{
min-height: 20%;
min-width: 20%;
}
.Title_blocks{
font-size: 20px;
}
}
@media (max-width: 615px){
.DobPhoto{
margin-top: 5%;
margin-left: 5%;
flex-direction: column;
}
.upload-container{
margin-left: 25%;
margin-top: 5%;
}
.info{
margin-top: 15%;
}
.Title_blocks{
font-size: 15px
}
.button_add{
margin-left: 25%;
}
}
@media (max-width: 400px){
.upload-container{
width: 10%;
margin-left: 5%;
}
.info{
font-size: 15px;
}
.FIO{
font-size: 25px;
}
.button_add{
margin-left: 5%;
}
.navbar-brand{
width: 10%;
height: 5%;
}
}
@media (min-width: 615px) {
.DobPhoto {
padding: 0;
margin: 8% 0 0 2%;
display: flex;
justify-content: left;
align-items: center;
}
}
.needs-validation{
color: white;
}
.film{
display: flex;
flex-direction: row;
margin-top: 2%;
}
.Rating{
width: 300px;
margin-left: 2%;
}
.prevFilm{
width: 90%;
margin-top: 15%;
margin-left: 5%;
}
.rat{
color: white;
font-size: 25px;
margin-top: 5%;
margin-left: 8%;
}
.watch{
margin-top: 5%;
margin-left: 10%;
}
.description{
width: 250px;
margin-left: 5%;
}
.description_info{
background-color: #414141;
color: white;
border-radius: 15px;
width: 90%;
height: 100%;
text-align: center;
margin-top: 5%;
margin-left: 5%;
font-size: 20px;
overflow: auto;
}
.actorList{
width: 250px;
margin-left: 2%;
}
.actor{
background-color: #414141;
color: white;
border-radius: 15px;
width: 100%;
height: 140%;
text-align: center;
margin-top: 15%;
margin-left: 5%;
font-size: 20px;
overflow: auto;
}
@media (min-width: 990px){
.MainTitle{
width: 200px;
height: 70px;
margin: 2% 0 0 3%;
}
}
@media (max-width: 990px){
.MainTitle{
width: 200px;
height: 70px;
margin-top: 5%;
}
.Rating{
width: 70%;
}
.description{
width: 70%;
}
.actor{
width: 250px;
}
}
@media (max-width: 770px) {
.MainTitle{
width: 170px;
height: 60px;
margin: 0;
}
.film{
flex-direction: column;
}
.prevFilm{
width: 60%;
margin-left: 30%;
margin-top: 10%;
}
.Rating{
width: 80%;
}
.rat{
width: 100%;
margin-top: 2%;
}
.description{
margin-left: 3%;
}
.description_info{
width: 138%;
height: 100px;
}
.actor{
height: 100px;
width: 200%;
margin-left: 9%;
}
}
@media (max-width: 580px){
.description{
width: 90%;
}
.description_info{
width: 100%;
}
.actorList{
width: 90%;
}
.actor{
width: 100%;
margin-top: 5%;
margin-left: 6%;
}
}
.video-container {
width: 100%;
height: 100%;
color: #fff;
}
.mediaLK{
margin-top: 1%;
background-color: inherit;
}
.LK2{
margin-top: 1%;
background-color: inherit;
}
.index{
margin-top: 1%;
background-color: inherit;
}
.film{
margin-top: 1%;
background-color: inherit;
}
.admin{
margin-top: 1%;
background-color: inherit;
}
.input{
background-color: inherit;
}
@media (max-width: 1200px){
.mediaLK{
margin-top: 0;
}
.LK2{
margin-top: 0;
}
.index{
margin-top: 0;
}
.film{
margin-top: 0;
}
.admin{
margin-top: 0;
}
.input{
margin-top: 0;
}
}
@media (min-width: 550px){
.video-container{
display: flex;
align-items: center;
justify-content: center;
margin-top: 15%;
}
}
@media (max-width: 550px){
.video-player{
width: 70%;
}
.video-container{
display: flex;
align-items: center;
justify-content: center;
margin-top: 45%;
}
}
.pageLK{
display: flex;
-ms-flex-align: center;
align-items: center;
margin: -4% 0 2% 70%;
}
.text{
color: white;
font-size: 40px;
font-family: JejuGothic, serif;
margin: 12% 0 0 0;
}
.Photo{
height: 32%;
width: 27%;
}
.Ganr{
background: #8C8C8C;
color: white;
width: 40%;
height: 60px;
border-radius: 50px;
text-align: center;
margin: 1% 1% 0 1%;
font-size: 35px;
padding: 1% 0 0 0;
}
.Genre{
background: #D9D9D9;
color: white;
width: 50%;
height: 55px;
border-radius: 10px;
text-align: center;
margin: 1.5% 1% 0 1%;
font-size: 35px;
padding: 1% 0 0 0;
}
.Genre2{
background: #D9D9D9;
color: white;
width: 50%;
height: 55px;
border-radius: 10px;
text-align: center;
margin: 1.5% 1% 0 1%;
font-size: 35px;
padding: 1% 0 0 0;
}
.body{
width:100%;
height:100%;
}
.Join{
position: absolute;
background-color: white;
border-radius: 5%;
margin: 10% 25% 10% 35%;
height: 50%;
width: 35%;
}
.name{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Title{
width:150px;
height:50px;
margin: 5% 25% 1% 25%;
}
@media (max-width: 800px) {
.Join{
position: absolute;
background-color: white;
border-radius: 5%;
margin: 12% 14% 12% 14%;
height: 80%;
width: 70%;
}
.name{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 30% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.pass{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 25% 10% 5% 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.ButtonJoin{
background-color: #03001F;
color: white;
font-size: 28px;
margin: 15% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Mistake{
color: #0047FF;
font-size: 20px;
margin: 5% 0 0 30%;
}
}
.pass{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 8% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.ButtonJoin{
background-color: #03001F;
color: white;
font-size: 28px;
margin: 8% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Mistake{
color: #0047FF;
font-size: 14px;
margin: 5% 0 0 55%;
}
@media (min-width: 800px) {
.reg_pass{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 3% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_ButtonJoin{
background-color: #03001F;
color: white;
font-size: 28px;
margin: 3% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_name{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 3% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Title{
width:150px;
height:50px;
margin: 5% 25% 1% 25%;
}
.reg_login{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 3% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_mail{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 3% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
}
@media (max-width: 800px) {
.reg_pass{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 5% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_ButtonJoin{
background-color: #03001F;
color: white;
font-size: 28px;
margin: 15% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_name{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 2% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Title{
width:200px;
height:75px;
margin: 10% 7% 1% 7%;
}
.reg_login{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 5% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_mail{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 5% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
}
@media (max-width: 400px) {
.reg_pass{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_ButtonJoin{
background-color: #03001F;
color: white;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_name{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Title{
width:150px;
height:75px;
margin: 5% 7% 1% 7%;
}
.reg_login{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.reg_mail{
background-color: #D9D9D9;
color: black;
font-size: 28px;
margin: 10% 10% 0 15%;
width: 70%;
height: 40px;
border-radius: 50px;
}
.Mistake{
color: #0047FF;
font-size: 14px;
margin: 7% 0 0 38%;
}
}
.EnterLK{
background: #03001F;
color: white;
font-family: Inter, serif;
margin: -5% 1% 5% 75%;
width: 60px;
height: 25px;
border: 1px solid #03B8B8;
border-radius: 50px;
font-size: 16px;
}
.RegLk{
background: #03001F;
color: white;
font-family: Inter, serif;
margin: -5% 1% 5% 0;
width: 120px;
height: 25px;
border: 1px solid #03B8B8;
border-radius: 50px;
font-size: 16px;
}
.buttonLK{
background: #03001F;
color: white;
font-family: Inter, serif;
margin: -5% 1% 5% 0;
width: 150px;
height: 25px;
border: 1px solid #03B8B8;
border-radius: 50px;
font-size: 16px;
}
.buttonLK:visited{
color: white;
text-decoration: none;
}
#upload-container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 200px;
height: 250px;
outline: 2px dashed #5d5d5d;
outline-offset: -12px;
background-color: #e0f2f7;
font-family: 'Segoe UI';
color: #1f3c44;
}
#upload-container img {
width: 40%;
margin-bottom: 20px;
user-select: none;
}
#upload-container label {
font-weight: bold;
}
#upload-container label:hover {
cursor: pointer;
text-decoration: underline;
}
#upload-container div {
position: relative;
z-index: 10;
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%;
}
@media (max-width: 615px){
.AdminPanel{
margin-top: 5%;
}
}
.text-center{
margin-top: 1%;
}

68
Film.html Normal file
View File

@ -0,0 +1,68 @@
<!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 Normal file
View File

@ -0,0 +1,8 @@
<?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 Normal file
View File

@ -0,0 +1,81 @@
<!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 Normal file
View File

@ -0,0 +1,25 @@
<!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 Normal file
View File

@ -0,0 +1,99 @@
<!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>

28
Register.html Normal file
View File

@ -0,0 +1,28 @@
<!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 Normal file
View File

@ -0,0 +1,65 @@
<!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>

45
data.json Normal file

File diff suppressed because one or more lines are too long

70
dist/Film.html vendored Normal file
View File

@ -0,0 +1,70 @@
<!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 Normal file
View File

@ -0,0 +1,78 @@
<!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 Normal file
View File

@ -0,0 +1,27 @@
<!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 Normal file
View File

@ -0,0 +1,101 @@
<!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 Normal file
View File

@ -0,0 +1,30 @@
<!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 Normal file
View File

@ -0,0 +1,62 @@
<!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 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

BIN
dist/assets/Title-7a451a58.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
dist/assets/Title_black-416c6e2d.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

1
dist/assets/admin-091b7884.js vendored Normal file
View File

@ -0,0 +1 @@
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 Normal file

File diff suppressed because one or more lines are too long

5
dist/assets/bootstrap.min-913b42e3.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
dist/assets/fa-brands-400-003f1154.ttf vendored Normal file

Binary file not shown.

BIN
dist/assets/fa-brands-400-faae6fc0.woff2 vendored Normal file

Binary file not shown.

BIN
dist/assets/fa-regular-400-7d81a1a7.ttf vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
dist/assets/fa-solid-900-886c8611.woff2 vendored Normal file

Binary file not shown.

BIN
dist/assets/fa-solid-900-cea79b34.ttf vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

1
dist/assets/input-edca0df3.js vendored Normal file
View File

@ -0,0 +1 @@
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 Normal file
View File

@ -0,0 +1 @@
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};

View File

@ -0,0 +1 @@
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 Normal file
View File

@ -0,0 +1,13 @@
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()});

Binary file not shown.

82
dist/index.html vendored Normal file
View File

@ -0,0 +1,82 @@
<!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 Normal file
View File

@ -0,0 +1,44 @@
<!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>

1
hello.js Normal file
View File

@ -0,0 +1 @@
console.log("hello");

BIN
img/Fone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 KiB

BIN
img/Prev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

BIN
img/Title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
img/Title_black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
img/korotysh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
img/photo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

78
index.html Normal file
View File

@ -0,0 +1,78 @@
<!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 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>
</body>
<script type="module" src="js/Cards.js"></script>
</html>

41
js/Cards.js Normal file
View File

@ -0,0 +1,41 @@
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 Normal file
View File

@ -0,0 +1,46 @@
// модуль для смены изображения в баннере по таймеру
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;

59
js/lines-modal.js Normal file
View File

@ -0,0 +1,59 @@
// Модуль для работы с модальным окном
// импорт компонента 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();
}

101
js/lines-rest-api.js Normal file
View File

@ -0,0 +1,101 @@
// модуль для работы с 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();
}

95
js/lines-ui.js Normal file
View File

@ -0,0 +1,95 @@
// модуль для работы с элементами управления
// объект для удобного получения элементов
// при обращении к атрибуту объекта вызывается
// нужная функция для поиска элемента
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 Normal file
View File

@ -0,0 +1,245 @@
// модуль с логикой
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();
});
}

25
js/validation.js Normal file
View File

@ -0,0 +1,25 @@
// модуль используется для валидации форма на странице
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;

14
jsconfig.json Normal file
View File

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

42
media.html Normal file
View File

@ -0,0 +1,42 @@
<!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>

8
media.iml Normal file
View File

@ -0,0 +1,8 @@
<?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>

Binary file not shown.

7950
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

26
package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "int-prog",
"version": "1.0.0",
"type": "module",
"scripts": {
"vite": "vite",
"serve": "http-server -p 3000 ./dist/",
"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"
},
"dependencies": {
"bootstrap": "5.3.2",
"@fortawesome/fontawesome-free": "6.4.2"
},
"devDependencies": {
"vite": "4.4.9",
"eslint": "8.50.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.28.1",
"http-server": "14.1.1",
"json-server": "0.17.4",
"npm-run-all": "4.1.5"
}
}

19
vite.config.js Normal file
View File

@ -0,0 +1,19 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
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'),
},
},
},
})