just mb ready lab 3
This commit is contained in:
parent
c547f91887
commit
07e51455ad
140
admin.html
140
admin.html
@ -1,56 +1,32 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<script
|
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||||
type="module"
|
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
src="./node_modules/bootstrap/dist/js/bootstrap.min.js"
|
<link href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||||
></script>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link rel="stylesheet" href="./static/css/base.css" />
|
<link rel="stylesheet" href="./static/css/base.css" />
|
||||||
<link rel="stylesheet" href="./static/css/admin.css" />
|
<link rel="stylesheet" href="./static/css/admin.css" />
|
||||||
<title>Админка</title>
|
<title>Админка</title>
|
||||||
<link
|
<link rel="shortcut icon" href="./static/images/favicon.svg" type="image/x-icon" />
|
||||||
rel="shortcut icon"
|
</head>
|
||||||
href="./static/images/favicon.svg"
|
|
||||||
type="image/x-icon"
|
|
||||||
/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="d-flex flex-column min-vh-100">
|
<body class="d-flex flex-column min-vh-100">
|
||||||
<header class="sticky-top">
|
<header class="sticky-top">
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand d-flex align-items-center">
|
<a class="navbar-brand d-flex align-items-center">
|
||||||
<img
|
<img src="./static/images/logo-livecinema-small.png"
|
||||||
src="./static/images/logo-livecinema-small.png"
|
class="d-inline-block align-text-top me-4 d-none d-sm-block" />
|
||||||
class="d-inline-block align-text-top me-4 d-none d-sm-block"
|
|
||||||
/>
|
|
||||||
LiveCinema
|
LiveCinema
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown"
|
||||||
class="navbar-toggler"
|
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
type="button"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#navbarNavDropdown"
|
|
||||||
aria-controls="navbarNavDropdown"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-label="Toggle navigation"
|
|
||||||
>
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div class="collapse navbar-collapse justify-content-end" id="navbarNavDropdown">
|
||||||
class="collapse navbar-collapse justify-content-end"
|
|
||||||
id="navbarNavDropdown"
|
|
||||||
>
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" href="index.html">Главная</a>
|
<a class="nav-link active" href="index.html">Главная</a>
|
||||||
@ -81,10 +57,7 @@
|
|||||||
Добавить фильм (диалог)
|
Добавить фильм (диалог)
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table class="table table-sm table-responsive table-bordered border-primary table-hover" id="table">
|
||||||
class="table table-sm table-responsive table-bordered border-primary table-hover"
|
|
||||||
id="table"
|
|
||||||
>
|
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -92,12 +65,10 @@
|
|||||||
<th scope="col">Название</th>
|
<th scope="col">Название</th>
|
||||||
<th scope="col">Жанр</th>
|
<th scope="col">Жанр</th>
|
||||||
<th scope="col" class="text-center">
|
<th scope="col" class="text-center">
|
||||||
<span class="d-none d-sm-block">Описание</span
|
<span class="d-none d-sm-block">Описание</span><i class="bi bi-clock-history d-block d-sm-none"></i>
|
||||||
><i class="bi bi-clock-history d-block d-sm-none"></i>
|
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="text-center">
|
<th scope="col" class="text-center">
|
||||||
<span class="d-none d-sm-block"> Длительность </span
|
<span class="d-none d-sm-block"> Длительность </span><i class="bi bi-clock-history d-block d-sm-none"></i>
|
||||||
><i class="bi bi-clock-history d-block d-sm-none"></i>
|
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="text-center">
|
<th scope="col" class="text-center">
|
||||||
<span>Действие</span>
|
<span>Действие</span>
|
||||||
@ -126,93 +97,45 @@
|
|||||||
</table>
|
</table>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div
|
<div id="modal-movie" class="modal fade" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||||
id="modal-movie"
|
|
||||||
class="modal fade"
|
|
||||||
tabindex="-1"
|
|
||||||
data-bs-backdrop="static"
|
|
||||||
data-bs-keyboard="false"
|
|
||||||
>
|
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<form id="movie-form" class="needs-validation" novalidate>
|
<form id="movie-form" class="needs-validation" novalidate>
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h1 class="modal-title fs-5" id="movie-modal-title"></h1>
|
<h1 class="modal-title fs-5" id="movie-modal-title"></h1>
|
||||||
<button
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
type="button"
|
|
||||||
class="btn-close"
|
|
||||||
data-bs-dismiss="modal"
|
|
||||||
aria-label="Close"
|
|
||||||
></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<img
|
<img id="image-preview" src="./static/images/cover-placeholder160x230.png" class="rounded-2 img-fluid"
|
||||||
id="image-preview"
|
alt="placeholder" />
|
||||||
src="./static/images/cover-placeholder160x230.png"
|
|
||||||
class="rounded-2 img-fluid"
|
|
||||||
alt="placeholder"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<input id="movie-id" type="number" hidden />
|
<input id="movie-id" type="number" hidden />
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="category" class="form-label">Жанр</label>
|
<label for="category" class="form-label">Жанр</label>
|
||||||
<select
|
<select id="category" class="form-select" name="selected" required></select>
|
||||||
id="category"
|
|
||||||
class="form-select"
|
|
||||||
name="selected"
|
|
||||||
required
|
|
||||||
></select>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label class="form-label" for="name">Название</label>
|
<label class="form-label" for="name">Название</label>
|
||||||
<input
|
<input id="name" name="name" class="form-control" type="text" required />
|
||||||
id="name"
|
|
||||||
name="name"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label class="form-label" for="description"> Описание </label>
|
<label class="form-label" for="description"> Описание </label>
|
||||||
<input
|
<input id="description" name="description" class="form-control" type="text" required />
|
||||||
id="description"
|
|
||||||
name="description"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label class="form-label" for="duration">
|
<label class="form-label" for="duration">
|
||||||
Продолжителность
|
Продолжителность
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input id="duration" name="duration" class="form-control" type="text" required />
|
||||||
id="duration"
|
|
||||||
name="duration"
|
|
||||||
class="form-control"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label class="form-label" for="image">Изображение</label>
|
<label class="form-label" for="image">Изображение</label>
|
||||||
<input
|
<input id="image" type="file" name="image" class="form-control" accept="image/*" />
|
||||||
id="image"
|
|
||||||
type="file"
|
|
||||||
name="image"
|
|
||||||
class="form-control"
|
|
||||||
accept="image/*"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||||
type="button"
|
|
||||||
class="btn btn-secondary"
|
|
||||||
data-bs-dismiss="modal"
|
|
||||||
>
|
|
||||||
Закрыть
|
Закрыть
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||||
@ -226,6 +149,13 @@
|
|||||||
<span> © 2023, Live Cinema. All rights reserved. </span>
|
<span> © 2023, Live Cinema. All rights reserved. </span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script type="module" src="./static/js/admin.js"></script>
|
<script type="module" src="./static/js/admin.js">
|
||||||
</body>
|
import validation from "./static./js/validation.js";
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
validation();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,56 +1,32 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<script
|
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||||
type="module"
|
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
src="./node_modules/bootstrap/dist/js/bootstrap.min.js"
|
<link href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||||
></script>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link rel="stylesheet" href="./static/css/base.css" />
|
<link rel="stylesheet" href="./static/css/base.css" />
|
||||||
<link rel="stylesheet" href="./static/css/caregoryfilm.css" />
|
<link rel="stylesheet" href="./static/css/caregoryfilm.css" />
|
||||||
<title>LiveCinema</title>
|
<title>LiveCinema</title>
|
||||||
<link
|
<link rel="shortcut icon" href="./static/images/favicon.svg" type="image/x-icon" />
|
||||||
rel="shortcut icon"
|
</head>
|
||||||
href="./static/images/favicon.svg"
|
|
||||||
type="image/x-icon"
|
|
||||||
/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="d-flex flex-column">
|
<body class="d-flex flex-column">
|
||||||
<header class="sticky-top">
|
<header class="sticky-top">
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand d-flex align-items-center">
|
<a class="navbar-brand d-flex align-items-center">
|
||||||
<img
|
<img src="./static/images/logo-livecinema-small.png"
|
||||||
src="./static/images/logo-livecinema-small.png"
|
class="d-inline-block align-text-top me-4 d-none d-sm-block" />
|
||||||
class="d-inline-block align-text-top me-4 d-none d-sm-block"
|
|
||||||
/>
|
|
||||||
LiveCinema
|
LiveCinema
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown"
|
||||||
class="navbar-toggler"
|
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
type="button"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#navbarNavDropdown"
|
|
||||||
aria-controls="navbarNavDropdown"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-label="Toggle navigation"
|
|
||||||
>
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div class="collapse navbar-collapse justify-content-end" id="navbarNavDropdown">
|
||||||
class="collapse navbar-collapse justify-content-end"
|
|
||||||
id="navbarNavDropdown"
|
|
||||||
>
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/">Главная</a>
|
<a class="nav-link" href="/">Главная</a>
|
||||||
@ -77,56 +53,15 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="flex-fill d-flex justify-content-center">
|
<main class="flex-fill d-flex justify-content-center">
|
||||||
<div
|
<div class="content d-flex w-100 flex-column justify-content-around mb-5" id="films">
|
||||||
class="content d-flex w-100 flex-column justify-content-around mb-5"
|
<div class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5 mb-5">
|
||||||
id="films"
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
>
|
<img src="./static/img/img2.webp" class="img-fluid rounded-3" id="img1" />
|
||||||
<div
|
|
||||||
class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5 mb-5"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/img/img2.webp"
|
|
||||||
class="img-fluid rounded-3"
|
|
||||||
id="img1"
|
|
||||||
/>
|
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
@ -135,48 +70,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img src="./static/img/img2.webp" class="rounded-3" />
|
<img src="./static/img/img2.webp" class="rounded-3" />
|
||||||
|
|
||||||
<!-- <img onmouseover="imgText_Visible()" src="./static/img/img2.webp" class="rounded-3"> -->
|
<!-- <img onmouseover="imgText_Visible()" src="./static/img/img2.webp" class="rounded-3"> -->
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
@ -186,49 +89,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5">
|
||||||
class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5"
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img src="./static/img/img2.webp" class="rounded-3" />
|
<img src="./static/img/img2.webp" class="rounded-3" />
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="category-name text-center mt-2">Драма</span> -->
|
<!-- <span class="category-name text-center mt-2">Драма</span> -->
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
@ -236,46 +105,14 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img src="./static/img/img2.webp" class="rounded-3" />
|
<img src="./static/img/img2.webp" class="rounded-3" />
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
@ -285,96 +122,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5">
|
||||||
class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5"
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img src="./static/img/img2.webp" class="rounded-3" />
|
<img src="./static/img/img2.webp" class="rounded-3" />
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="category-name text-center mt-2">Драма</span> -->
|
<!-- <span class="category-name text-center mt-2">Драма</span> -->
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
|
<!-- <span> -->
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
лаба...
|
лаба...
|
||||||
|
<!-- </span> -->
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0">
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
>
|
|
||||||
<img src="./static/img/img2.webp" class="rounded-3" />
|
<img src="./static/img/img2.webp" class="rounded-3" />
|
||||||
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
<div class="icons w-50 d-flex justify-content-around mt-1 mb-1">
|
||||||
<svg
|
<svg width="16" height="16" class="bi bi-heart" id="icons"></svg>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<svg width="16" height="16" class="bi bi-clock-history" id="icons"></svg>
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-heart"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="heart-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
fill="currentColor"
|
|
||||||
class="bi bi-clock-history"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
id="time-icons"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
<!-- <span class="category-name text-center mt-2">Комедия</span> -->
|
||||||
<div class="tooltip-content text-center w-50">
|
<div class="tooltip-content text-center w-50 d-flex justify-content-center align-items-center">
|
||||||
<p>
|
<p>
|
||||||
Некая информация об этом фильме. Вы сможете узнать всю
|
Некая информация об этом фильме. Вы сможете узнать всю
|
||||||
информацию чуть позже, когда будет в процессе приготовления 3
|
информацию чуть позже, когда будет в процессе приготовления 3
|
||||||
@ -390,5 +163,6 @@
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script type="module" src="./static/js/categoryfilm.js"></script>
|
<script type="module" src="./static/js/categoryfilm.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
204
katalog.html
204
katalog.html
@ -1,56 +1,32 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<script
|
<script type="module" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||||
type="module"
|
<link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
src="./node_modules/bootstrap/dist/js/bootstrap.min.js"
|
<link href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css" rel="stylesheet" />
|
||||||
></script>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="./node_modules/bootstrap-icons/font/bootstrap-icons.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<link rel="stylesheet" href="./static/css/base.css" />
|
<link rel="stylesheet" href="./static/css/base.css" />
|
||||||
<link rel="stylesheet" href="./static/css/catalog.css" />
|
<link rel="stylesheet" href="./static/css/catalog.css" />
|
||||||
<title>Каталог</title>
|
<title>Каталог</title>
|
||||||
<link
|
<link rel="shortcut icon" href="./static/images/favicon.svg" type="image/x-icon" />
|
||||||
rel="shortcut icon"
|
</head>
|
||||||
href="./static/images/favicon.svg"
|
|
||||||
type="image/x-icon"
|
|
||||||
/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="d-flex flex-column">
|
<body class="d-flex flex-column">
|
||||||
<header class="sticky-top">
|
<header class="sticky-top">
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand d-flex align-items-center">
|
<a class="navbar-brand d-flex align-items-center">
|
||||||
<img
|
<img src="./static/images/logo-livecinema-small.png"
|
||||||
src="./static/images/logo-livecinema-small.png"
|
class="d-inline-block align-text-top me-4 d-none d-sm-block" />
|
||||||
class="d-inline-block align-text-top me-4 d-none d-sm-block"
|
|
||||||
/>
|
|
||||||
LiveCinema
|
LiveCinema
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown"
|
||||||
class="navbar-toggler"
|
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
type="button"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#navbarNavDropdown"
|
|
||||||
aria-controls="navbarNavDropdown"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-label="Toggle navigation"
|
|
||||||
>
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div class="collapse navbar-collapse justify-content-end" id="navbarNavDropdown">
|
||||||
class="collapse navbar-collapse justify-content-end"
|
|
||||||
id="navbarNavDropdown"
|
|
||||||
>
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/">Главная</a>
|
<a class="nav-link" href="/">Главная</a>
|
||||||
@ -77,76 +53,39 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="flex-fill d-flex justify-content-center">
|
<main class="flex-fill d-flex justify-content-center">
|
||||||
<div
|
<div class="content d-flex flex-column justify-content-around" id="content">
|
||||||
class="content d-flex flex-column justify-content-around"
|
|
||||||
id="content"
|
|
||||||
>
|
|
||||||
<div id="categories" class="d-flex flex-column justify-content-around">
|
<div id="categories" class="d-flex flex-column justify-content-around">
|
||||||
<div
|
<div class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5">
|
||||||
class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5"
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
>
|
href="/categoryfilm.html">
|
||||||
<a
|
<img src="./static/images/cover-bez-pravil.webp" class="rounded-3 category-img" />
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
href="/categoryfilm.html"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-bez-pravil.webp"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Драма</span>
|
<span class="category-name text-center mt-2">Драма</span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
href="/categoryfilm.html">
|
||||||
href="/categoryfilm.html"
|
<img src="./static/images/cover-dva-holma.webp" class="rounded-3 category-img" />
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-dva-holma.webp"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Боевик</span>
|
<span class="category-name text-center mt-2">Боевик</span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
href="/categoryfilm.html">
|
||||||
href="/categoryfilm.html"
|
<img src="./static/images/cover-kiberderevnya.webp" class="rounded-3 category-img" />
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-kiberderevnya.webp"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Триллер</span>
|
<span class="category-name text-center mt-2">Триллер</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5">
|
||||||
class="categories-row d-flex flex-column flex-md-row justify-content-around mt-5"
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
>
|
href="/categoryfilm.html">
|
||||||
<a
|
<img src="./static/images/cover-apgreyd.jpeg" class="rounded-3 category-img" />
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
|
||||||
href="/categoryfilm.html"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-apgreyd.jpeg"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Ужасы</span>
|
<span class="category-name text-center mt-2">Ужасы</span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
href="/categoryfilm.html">
|
||||||
href="/categoryfilm.html"
|
<img src="./static/images/cover-57-sekund.jpeg" class="rounded-3 category-img" />
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-57-sekund.jpeg"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Детектив</span>
|
<span class="category-name text-center mt-2">Детектив</span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||||
class="category-card d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
href="/categoryfilm.html">
|
||||||
href="/categoryfilm.html"
|
<img src="./static/images/cover-cherniy-lotos.jpg" class="rounded-3 category-img" />
|
||||||
>
|
|
||||||
<img
|
|
||||||
src="./static/images/cover-cherniy-lotos.jpg"
|
|
||||||
class="rounded-3 category-img"
|
|
||||||
/>
|
|
||||||
<span class="category-name text-center mt-2">Фантастика</span>
|
<span class="category-name text-center mt-2">Фантастика</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -155,34 +94,16 @@
|
|||||||
<div class="premiers-row d-flex justify-content-center my-5">
|
<div class="premiers-row d-flex justify-content-center my-5">
|
||||||
<div id="carouselExampleCaptions" class="carousel slide w-100">
|
<div id="carouselExampleCaptions" class="carousel slide w-100">
|
||||||
<div class="carousel-indicators">
|
<div class="carousel-indicators">
|
||||||
<button
|
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active"
|
||||||
type="button"
|
aria-current="true" aria-label="Slide 1"></button>
|
||||||
data-bs-target="#carouselExampleCaptions"
|
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1"
|
||||||
data-bs-slide-to="0"
|
aria-label="Slide 2"></button>
|
||||||
class="active"
|
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2"
|
||||||
aria-current="true"
|
aria-label="Slide 3"></button>
|
||||||
aria-label="Slide 1"
|
|
||||||
></button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
data-bs-target="#carouselExampleCaptions"
|
|
||||||
data-bs-slide-to="1"
|
|
||||||
aria-label="Slide 2"
|
|
||||||
></button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
data-bs-target="#carouselExampleCaptions"
|
|
||||||
data-bs-slide-to="2"
|
|
||||||
aria-label="Slide 3"
|
|
||||||
></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-inner">
|
<div class="carousel-inner">
|
||||||
<div class="carousel-item active">
|
<div class="carousel-item active">
|
||||||
<img
|
<img src="./static/images/poster-posle-navsegda.webp" class="d-block w-100" alt="..." />
|
||||||
src="./static/images/poster-posle-navsegda.webp"
|
|
||||||
class="d-block w-100"
|
|
||||||
alt="..."
|
|
||||||
/>
|
|
||||||
<div class="carousel-caption d-none d-md-block">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h5>После навсегда</h5>
|
<h5>После навсегда</h5>
|
||||||
<p>
|
<p>
|
||||||
@ -192,11 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img
|
<img src="./static/images/poster-posredniki.webp" class="d-block w-100" alt="..." />
|
||||||
src="./static/images/poster-posredniki.webp"
|
|
||||||
class="d-block w-100"
|
|
||||||
alt="..."
|
|
||||||
/>
|
|
||||||
<div class="carousel-caption d-none d-md-block">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h5>Посредники</h5>
|
<h5>Посредники</h5>
|
||||||
<p>
|
<p>
|
||||||
@ -206,11 +123,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img
|
<img src="./static/images/poster-korolevskiy-korgi.webp" class="d-block w-100" alt="..." />
|
||||||
src="./static/images/poster-korolevskiy-korgi.webp"
|
|
||||||
class="d-block w-100"
|
|
||||||
alt="..."
|
|
||||||
/>
|
|
||||||
<div class="carousel-caption d-none d-md-block">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h5>Королевский корги</h5>
|
<h5>Королевский корги</h5>
|
||||||
<p>
|
<p>
|
||||||
@ -220,28 +133,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions"
|
||||||
class="carousel-control-prev"
|
data-bs-slide="prev">
|
||||||
type="button"
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||||
data-bs-target="#carouselExampleCaptions"
|
|
||||||
data-bs-slide="prev"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="carousel-control-prev-icon"
|
|
||||||
aria-hidden="true"
|
|
||||||
></span>
|
|
||||||
<span class="visually-hidden">Previous</span>
|
<span class="visually-hidden">Previous</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions"
|
||||||
class="carousel-control-next"
|
data-bs-slide="next">
|
||||||
type="button"
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||||
data-bs-target="#carouselExampleCaptions"
|
|
||||||
data-bs-slide="next"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="carousel-control-next-icon"
|
|
||||||
aria-hidden="true"
|
|
||||||
></span>
|
|
||||||
<span class="visually-hidden">Next</span>
|
<span class="visually-hidden">Next</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -251,7 +150,8 @@
|
|||||||
<footer class="container-fluid py-1">
|
<footer class="container-fluid py-1">
|
||||||
<span> © 2023 LiveCinema Бакальская Е. Д. </span>
|
<span> © 2023 LiveCinema Бакальская Е. Д. </span>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
<script type="module" src="./static/js/katalog.js"></script>
|
||||||
|
|
||||||
<script type="module" src="./static/js/katalog.js"></script>
|
|
||||||
</html>
|
</html>
|
@ -41,3 +41,13 @@ main {
|
|||||||
#item-show {
|
#item-show {
|
||||||
background-image: url("../images/barbie-dumaet.jpg");
|
background-image: url("../images/barbie-dumaet.jpg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#icons {
|
||||||
|
direction: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-fluid {
|
||||||
|
height: 300px;
|
||||||
|
}
|
@ -14,8 +14,6 @@ document
|
|||||||
const modal = document.getElementById("modal-movie");
|
const modal = document.getElementById("modal-movie");
|
||||||
const myModal = modal ? new Modal(modal, {}) : null;
|
const myModal = modal ? new Modal(modal, {}) : null;
|
||||||
|
|
||||||
// myModal.show();
|
|
||||||
|
|
||||||
function createItemsOption(name, value = "", isSelected = false) {
|
function createItemsOption(name, value = "", isSelected = false) {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.value = value || "";
|
option.value = value || "";
|
||||||
@ -53,7 +51,6 @@ async function readFile(file) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
// функция для обновления блока с превью выбранного изображения
|
// функция для обновления блока с превью выбранного изображения
|
||||||
async function updateImagePreview() {
|
async function updateImagePreview() {
|
||||||
// получение выбранного файла
|
// получение выбранного файла
|
||||||
@ -69,14 +66,15 @@ async function updateImagePreview() {
|
|||||||
const imagePlaceholder = "./static/images/cover-placeholder160x230.png";
|
const imagePlaceholder = "./static/images/cover-placeholder160x230.png";
|
||||||
|
|
||||||
modalControls.form.addEventListener("submit", async (event) => {
|
modalControls.form.addEventListener("submit", async (event) => {
|
||||||
|
console.info("Form onSubmit");
|
||||||
// отключение стандартного поведения формы при отправке
|
// отключение стандартного поведения формы при отправке
|
||||||
// при отправке страница обновляется и JS перестает работать
|
// при отправке страница обновляется и JS перестает работать
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
// если форма не прошла валидацию, то ничего делать не нужно
|
// если форма не прошла валидацию, то ничего делать не нужно
|
||||||
// if (!cntrls.form.checkValidity()) {
|
if (!modalControls.form.checkValidity()) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
let imageBase64 = "";
|
let imageBase64 = "";
|
||||||
// Получение выбранного пользователем изображения в виде base64 строки
|
// Получение выбранного пользователем изображения в виде base64 строки
|
||||||
@ -115,14 +113,19 @@ modalControls.form.addEventListener("submit", async (event) => {
|
|||||||
);
|
);
|
||||||
await moviesApiEndpoint.createObject(movie);
|
await moviesApiEndpoint.createObject(movie);
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// чтобы обновить запись, нужно сначала получить ее текущее состояние
|
||||||
// await editLine(
|
var movieObj = await moviesApiEndpoint.getObject(currentId);
|
||||||
// currentId,
|
// затем изменяем нужные поля
|
||||||
// cntrls.itemsType.value,
|
movieObj.name = modalControls.inputName.value;
|
||||||
// cntrls.price.value,
|
movieObj.description = modalControls.inputDescription.value;
|
||||||
// cntrls.count.value,
|
movieObj.duration = modalControls.inputDuration.value;
|
||||||
// imageBase64,
|
movieObj.categoryId = modalControls.selectCategory.value;
|
||||||
// );
|
// если картинка поменялась, то она будет храниться в переменной imageBase64 (см. код выше)
|
||||||
|
if (imageBase64 != "") {
|
||||||
|
movieObj.img = imageBase64;
|
||||||
|
}
|
||||||
|
// обновляем запись
|
||||||
|
await moviesApiEndpoint.updateObject(movieObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// после выполнения добавления/обновления модальное окно скрывается
|
// после выполнения добавления/обновления модальное окно скрывается
|
||||||
@ -133,6 +136,9 @@ modalControls.form.addEventListener("submit", async (event) => {
|
|||||||
async function buttonMovieAddClicked(e) {
|
async function buttonMovieAddClicked(e) {
|
||||||
modalControls.title.innerText = "Добавить фильм";
|
modalControls.title.innerText = "Добавить фильм";
|
||||||
modalControls.selectCategory.innerHTML = "";
|
modalControls.selectCategory.innerHTML = "";
|
||||||
|
|
||||||
|
resetValues();
|
||||||
|
|
||||||
const categories = await categoriesApiEndpoint.getObjects();
|
const categories = await categoriesApiEndpoint.getObjects();
|
||||||
modalControls.selectCategory.appendChild(
|
modalControls.selectCategory.appendChild(
|
||||||
createItemsOption("Выберите жанр", "", true)
|
createItemsOption("Выберите жанр", "", true)
|
||||||
@ -147,19 +153,54 @@ async function buttonMovieAddClicked(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function movieDeleteButtonClicked(e) {
|
async function movieDeleteButtonClicked(e) {
|
||||||
console.log(e.target);
|
|
||||||
const movieId = parseInt(e.target.id.split("-")[3]);
|
const movieId = parseInt(e.target.id.split("-")[3]);
|
||||||
await moviesApiEndpoint.deleteObject(movieId);
|
await moviesApiEndpoint.deleteObject(movieId);
|
||||||
await loadMoviesTableData();
|
await loadMoviesTableData();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function movieEditButtonClicked(e) {
|
// функция для показа модального окна
|
||||||
// TODO
|
// перед показом происходит заполнение формы для редактирования
|
||||||
// получить объект по id
|
// если объект item не пуст
|
||||||
// заполнение модального окна по данным объекта
|
async function showUpdateModal(itemId) {
|
||||||
// показ модального окна
|
// Получаем нужный объект по его id из базы
|
||||||
|
const item = await moviesApiEndpoint.getObject(itemId);
|
||||||
|
|
||||||
|
if (item != null) {
|
||||||
|
// Заполняем поля модального окна
|
||||||
|
modalControls.movieId.value = item.id;
|
||||||
|
|
||||||
|
modalControls.selectCategory.innerHTML = "";
|
||||||
|
const categories = await categoriesApiEndpoint.getObjects();
|
||||||
|
for (let i = 0; i < categories.length; i++) {
|
||||||
|
const category = categories[i];
|
||||||
|
modalControls.selectCategory.appendChild(
|
||||||
|
createItemsOption(category.name, category.id, category.id == item.categoryId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
modalControls.inputName.value = item.name;
|
||||||
|
modalControls.inputDuration.value = item.duration;
|
||||||
|
modalControls.inputDescription.value = item.description;
|
||||||
|
|
||||||
|
// заполнение превью
|
||||||
|
// Если пользователь выбрал изображение, то оно загружается
|
||||||
|
// в тэг image с id image - preview
|
||||||
|
// иначе устанавливается заглушка, адрес которой указан в imagePlaceholder
|
||||||
|
modalControls.imagePreview.src = item.img ? item.img : imagePlaceholder;
|
||||||
|
} else {
|
||||||
|
resetValues();
|
||||||
|
}
|
||||||
|
myModal.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function movieEditButtonClicked(e) {
|
||||||
|
modalControls.title.innerText = "Отредактируйте содержимое";
|
||||||
|
const movieId = parseInt(e.target.id.split("-")[3]);
|
||||||
|
await showUpdateModal(movieId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// функция заполняет данными и отрисовывает таблицу
|
||||||
async function loadMoviesTableData() {
|
async function loadMoviesTableData() {
|
||||||
const movies = await moviesApiEndpoint.getObjects();
|
const movies = await moviesApiEndpoint.getObjects();
|
||||||
const category = await categoriesApiEndpoint.getObjects();
|
const category = await categoriesApiEndpoint.getObjects();
|
||||||
@ -202,3 +243,21 @@ async function loadMoviesTableData() {
|
|||||||
movieEditButtons[i].addEventListener("click", movieEditButtonClicked);
|
movieEditButtons[i].addEventListener("click", movieEditButtonClicked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function hideUpdateModal() {
|
||||||
|
resetValues();
|
||||||
|
// удаление класса was-validated для скрытия результатов валидации
|
||||||
|
modalControls.form.classList.remove("was-validated");
|
||||||
|
myModal.hide();
|
||||||
|
}
|
||||||
|
// обнуление значений модального окна, т. к.
|
||||||
|
// используется одно окно для всех операций
|
||||||
|
function resetValues() {
|
||||||
|
modalControls.movieId.value = null;
|
||||||
|
modalControls.inputName.value = "";
|
||||||
|
modalControls.inputImage.value = null;
|
||||||
|
modalControls.selectCategory.value = null;
|
||||||
|
modalControls.inputDuration.value = "";
|
||||||
|
modalControls.inputDescription.value = "";
|
||||||
|
modalControls.imagePreview.src = imagePlaceholder;
|
||||||
|
}
|
||||||
|
@ -64,10 +64,7 @@ export class ApiEndpoint {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(`${serverUrl}/${this.endpoint}/${obj.id}`, options);
|
||||||
`${serverUrl}/${this.endpoint}/${obj.id}`,
|
|
||||||
options
|
|
||||||
);
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw response.statusText;
|
throw response.statusText;
|
||||||
}
|
}
|
||||||
|
25
static/js/validation.js
Normal file
25
static/js/validation.js
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user