This commit is contained in:
Extrimal 2023-12-11 16:49:10 +03:00
parent d1bc2c140b
commit 09af17c932
48 changed files with 7655 additions and 0 deletions

20
laba3/.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"
}
}

45
laba3/.gitignore vendored Normal file
View File

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

133
laba3/Admin.html Normal file
View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Admin_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK ADMIN</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-xl navbar-light bg-white">
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="Admin.html" class="nav-link" id="nav-Admin">Admin</a>
</li>
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="main_wrapper">
<div class="main_block1">
<div class="main_input">
<div class="main_world_and_field">
<p class="word_block">Title of the book</p>
<div class="main_field">
<input class="Pole" type="text" placeholder="">
</div>
<p class="word_block">Author</p>
<div class="main_field">
<input class="Pole" type="text" placeholder="">
</div>
<p class="word_block">Price</p>
<div class="main_field">
<input class="Pole" type="text" placeholder="">
</div>
</div>
<p class="p_button">Add photo</p>
<div class="block1_button">
<button class="button_Add">
Add
</button>
</div>
<div class="block_Button_tabel">
<a href="Tabel.html" class="button_tabel">Tabel</a>
</div>
</div>
</div>
<div class="main_block2">
<h1 class="Word_Genres">Genres</h1>
<div class="myCBContainer">
<div class="labelOne">
<label class="label_cb">
<input class="cb" type="checkbox">Fairy tale
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Biography
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Detective
</label>
<label class="label_cb">
<input class="cb" type="checkbox" >Textbook
</label>
</div>
<div class="labelTwo">
<label class="label_cb">
<input class="cb" type="checkbox">Detective
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Fantasy
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Romance
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Horror
</label>
</div>
</div>
<div class="block2_button">
<button class="button_Add_book">
Add book
</button>
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

131
laba3/Basket.html Normal file
View File

@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Basket_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light bg-white" >
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="container">
<div class="main_wrapper">
<div class="main_block1">
<h1 class="Word_Basket">
Basket
</h1>
<div class="line"></div>
<a href = "#" class = "Word_DeleteAll">
Delete all
</a>
</div>
<div class="Block_Two_Three">
<div class="Shell">
<div class="line_black"></div>
<div class="main_block2">
<img src="img/imageDracula.jpg" class="Img_Films">
<div class="Options_In_Films">
<p class="word_Dracula">Dracula</p>
<p class="word_Author">Bram Stoker</p>
<p class="word_Ganres">Genres: Horror</p>
<a href = "#" class = "word_Delete">
Delete
</a>
</div>
<div class="Button_add_In_Basket">
<div class="Circle_Left">-</div>
<div class="main_field_one">
<input type="text" class="text_Count" placeholder="1">
</div>
<div class="Circle_Right">+</div>
</div>
<p class="Word_Dollars">49 $</p>
</div>
</div>
<div class="main_block3">
<div class="wrapper_block3">
<p class="Word_with_Registr">
<a href = "Register.html" class = "word_registr">
Register
</a>
on the website and get a promo code for your first purchase
</p>
<div class="Class_Amount">
<p class="Word_Amount">Products in the amount of</p>
<p class="Word_Pay">98 $</p>
</div>
<div class="Class_Number">
<p class="Word_Number">Number of Products</p>
<p class="Word_Count">2</p>
</div>
<div class="Text_Promo">
<input type="text" class="Input_Word" placeholder="promo code">
<button class="Button_Apply">Apply</button>
</div>
<div class="All_price">
<p class="Text_Left_All_price">Total order amount</p>
<p class="Price">98 $</p>
</div>
<div class="class_Arrange">
<button class="button_Arrange">
Arrange
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

110
laba3/Books.html Normal file
View File

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Books_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-xl navbar-light bg-white">
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="container">
<div class="main_wrapper">
<div class="main_block1">
<p class="Word_Genres">Genres</p>
<div class="Label">
<div class="Label_block_1">
<label class="label_cb">
<input class="cb" type="checkbox">Fairy tale
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Biography
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Detective
</label>
<label class="label_cb">
<input class="cb" type="checkbox" >Textbook
</label>
</div>
<div class="Label_block_2">
<label class="label_cb">
<input class="cb" type="checkbox">Detective
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Fantasy
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Romance
</label>
<label class="label_cb">
<input class="cb" type="checkbox">Horror
</label>
</div>
</div>
<div class="block1_button">
<button class="button_Apply_book">
Apply
</button>
</div>
<div class="Panel_Admin2">
<a href="Tabel.html" class="Admin_Word2">Append Book</a>
</div>
</div>
<div class="main_block2">
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script type="module" src="js/cards.js"></script>
</body>
</html>

84
laba3/Contact.html Normal file
View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Contact_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light bg-white" >
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="container">
<div class="intro_wrapper">
<h1 class="intro_title">
Contact
</h1>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<div class="footer_wrapper">
<div class="footer_words_with_link">
<p class="footer_word">
If you have any questions or there was some mistake,
please write to us by email
<a href = "#" class = "word_link_mail">
book_shop@mail.com.
</a>
We will try to respond as soon as possible.
</p>
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

89
laba3/Register.html Normal file
View File

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Register_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light bg-white" >
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="main_wrapper">
<div class="main_block">
<div class="up_word">
<p class="main_title">
Create an account
</p>
<p class="main_text">
Enter your nickname, username and password
</p>
</div>
<div class="main_fields">
<div class="main_field_one">
<input type="text" placeholder="nickname">
</div>
<div class="main_field_one">
<input type="text" placeholder="login">
</div>
<div class="main_field_two">
<input type="text" placeholder="password">
</div>
</div>
<div class="class_login">
<button class="button_login">
Register
</button>
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

