Лабораторная работа №2. Верстка страниц (bootstrap)

This commit is contained in:
dvdice 2024-06-12 21:06:08 +04:00
parent 1112b8c02f
commit 6363d0e822
10 changed files with 1776 additions and 0 deletions

0
css/custom.css Normal file
View File

88
html/about.html Normal file
View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Details</title>
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/css/custom.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../index.html">Book Store</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<form class="d-flex mx-auto w-50">
<input class="form-control me-2" type="search" placeholder="Какая Ваша любимая книга? :)"
aria-label="Search" width="100px">
<button class="btn btn-outline-light" type="submit">Поиск</button>
</form>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="book-list.html">Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">О нас</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cart.html" style="display: inline-block;">Корзина</a>
<!-- <img src="/src/icons/cart.svg" width="30px"> -->
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<section class="about-page py-5">
<div class="container">
<h1 class="display-4 mb-4">О Book store</h1>
<div class="row">
<div class="col-md-6">
<img src="https://via.placeholder.com/500x300" class="img-fluid" alt="О нас">
</div>
<div class="col-md-6">
<h2 class="mb-4">Наша история</h2>
<p class="lead mb-4">Book store - это ведущий онлайн-магазин, предлагающий широкий выбор
книг для всех ваших потребностей в чтении. Мы страстно любим книги и верим в силу знания и
воображения.</p>
<h2 class="mb-4">Наша миссия</h2>
<p class="lead mb-4">Наша миссия - обеспечить доступ к широкому выбору книг по доступным ценам.
Мы стараемся обеспечить исключительный уровень клиентского сервиса и обеспечить безупречный
процесс покупки для наших клиентов.</p>
<h2 class="mb-4">Наша команда</h2>
<p class="lead mb-4">Наша команда состоит из страстных любителей книг, которые работают без
устали, чтобы собрать лучший выбор книг и обеспечить отличный клиентский сервис. Мы страстно
любим книги и верим в трансформационную силу чтения.</p>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; 2023 Book Store. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="text-white mr-3">Privacy Policy</a>
<a href="#" class="text-white">Terms of Service</a>
</div>
</div>
</div>
</footer>
<script src="js/script.js"></script>
</body>
</html>

84
html/book-details.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">
<title>Book Details</title>
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/css/custom.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../index.html">Book Store</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<form class="d-flex mx-auto w-50">
<input class="form-control me-2" type="search" placeholder="Какая Ваша любимая книга? :)" aria-label="Search" width="100px">
<button class="btn btn-outline-light" type="submit">Поиск</button>
</form>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="book-list.html">Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">О нас</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cart.html" style="display: inline-block;">Корзина</a>
<!-- <img src="/src/icons/cart.svg" width="30px"> -->
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<section class="book-page py-5">
<div class="container">
<h1 class="display-4 mb-4">Информация о книге</h1>
<div class="row">
<div class="col-md-4">
<img src="https://via.placeholder.com/300x200" class="img-fluid" alt="Book Cover">
</div>
<div class="col-md-8">
<h2 class="mb-4">Война и мир</h2>
<p class="lead mb-4">/описание/</p>
<ul class="list-unstyled mb-4">
<li><strong>Автор:</strong> Лев Толстой</li>
<li><strong>Цена:</strong> $10.99</li>
<li><strong>Количество страниц:</strong> 200</li>
<li><strong>Год публикации:</strong> 2020</li>
</ul>
<button class="btn btn-primary btn-lg">Добавить в корзину</button>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; 2024 Book Store. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="text-white mr-3">Privacy Policy</a>
<a href="#" class="text-white">Terms of Service</a>
</div>
</div>
</div>
</footer>
<script src="../js/script.js"></script>
</body>
</html>

169
html/book-list.html Normal file
View File

@ -0,0 +1,169 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Catalog</title>
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="../css/custom.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../index.html">Book Store</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<form class="d-flex mx-auto w-50">
<input class="form-control me-2" type="search" placeholder="Какая Ваша любимая книга? :)" aria-label="Search" width="100px">
<button class="btn btn-outline-light" type="submit">Поиск</button>
</form>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="catalog.html">Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link" href="checkout.html">О нас</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cart.html" style="display: inline-block;">Корзина</a>
<!-- <img src="/src/icons/cart.svg" width="30px"> -->
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<section class="catalog-page py-5">
<div class="container">
<h1 class="display-4 mb-4">Каталог</h1>
<div class="row">
<div class="col-md-3">
<h2 class="mb-4">Фильтры</h2>
<form>
<div class="mb-3">
<label for="category" class="form-label">Категория</label>
<select class="form-select" id="category">
<option value="all">Все</option>
<option value="sci-fiction">Научная фантастика</option>
<option value="detective">Детективы</option>
<option value="biography">Биография</option>
</select>
</div>
<div class="mb-3">
<label for="price-range" class="form-label">Диапазон цены</label>
<input type="range" class="form-range" id="price-range" min="0" max="100" step="10">
от <input type="number" class="" id="price-range" min="0" step="10">
\n до <input type="number" class="" id="price-range" min="0" step="10">
</div>
<button type="submit" class="btn btn-primary">Сохранить фильтры</button>
</form>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top"
alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Название Книги</h5>
<p class="card-text">Имя Автора</p>
<p class="card-text">$10.99</p>
<a href="book.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; 2024 Book Store. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="text-white mr-3">Privacy Policy</a>
<a href="#" class="text-white">Terms of Service</a>
</div>
</div>
</div>
</footer>
<script src="../js/script.js"></script>
</body>
</html>