93
laba3/Sign_in.html Normal file
View File

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/Sign_in_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light bg-white" >
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="main_wrapper">
<div class="main_block">
<div class="up_word">
<p class="main_title">
Sign in
</p>
<p class="main_text">
Login using your username and password
</p>
</div>
<div class="main_fields">
<div class="main_field_one">
<input type="text" placeholder="login">
</div>
<div class="main_field_two">
<input type="text" placeholder="password">
</div>
</div>
<div class="class_login">
<button class="button_login">
Login
</button>
</div>
<div class="down_word">
If you don't have an account, <br>
then
<a href = "Register.html" class = "word_registr">
register
</a>
</div>
</div>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

142
laba3/Tabel.html Normal file
View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link href="node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/Tabel_style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK ADMIN</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-xl navbar-light bg-white">
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="Admin.html" class="nav-link" id="nav-Admin">Admin</a>
</li>
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="container">
<div class="btn-group" role="group">
<button id="items-add" class="btn btn-info">add a product</button>
<!-- -->
</div>
<div>
<table id="items-table" class="table table-striped">
<thead>
<th scope="col"></th>
<th scope="col" class="w-25">Name</th>
<th scope="col" class="w-25">Price</th>
<th scope="col" class="w-25">Author</th>
<th scope="col" class="w-25">Genre</th>
<th scope="col"></th>
<th scope="col"></th>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</main>
<div id="items-update" class="modal fade" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog">
<form id="items-form" class="needs-validation" novalidate>
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="items-update-title"></h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="text-center">
<img id="image-preview" src="https://via.placeholder.com/200" class="rounded rounded-0"
alt="placeholder">
</div>
<input id="items-line-id" type="number" hidden>
<div class="mb-2">
<label class="form-label" for="name_book">Name</label>
<input id="name_book" name="name_book" class="form-control" type="text" min="1" step="1" required>
</div>
<div class="mb-2">
<label class="form-label" for="price">Price</label>
<input id="price" name="price" class="form-control" type="number" value="0.00" min="100"
step="50" required>
</div>
<div class="mb-2">
<label class="form-label" for="author">Author</label>
<select id="author" name="selectAuthor" class="form-control" required>
</select>
</div>
<div class="mb-2">
<label for="genre" class="form-label">Genre</label>
<select id="genre" class="form-select" name="selected" required>
</select>
</div>
<div class="mb-2">
<label class="form-label" for="image">Image</label>
<input id="image" type="file" name="image" class="form-control" accept="image/*">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Сlose</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
</form>
</div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script type="module">
import validation from "./js/validation";
import { linesForm } from "./js/lines";
document.addEventListener('DOMContentLoaded', () => {
validation();
linesForm();
});
</script>
</body>
</html>

168
laba3/css/Admin_style.css Normal file
View File

@ -0,0 +1,168 @@
body{
font-family: 'Inter', sans-serif;
background-color: #BFE3FF;
}
p{
margin: 0;
font-size: 20px;
}
.main{
min-height: 100vh;
margin-top: 124px;
display: flex;
align-items: center;
justify-content: center;
}
.main_wrapper{
width: 810px;
height: 550px;
background-color: #FFFFFF;
border-radius: 3%;
display: flex;
}
.main_block1{
margin-top: 58px;
display: flex;
width: 50%;
justify-content: center;
}
.Pole{
height: 53px;
width: 100%;
font-size: 20px;
line-height: 16px;
border: 1px solid #000000;
border-radius: 30px;
}
.main_field{
margin-bottom: 20px;
}
.word_block{
margin-left: 20px;
}
.p_button{
text-align: center;
}
.block1_button{
display: flex;
justify-content: center;
}
.button_Add{
width: 111px;
height: 41px;
background-color: #FFFFFF;
transition: .2s ease;
}
.button_Add:hover{
background: #E3E3E3;
}
.block_Button_tabel{
display: flex;
justify-content: center;
margin-top: 20px;
}
.button_tabel{
display: flex;
align-items: center;
justify-content: center;
width: 200px;
height: 40px;
text-decoration: none;
color: #000000;
background-color: #18BDF1;
border-color: #18BDF1;
border-radius: 10px;
transition: .2s ease;
}
.button_tabel:hover{
background-color: #91F0FD;
border-color: #91F0FD;
}
.main_world_and_field{
margin-bottom: 35px;
}
.main_block2{
margin-top: 41px;
width: 50%;
}
.Word_Genres{
font-size: 30px;
font-weight: 700;
text-align: center;
margin-bottom: 30px;
width: 80%;
}
.myCBContainer{
display: flex;
width: 80%;
justify-content: space-between;
}
.label_cb{
margin-bottom: 40px;
display: flex;
align-items: center;
}
.labelTwo{
text-align: end;
}
.cb{
cursor: pointer;
width: 28px;
height: 28px;
margin-right: 19px;
font-size: 20px;
}
.block2_button{
width: 80%;
margin-top: 30px;
display: flex;
justify-content: center;
}
.button_Add_book{
background-color: #FFFFFF;
display: flex;
justify-content:center;
align-items: center;
width: 216px;
height: 39px;
border-radius: 30px;
border: 1px solid #000000;
font-size: 20px;
line-height: 39px;
transition: 0.2s ease;
cursor: pointer;
}
.button_Add_book:hover{
background: #E3E3E3;
}
@media (max-width: 660px){
.main_wrapper{
width: 405px;
height: 1100px;
display: block;
}
.main_block1{
width: 100%;
}
.main_block2{
width: 100%;
}
}
@media (max-width: 250px){
.myCBContainer{
display: inline;
}
.main_wrapper{
height: 1200px;
}
.button_Add_book{
width: 100%;
}
}

334
laba3/css/Basket_style.css Normal file
View File

@ -0,0 +1,334 @@
body{
font-family: 'Inter', sans-serif;
background-color: #F4F4F5;
}
p{
margin: 0;
font-size: 19px;
}
.main{
min-height: 100vh;
margin-top: 124px;
display: flex;
}
.main_wrapper{
width: 100%;
}
.main_block1{
width: 100%;
height: 138px;
margin-top: 32px;
}
.Word_Basket{
font-size: 26px;
font-weight: 700;
margin-bottom: 43px;
}
.line{
margin-bottom: 15px;
border: none;
padding: 0;
height: 0;
border-top: 2px dashed #18BDF1;
background: #F4F4F5;
}
.Word_DeleteAll{
color: #18BDF1;
font-size: 20px;
text-decoration: none;
transition: color 0.2s ease;
}
.Word_DeleteAll:hover{
color: #91F0FD;
}
.line_black{
width: 100%;
border-top: 1px solid #000;
margin-bottom: 32px;
}
.Block_Two_Three{
display: flex;
}
.Shell{
margin-right: 57px;
width: 700px;
}
.main_block2{
width: 100%;
display: flex;
margin-bottom: 32px;
}
.Img_Films{
width: 101px;
height: 147px;
margin-right: 56px;
}
.Options_In_Films{
margin-right: 75px;
}
.word_Dracula{
font-weight: 700;
}
.word_Ganres{
margin-top: 3px;
color: #808080;
margin-bottom: 35px;
}
.word_Delete{
font-size: 20px;
text-decoration: none;
color: #18BDF1;
transition: color 0.2s ease;
}
.word_Delete:hover{
color: #91F0FD;
}
.Button_add_In_Basket{
display: flex;
margin-right: 107px;
}
.Circle_Left{
width: 35px;
height: 44px;
border: 1px solid #95999B;
border-radius: 60% 0 0 60% / 50% 0 0 50%;
background: #CCD4DB;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
cursor: pointer;
transition: .2s ease;
}
.Circle_Left:hover{
background: #B9C0C6;
}
.text_Count{
height: 44px;
width: 90px;
border: 1px solid #95999B;
background-color: #CCD4DB;
text-align: center;
}
.Circle_Right{
width: 35px;
height: 44px;
border: 1px solid #95999B;
border-radius: 0 60% 60% 0 / 0 50% 50% 0;
background: #CCD4DB;
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
padding-right: 5px;
cursor: pointer;
transition: .2s ease;
}
.Circle_Right:hover{
background: #B9C0C6;
}
.Word_Dollars{
font-size: 24px;
font-weight: 700;
}
.main_block3{
width: 354px;
}
.wrapper_block3{
width: 100%;
height: 478px;
border-radius: 3%;
justify-content: center;
text-align: center;
border: 1px solid #94A8B8;
}
.Word_with_Registr{
text-align: left;
margin-left: 10px;
margin-top: 22px;
margin-bottom: 49px;
font-size: 18px;
}
.word_registr{
text-decoration: none;
color: #18BDF1;
transition: color 0.2s ease;
}
.word_registr:hover{
color: #91F0FD;
}
.Class_Amount{
display: flex;
margin-bottom: 33px;
margin-left: 10px;
}
.Word_Amount{
margin-right: 62px;
font-size: 18px;
}
.Word_Pay{
font-size: 20px;
}
.Class_Number{
display: flex;
margin-bottom: 56px;
margin-left: 10px;
}
.Word_Number{
font-size: 18px;
margin-right: 112px;
}
.Word_Count{
font-size: 20px;
}
.Text_Promo{
display: flex;
margin-left: 10px;
margin-bottom: 28px;
height: 56px;
}
.Input_Word{
height: 56px;
width: 198px;
border: 1px solid #D9D9D9;
background-color: #D9D9D9;
font-size: 18px;
}
.Button_Apply{
width: 132px;
height: 56px;
border: 1px solid #BBCCD8;
background-color: #BBCCD8;
color: #0CA9BE;
font-size: 18px;
transition: 0.2s ease;
}
.Button_Apply:hover{
background-color: #CEE0EE;
}
.All_price{
display: flex;
margin-left: 10px;
margin-bottom: 20px;
font-weight: 700;
font-size: 18px;
}
.Text_Left_All_price{
margin-right: 105px;
}
.button_Arrange{
width: 190px;
height: 43px;
background-color: #FC4343;
border: 1px solid #FC4343;
border-radius: 5px;
color: #FFFFFF;
transition: 0.2s ease;
}
.button_Arrange:hover{
background-color: #FF7575;
border: 1px solid #FF7575;
}
@media (max-width: 1469px){
.Shell{
margin-right: 10px;
}
.Img_Films{
margin: 0px;
}
.Options_In_Films{
margin-right: 20px;
}
.Shell{
width: 600px;
}
}
@media (max-width: 1321px){
.Shell{
width: 200px;
}
.main_block2{
display: flex;
flex-direction: column;
align-items: center;
}
.Options_In_Films{
text-align: center;
margin-right: 0;
}
.word_Ganres{
margin-bottom: 10px;
}
.Button_add_In_Basket{
margin-right: 0px;
}
.Block_Two_Three{
width: 100%;
}
}
@media (max-width: 527px){
.Block_Two_Three{
flex-direction: column;
align-items: center;
}
}
@media (max-width: 358px){
.main_block3{
width: 100%;
margin-bottom: 10px;
}
.Word_with_Registr{
font-size: 16px;
width: 90%;
text-align: center;
margin-bottom: 15px;
}
.Class_Amount{
flex-direction: column;
align-items: center;
margin-left: 0;
}
.Word_Amount{
margin-right: 0px;
font-size: 16px;
}
.Word_Pay{
font-size: 16px;
}
.Class_Number{
flex-direction: column;
align-items: center;
margin-left: 0;
margin-bottom: 5px;
}
.Word_Number{
font-size: 16px;
margin-right: 0px;
}
.Word_Count{
font-size: 16px;
}
.All_price{
flex-direction: column;
align-items: center;
margin-left: 0;
}
.Text_Left_All_price{
font-size: 16px;
margin-right: 0px;
}
.Price{
font-size: 16px;
}
.Text_Promo{
margin-left: 0px;
}
.Input_Word{
width: 70%;
}
.Button_Apply{
width: 30%;
}
}