112
html/cart.html Normal file
View File

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart Page</title>
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/css/custom.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../index.html">Book Store</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<form class="d-flex mx-auto w-50">
<input class="form-control me-2" type="search" placeholder="Какая Ваша любимая книга? :)" aria-label="Search" width="100px">
<button class="btn btn-outline-light" type="submit">Поиск</button>
</form>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="catalog.html">Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">О нас</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cart.html" style="display: inline-block;">Корзина</a>
<!-- <img src="/src/icons/cart.svg" width="30px"> -->
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<section class="cart-page py-5">
<div class="container">
<h1 class="display-4 mb-4">Товары в корзине</h1>
<div class="row">
<div class="col-md-8">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Название Книги</th>
<th>Автор</th>
<th>Цена</th>
<th>Количество</th>
<th>Удалить</th>
</tr>
</thead>
<tbody>
<tr>
<td>Название Книги 1</td>
<td>Автор 1</td>
<td>$10.99</td>
<td>
<input type="number" value="1" class="form-control">
</td>
<td>
<button class="btn btn-danger btn-sm">Remove</button>
</td>
</tr>
<tr>
<td>Название Книги 2</td>
<td>Автор 2</td>
<td>$12.99</td>
<td>
<input type="number" value="2" class="form-control">
</td>
<td>
<button class="btn btn-danger btn-sm">Remove</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-4">
<h2 class="mb-4">Итого</h2>
<p class="lead mb-4">К оплате: $23.98</p>
<button class="btn btn-primary btn-lg">Оформить заказ</button>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; 2024 Book Store. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="text-white mr-3">Privacy Policy</a>
<a href="#" class="text-white">Terms of Service</a>
</div>
</div>
</div>
</footer>
<script src="../js/script.js"></script>
</body>
</html>

108
index.html Normal file
View File

@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Store</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/css/custom.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="index.html">Book Store</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<form class="d-flex mx-auto w-50">
<input class="form-control me-2" type="search" placeholder="Какая Ваша любимая книга? :)" aria-label="Search" width="100px">
<button class="btn btn-outline-light" type="submit">Поиск</button>
</form>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="html/book-list.html">Каталог</a>
</li>
<li class="nav-item">
<a class="nav-link" href="html/about.html">О нас</a>
</li>
<li class="nav-item">
<a class="nav-link" href="html/cart.html" style="display: inline-block;">Корзина</a>
<!-- <img src="/src/icons/cart.svg" width="30px"> -->
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<section class="hero py-5">
<div class="container">
<h1 class="display-4 mb-4">Приветствуем на Book Store!</h1>
<p class="lead mb-4">На нашем сайте вы найдете множество книг на любой вкус :)</p>
<a href="/html/book-list.html" class="btn btn-primary btn-lg">Перейти в каталог</a>
</div>
</section>
<section class="featured-books py-5">
<div class="container">
<h2 class="mb-4">Хиты этого месяца</h2>
<div class="row">
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top" alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Война и мир</h5>
<p class="card-text">Лев Толстой</p>
<a href="html/book-details.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top" alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Война и мир</h5>
<p class="card-text">Лев Толстой</p>
<a href="html/book-details.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
<div class="col-md-4 mb-4">
<div class="card">
<img src="https://via.placeholder.com/300x200" class="card-img-top" alt="Book Cover">
<div class="card-body">
<h5 class="card-title">Война и мир</h5>
<p class="card-text">Лев Толстой</p>
<a href="html/book-details.html" class="btn btn-primary">Карточка товара</a>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; 2024 Book Store. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="text-white mr-3">Privacy Policy</a>
<a href="#" class="text-white">Terms of Service</a>
</div>
</div>
</div>
</footer>
<script src="js/script.js"></script>
</body>
</html>

0
js/script.js Normal file
View File

1194
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "book-store",
"version": "1.0.0",
"description": "Online book store",
"main": "index.html",
"scripts": {
"start": "http-server -p 3000 ./",
"build": "vite build"
},
"dependencies": {
"bootstrap": "^5.2.3"
},
"devDependencies": {
"vite": "^4.1.4",
"http-server": "14.1.1 "
}
}

4
src/icons/cart.svg Normal file
View File

@ -0,0 +1,4 @@
<?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 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.29977 5H21L19 12H7.37671M20 16H8L6 3H3M9 20C9 20.5523 8.55228 21 8 21C7.44772 21 7 20.5523 7 20C7 19.4477 7.44772 19 8 19C8.55228 19 9 19.4477 9 20ZM20 20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20C18 19.4477 18.4477 19 19 19C19.5523 19 20 19.4477 20 20Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 591 B