242
laba3/css/Books_style.css Normal file
View File

@ -0,0 +1,242 @@
body{
font-family: 'Inter', sans-serif;
background-color: #F4F4F5;
}
p{
margin: 0;
}
.main{
min-height: 100vh;
margin-top: 124px;
display: flex;
}
.main_wrapper{
width: 100%;
display: flex;
}
.main_block1{
margin-top: 24px;
width: 130px;
margin-right: 56px;
}
.Word_Genres{
font-size: 26px;
margin-bottom: 24px;
}
.label_cb{
margin-bottom: 40px;
display: flex;
align-items: center;
transition: 0.2s ease;
cursor: pointer;
}
.label_cb:hover{
color: #808080;
}
.cb{
cursor: pointer;
width: 28px;
height: 28px;
margin-right: 19px;
font-size: 20px;
}
.label_cb:last-child{
margin-bottom: 32px;
}
.block1_button{
width: 100%;
margin-top: 30px;
}
.button_Apply_book{
background-color: #FFFFFF;
display: flex;
justify-content:center;
align-items: center;
width: 125px;
height: 29px;
border-radius: 30px;
border: 1px solid #000000;
font-size: 20px;
line-height: 39px;
transition: 0.2s ease;
cursor: pointer;
}
.button_Apply_book:hover{
background: #BCBCBC;
}
.Panel_Admin2{
margin-top: 20px;
text-align: center;
}
.Admin_Word2{
text-decoration: none;
font-size: 18px;
color: #18BDF1;
transition: color .2s ease;
}
.Admin_Word2:hover{
color: #91F0FD;
}
.main_block2{
width: 100%;
margin-top: 30px;
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-column-gap: 115px;
grid-row-gap: 67px;
}
.Conteiner_Films{
width: 241px;
height: 516px;
}
.Img_Films{
width: 241px;
height: 335px;
}
.word_Prince_book{
margin-top: 9px;
font-size: 24px;
font-weight: 700;
height: 28px;
}
.word_Name_book{
font-size: 19px;
font-weight: 700;
height: 21px;
}
.word_Author_book{
font-size: 19px;
font-weight: 400;
}
.word_Genres_book{
font-size: 19px;
font-weight: 400;
color: #808080;
}
.Admin_Word1{
text-decoration: none;
color: #18BDF1;
transition: color .2s ease;
margin-right: 10px;
}
.Admin_Word1:hover{
color: #91F0FD;
}
.block2_button{
width: 100%;
margin-top: 22px;
}
.button_InBusket_book{
background-color: #A2D7FF;
display: flex;
justify-content:center;
align-items: center;
width: 163px;
height: 41px;
border-radius: 30px;
border: 1px solid #A2D7FF;
font-size: 20px;
line-height: 39px;
transition: 0.2s ease;
cursor: pointer;
}
.button_InBusket_book:hover{
background-color: #38AAFF;
}
@media (max-width: 2560px){
.main_block2{
grid-template-columns: repeat(5, 1fr);
grid-column-gap: 115px;
}
}
@media (max-width: 2210px){
.main_block2{
grid-template-columns: repeat(4, 1fr);
grid-column-gap: 115px;
}
}
@media (max-width: 1852px){
.main_block2{
grid-template-columns: repeat(3, 1fr);
grid-column-gap: 109px;
}
}
@media (max-width: 1485px){
.main_block2{
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 1129px){
.main_block2{
grid-template-columns: repeat(1, 1fr);
}
}
@media (max-width: 430px){
.main_wrapper{
display: flex;
flex-direction: column;
align-items: center;
}
.main_block1{
margin-right: 0px;
width: 243px;
}
.Label{
display: flex;
}
.block1_button{
display: flex;
justify-content: center;
}
.main_block2{
justify-items: center;
}
}
@media (max-width: 242px){
.Word_Genres{
margin-bottom: 7px;
}
.Label_block_1{
margin-right: 10px;
}
.main_block1{
width: 100%;
}
.cb{
width: 16px;
height: 16px;
margin-right: 0px;
}
.label_cb{
font-size: 14px;
margin-bottom: 4px;
}
.block1_button{
margin-top: 0px;
}
.Img_Films{
width: 70%;
height: 50%;
}
.Conteiner_Films{
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
}
.block2_button{
display: flex;
justify-content: center;
}
}

View File

@ -0,0 +1,68 @@
body{
font-family: 'Inter', sans-serif;
background-color: #FFFFFF;
}
.main{
margin-top: 124px;
background-image:url('../img/Contact_Imagin.jpg');
background-repeat: no-repeat;
background-size:cover;
height: 321px;
width: 100%;
display: flex;
align-items: center;
}
.intro_wrapper{
margin-bottom: 44px;
display: flex;
justify-content: center;
}
.intro_title{
font-size: 40px;
font-weight: 700;
margin: 0;
}
.footer{
width: 100%;
height: 150px;
display:flex;
}
.footer_wrapper{
width: 100%;
margin-top: 33px;
}
.footer_words_with_link{
width: 942px;
}
.footer_word{
font-size: 26px;
}
.word_link_mail{
color: #18BDF1;
text-decoration: none;
transition: color .2s ease;
}
.word_link_mail:hover{
color: #91F0FD;
}
@media (max-width: 1269px){
.footer_words_with_link{
width: 90%;
}
}
@media (max-width: 280px){
.footer_word{
font-size: 18px;
}
}

View File

@ -0,0 +1,113 @@
body{
font-family: 'Inter', sans-serif;
background-color: #BFE3FF;
}
.main{
min-height: 100vh;
margin-top: 124px;
display: flex;
align-items: center;
justify-content: center;
}
.main_wrapper{
width: 430px;
height: 550px;
background-color: #FFFFFF;
border-radius: 3%;
display: flex;
justify-content: center;
text-align: center;
}
.main_block{
margin-top: 35px;
}
.up_word{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.main_title{
width: 100%;
margin: 0;
font-size: 34px;
}
.main_text{
width: 74%;
margin: 0;
font-size: 15px;
}
.main_fields{
margin-top: 43px;
}
input{
height: 53px;
width: 100%;
font-size: 20px;
line-height: 16px;
border: 1px solid #000000;
border-radius: 30px;
padding-left: 31px;
}
.main_field_one{
margin-bottom: 21px;
width: 100%;
}
.class_login{
width: 100%;
display: flex;
justify-content: center;
margin-top: 56px;
}
.button_login{
background-color: #FFFFFF;
display: flex;
justify-content:center;
align-items: center;
width: 216px;
height: 39px;
border-radius: 30px;
border: 1px solid #000000;
font-size: 20px;
line-height: 39px;
transition: 0.2s ease;
cursor: pointer;
}
.button_login:hover{
background: #E3E3E3;
}
@media (max-width: 436px){
.main_wrapper{
width: 350px;
height: 500px;
}
input{
height: 35px;
width: 70%;
}
}
@media (max-width: 305px){
.button_login{
width: 160px;
height: 30px;
}
}
@media (max-width: 240px){
.main_title{
font-size: 26px;
}
.main_text{
font-size: 12px;
}
}
@media (max-width: 200px){
input{
padding-left: 15px;
}
}

120
laba3/css/Sign_in_style.css Normal file
View File

@ -0,0 +1,120 @@
body{
font-family: 'Inter', sans-serif;
background-color: #BFE3FF;
}
header{
background-color: #FFFFFF;
}
.main{
min-height: 100vh;
margin-top: 124px;
display: flex;
align-items: center;
justify-content: center;
}
.main_wrapper{
width: 430px;
height: 550px;
background-color: #FFFFFF;
border-radius: 3%;
display: flex;
justify-content: center;
text-align: center;
}
.main_block{
margin-top: 35px;
}
.up_word{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.main_title{
width: 60%;
margin: 0;
font-size: 34px;
}
.main_text{
width: 74%;
margin: 0;
font-size: 15px;
}
.main_fields{
margin-top: 18px;
}
input{
height: 53px;
width: 100%;
font-size: 20px;
line-height: 16px;
border: 1px solid #000000;
border-radius: 30px;
padding-left: 31px;
}
.main_field_one{
margin-bottom: 17px;
width: 100%;
}
.class_login{
width: 100%;
display: flex;
justify-content: center;
margin-top: 84px;
}
.button_login{
background-color: #FFFFFF;
display: flex;
justify-content:center;
align-items: center;
width: 216px;
height: 39px;
border-radius: 30px;
border: 1px solid #000000;
font-size: 20px;
line-height: 39px;
transition: 0.2s ease;
cursor: pointer;
}
.button_login:hover{
background: #E3E3E3;
}
.down_word{
width: 100%;
margin-top: 23px;
font-size: 15px;
}
.word_registr{
text-decoration: none;
color:#18BDF1;
transition: color 0.2s ease;
}
.word_registr:hover{
color: #91F0FD;
}
@media (max-width: 436px){
.main_wrapper{
width: 350px;
height: 500px;
}
input{
height: 35px;
width: 70%;
}
}
@media (max-width: 305px){
.button_login{
width: 160px;
height: 30px;
}
}
@media (max-width: 200px){
input{
padding-left: 15px;
}
}

12
laba3/css/Tabel_style.css Normal file
View File

@ -0,0 +1,12 @@
main{
margin-top: 150px;
display: flex;
}
body{
background-color: #F4F4F5;
}
#image-preview {
width: 241px;
height: 335px;
}

View File

@ -0,0 +1,84 @@
header{
background-color: #FFFFFF;
}
.navbar-light .navbar-toggler-icon{
background-image: url(../img/menu-hamburger.svg);
}
.navbar{
padding: 0;
min-height: 124px;
}
.container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
padding: 0;
margin-left: 175px;
margin-right: 175px;
}
.navbar-light .navbar-toggler{
color: black;
border-color: black;
}
.navbar-light .navbar-nav .nav-link {
color: #000000;
}
.navbar-light .navbar-nav .nav-link:hover {
color:gray;
}
.navbar-collapse{
flex-grow: 0;
}
.navbar-brand{
display: flex;
align-items: center;
}
.word{
color: #E7B533;
margin-left: 9px;
font-size: 26px;
line-height: 30px;
transition: color .2s ease;
}
.word:hover{
color:#EBD59D;
}
.navbar-expand-lg .navbar-nav .nav-link {
padding-right: 0;
padding-left: 0;
margin-left: 30px;
}
.nav-link{
font-size: 20px;
padding: 0px;
}
.nav-link span{
font-size: 16px;
}
#nav-Admin{
color: #18BDF1;
transition: color .2s ease;
}
#nav-Admin:hover{
color: #91F0FD;
}
.navbar-collapse{
justify-content: flex-end;
}
@media (min-width: 1660px){
.container, .container-lg, .container-md, .container-sm, .container-xl {
max-width: 2560px;
}
}
@media (max-width: 991px){
.navbar-expand-lg .navbar-nav .nav-link {
margin-left: 0;
}
.container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
margin-left: auto;
margin-right: auto;
}
.nav-link{
display: inline;
}
}

171
laba3/css/style.css Normal file
View File

@ -0,0 +1,171 @@
body{
font-family: 'Inter', sans-serif;
background-color: #BFE3FF;
}
.main{
background-image:url('../img/Intro_img.jpg');
background-repeat: no-repeat;
background-size:cover;
height: 100vh;
width: 100%;
display: flex;
align-items: center;
margin-top: 124px;
}
.intro_wrapper{
display: flex;
justify-content: right;
min-height: 240px;
}
.intro_block{
width: 553px;
}
.intro_title{
font-size: 60px;
font-weight: 700;
margin: 0 0 29px 0;
}
.intro_text{
font-size: 20px;
margin: 0;
}
.footer{
background-color: #D7DDE1;
height: 57px;
display:flex;
align-items: center;
}
.footer_wrapper{
display: flex;
align-items: center;
justify-content: space-between;
}
.nav_foot{
margin-right: 8px;
text-decoration: none;
}
.mail_line_phone{
font-size: 20px;
font-weight: 400;
color: #000000;
text-decoration: none;
margin-left: 31px;
margin-bottom: -5px;
transition: color .2s ease;
}
.mail_line_phone:first-child{
margin-left: 0;
}
.mail_line_phone:hover{
color:gray;
}
@media (max-width:768px){
.intro_wrapper{
justify-content: center;
}
.intro_block{
width: 400px;
color: #D3C9AE;
}
.intro_title{
font-size: 45px;
}
.intro_text{
font-size: 16px;
}
.footer{
height: 80px;
}
.footer_wrapper{
display: block;
}
.nav_mail_line_phone{
margin-top: 10px;
}
}
@media (max-width:473px){
.nav_mail_line_phone{
margin-top: 10px;
}
.mail_line_phone{
font-size: 16px;
}
}
@media (max-width:450px){
.intro_title{
font-size: 30px;
}
.intro_text{
font-size: 10px;
}
}
@media (max-width:397px){
.intro_block{
width: 300px;
color: #D3C9AE;
}
.intro_title{
font-size: 35px;
}
.intro_text{
font-size: 13px;
}
.mail_line_phone{
margin-left: 0;
}
}
@media (max-width:334px){
.mail_line_phone{
display: flex;
flex-direction: column;
}
#line{
display: none;
}
}
@media (max-width:300px){
.intro_block{
width: 200px;
color: #D3C9AE;
}
.intro_title{
font-size: 35px;
}
.intro_text{
font-size: 13px;
}
}
@media (max-width:240px){
.intro_block{
width: 200px;
color: #D3C9AE;
}
.intro_title{
font-size: 35px;
}
.intro_text{
font-size: 13px;
}
}
@media (max-height:450px){
.intro_block{
margin-top: 50px;
}
.intro_title{
font-size: 30px;
}
.intro_text{
font-size: 10px;
}
}

72
laba3/data.json Normal file

File diff suppressed because one or more lines are too long

BIN
laba3/img/6391435521.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 KiB

BIN
laba3/img/Group 4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
laba3/img/Intro_img.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

9
laba3/img/icon book.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 309 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 24 KiB

9
laba3/img/icon man.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 26 KiB

9
laba3/img/icon vk.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

BIN
laba3/img/imageDracula.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

3
laba3/img/line.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="1" height="30" viewBox="0 0 1 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<line x1="0.5" y1="30" x2="0.5" stroke="black"/>
</svg>

After

Width:  |  Height:  |  Size: 150 B

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<title>menu-hamburger</title>
<g id="Layer_2" data-name="Layer 2">
<g id="invisible_box" data-name="invisible box">
<rect width="48" height="48" fill="none"/>
</g>
<g id="icons_Q2" data-name="icons Q2">
<g>
<path d="M42,12a2,2,0,0,1-2,2H8a2,2,0,0,1-2-2H6a2,2,0,0,1,2-2H40a2,2,0,0,1,2,2Z"/>
<path d="M42,24a2,2,0,0,1-2,2H8a2,2,0,0,1-2-2H6a2,2,0,0,1,2-2H40a2,2,0,0,1,2,2Z"/>
<path d="M42,36a2,2,0,0,1-2,2H8a2,2,0,0,1-2-2H6a2,2,0,0,1,2-2H40a2,2,0,0,1,2,2Z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 750 B

103
laba3/index.html Normal file
View File

@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/header_style.css">
<title>BOOK SHOP</title>
</head>
<body>
<header id="header" class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light bg-white" >
<div class="container">
<a href="index.html" class="navbar-brand">
<img width="100%" src="img/icon book.svg"/>
<div class="word">
Book <br>
shop
</div>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto mb-3 mb-lg-0">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="Books.html" class="nav-link">Books</a>
</li>
<li class="nav-item">
<a href="Contact.html" class="nav-link">Contact</a>
</li>
<li class="nav-item">
<a href="Basket.html" class="nav-link">
<img src="img/icon shopping curt.svg" alt="">
</a>
</li>
<li class="nav-item">
<a href="Sign_in.html" class="nav-link">
<img src="img/icon man.svg" alt="">
<span>SIGN IN<span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="main">
<div class="container">
<div class="intro_wrapper">
<div class="intro_block">
<h1 class="intro_title">
There are a lot of books in our store
</h1>
<p class="intro_text">
Come to our store or choose any books&shy; to your taste at a very favorable price.
Every day we are replenished with more and more products.
</p>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<div class = "footer_wrapper">
<nav>
<a href = "https://chat.whatsapp.com/KDJp7dnHzAWBQmT7PF3ZN3" class = "nav_foot">
<img src="img/icon watsapp.svg" alt="">
</a>
<a href = "https://vk.com/shanygin2000" class = "nav_foot">
<img src="img/icon vk.svg" alt="">
</a>
<a href = "https://instagram.com/sshanygin?igshid=NzZlODBkYWE4Ng==&utm_source=qr" class = "nav_foot">
<img src="img/icon instogram.svg" alt="">
</a>
<a href="https://web.telegram.org/a/#1337526477" class="nav_foot">
<img src="img/icon telegram.svg" alt="">
</a>
</nav>
<nav class="nav_mail_line_phone">
<a href = "#" class="mail_line_phone">
Book_shop@mail.com
</a>
<img src="img/line.svg" alt="" class="mail_line_phone" id="line">
<a href = "#" class="mail_line_phone">
+7(999)-323-65-23
</a>
</nav>
</div>
</div>
</footer>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

46
laba3/js/cards.js Normal file
View File

@ -0,0 +1,46 @@
import {
getAllLines
} from "./lines-rest-api";
async function createCard(price, name_book, authors, genres, image) {
const cardContainer = document.querySelector('.main_block2');
if (image == "") {
image = "img/imageDracula.jpg"
}
const cardItem =
`
<div class="Conteiner_Films">
<img src="${image}" class="Img_Films">
<p class="word_Prince_book">${price} $</p>
<p class="word_Name_book">${name_book}</p>
<p class="word_Author_book">${authors}</p>
<p class="word_Genres_book">Genres: ${genres}</p>
<div class="Panel_Admin1">
<a href="Admin.html" class="Admin_Word1">Edit</a>
<a href="" class="Admin_Word1">Delete</a>
</div>
<div class="block2_button">
<button class="button_InBusket_book">
In a basket
</button>
</div>
</div>
`;
cardContainer.insertAdjacentHTML('beforeend', cardItem);
}
async function createCards() {
const data = await getAllLines();
console.log(data)
data.forEach(item => {
createCard(item.price, item.name_book, item.authors.name, item.items.name, item.image);
});
}
document.addEventListener('DOMContentLoaded', () => {
createCards();
});

61
laba3/js/lines-modal.js Normal file
View File

@ -0,0 +1,61 @@
// Модуль для работы с модальным окном
// импорт компонента 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.genreType.value = "";
cntrls.price.value = parseFloat(0).toFixed(2);
cntrls.name_book.value = "";
cntrls.author.value = "";
cntrls.image.value = "";
cntrls.imagePreview.src = imagePlaceholder;
}
// функция для показа модального окна
// перед показом происходит заполнение формы для редактирования
// если объект item не пуст
export function showUpdateModal(genre) {
modalTitle.innerHTML = genre=== null ? "Добавить" : "Изменить";
console.info(genre);
console.log(genre);
if (genre) {
cntrls.lineId.value = genre.id;
cntrls.genreType.value = genre.itemsId;
cntrls.name_book.value = genre.name_book;
cntrls.price.value = genre.price;
cntrls.author.value = genre.authorsId;
// заполнение превью
// Если пользователь выбрал изображение, то оно загружается
// в тэг image с id image - preview
// иначе устанавливается заглушка, адрес которой указан в imagePlaceholder
cntrls.imagePreview.src = genre.image ? genre.image : imagePlaceholder;
} else {
resetValues();
}
myModal.show();
}
// функция для скрытия модального окна
export function hideUpdateModal() {
resetValues();
// удаление класса was-validated для скрытия результатов валидации
cntrls.form.classList.remove("was-validated");
myModal.hide();
}

107
laba3/js/lines-rest-api.js Normal file
View File

@ -0,0 +1,107 @@
// модуль для работы с REST API сервера
// адрес сервера
const serverUrl = "http://localhost:8081";
// функция возвращает объект нужной структуры для отправки на сервер
function createLineObject(genre, price, name_book, author, image) {
return {
itemsId: genre,
price: parseFloat(price).toFixed(2),
name_book,
authorsId: author,
image,
};
}
// обращение к серверу для получения всех типов товара (get)
export async function getAllItemTypes() {
const response = await fetch(`${serverUrl}/items`);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
export async function getAllAuthors() {
const response = await fetch(`${serverUrl}/authors`);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
// обращение к серверу для получения всех записей (get)
export async function getAllLines() {
const response = await fetch(`${serverUrl}/lines?_expand=items&_expand=authors`);
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, price, name_book, author, image) {
const itemObject = createLineObject(genre, price, name_book, author, image);
const options = {
method: "POST",
body: JSON.stringify(itemObject),
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
};
const response = await fetch(`${serverUrl}/lines`, options);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
// обращение к серверу для обновления записи по id (put)
// объект отправляется в теле запроса (body)
// id передается в качестве части пути URL get-запроса
export async function updateLine(id, genre, price, name_book,author, image) {
const itemObject = createLineObject(genre, price, name_book, author, image);
const options = {
method: "PUT",
body: JSON.stringify(itemObject),
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
};
const response = await fetch(`${serverUrl}/lines/${id}`, options);
if (!response.ok) {
throw response.statusText;
}
return response.json();
}
// обращение к серверу для удаления записи по 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();
}

93
laba3/js/lines-ui.js Normal file
View File

@ -0,0 +1,93 @@
// модуль для работы с элементами управления
// объект для удобного получения элементов
// при обращении к атрибуту объекта вызывается
// нужная функция для поиска элемента
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"),
genreType: document.getElementById("genre"),
price: document.getElementById("price"),
name_book: document.getElementById("name_book"),
author: document.getElementById("author"),
image: document.getElementById("image"),
imagePreview: document.getElementById("image-preview"),
};
// Дефолтное превью
export const imagePlaceholder = "img/6391435521.jpg";
// функция создает тег 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(genre, index, editCallback, deleteCallback) {
const rowNumber = document.createElement("th");
rowNumber.scope = "row";
rowNumber.textContent = index + 1;
const row = document.createElement("tr");
row.id = `line-${genre.id}`;
row.appendChild(rowNumber);
row.appendChild(createTableColumn(genre.name_book));
row.appendChild(createTableColumn(parseFloat(genre.price).toFixed(2)));
row.appendChild(createTableColumn(genre.authors.name));
row.appendChild(createTableColumn(genre.items.name));
// редактировать в модальном окне
row.appendChild(createTableAnchor("fa-pencil", editCallback));
// удаление
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
return row;
}

218
laba3/js/lines.js Normal file
View File

@ -0,0 +1,218 @@
// модуль с логикой
import { hideUpdateModal, showUpdateModal } from "./lines-modal";
import {
createLine, deleteLine, getAllItemTypes, getAllAuthors, 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.genreType.innerHTML = "";
// пустое значение
cntrls.genreType.appendChild(createItemsOption("Выберите значение", "", true));
// цикл по результату ответа от сервера
// используется лямбда-выражение
// (item) => {} аналогично function(item) {}
data.forEach((genre) => {
cntrls.genreType.appendChild(createItemsOption(genre.name, genre.id));
});
}
async function drawAuthorsSelect() {
const data = await getAllAuthors();
cntrls.author.innerHTML = "";
cntrls.author.appendChild(createItemsOption("Выберите значение", "", true));
data.forEach((genre) => {
cntrls.author.appendChild(createItemsOption(genre.name, genre.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((genre, index) => {
cntrls.table.appendChild(
createTableRow(
genre,
index,
// функции передаются в качестве параметра
// это очень удобно, так как аргументы функций доступны только
// в данном месте кода и не передаются в сервисные модули
() => showUpdateModal(genre),
() => removeLine(genre.id),
),
);
});
}
async function addLine(genre, price, name_book, author, image) {
console.info("Try to add item");
// вызов метода REST API для добавления записи
const data = await createLine(genre, price, name_book, author, image);
console.info("Added");
console.info(data);
// загрузка и заполнение table
drawLinesTable();
}
async function editLine(id, genre, author, price, name_book, image) {
console.info("Try to update item");
// вызов метода REST API для обновления записи
const data = await updateLine(id, genre, price, name_book, author, image);
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
drawAuthorsSelect();
drawLinesTable();
// Вызов функции обновления превью изображения при возникновении
// события oncahnge в тэге input с id image
cntrls.image.addEventListener("change", () => updateImagePreview());
// обработчик события нажатия на кнопку для показа модального окна
cntrls.button.addEventListener("click", () => showUpdateModal(null));
// обработчик события отправки формы
// возникает при нажатии на кнопку (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 = "";
// Получение выбранного пользователем изображения в виде 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);
}
// получение id строки для редактирования
// это значение содержится в скрытом input
const currentId = cntrls.lineId.value;
// если значение id не задано,
// то необходимо выполнить добавление записи
// иначе обновление записи
if (!currentId) {
await addLine(
cntrls.genreType.value,
cntrls.price.value,
cntrls.name_book.value,
cntrls.author.value,
imageBase64,
);
} else {
await editLine(
currentId,
cntrls.genreType.value,
cntrls.price.value,
cntrls.name_book.value,
cntrls.author.value,
imageBase64,
);
}
// после выполнения добавления/обновления модальное окно скрывается
hideUpdateModal();
});
}

25
laba3/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
laba3/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/*"
]
}

4627
laba3/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

26
laba3/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"
}
}

22
laba3/vite.config.js Normal file
View File

@ -0,0 +1,22 @@
import { resolve } from "path";
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from "vite";
export default defineConfig({
build: {
sourcemap: true,
emptyOutDir: true,
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
page2: resolve(__dirname, "Admin.html"),
page3: resolve(__dirname, "Basket.html"),
page4: resolve(__dirname, "Books.html"),
page5: resolve(__dirname, "Contact.html"),
page6: resolve(__dirname, "Register.html"),
page7: resolve(__dirname, "Sign_in.html"),
page8: resolve(__dirname, "Tabel.html"),
},
},
},
});