Compare commits

..

10 Commits
main ... lab4

92 changed files with 6778 additions and 135 deletions

24
.eslintrc.cjs Normal file
View File

@ -0,0 +1,24 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'airbnb-base',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 12, sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'indent': 'off',
'no-console': 'off',
'arrow-body-style': 'off',
'implicit-arrow-linebreak': 'off',
},
}

146
.gitignore vendored
View File

@ -1,146 +1,24 @@
# ---> Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
node_modules
dist
dist-ssr
*.local
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# ---> VisualStudioCode
# Editor directories and files
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -1,2 +1,29 @@
# Internet_Programming_PIbd-21_Rodionov_I_A
#### Окружение:
- nodejs 18;
- VSCode;
- ESLint плагин для VSCode;
- для отладки необходимы бразузеры Chrome или Edge.
#### Создание пустого проекта:
```commandline
npm create vite@latest ./ -- --template react
```
#### Установка зависимостей:
```commandline
npm install
```
#### Запуск проекта:
```commandline
npm run dev
```
#### Сборка проекта:
```commandline
npm run build
```

16
index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="src/assets/icons/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Читай-комната</title>
</head>
<body>
<div id="root" class="d-flex flex-column min-vh-100 h-100"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

14
jsconfig.json Normal file
View File

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

4344
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

32
package.json Normal file
View File

@ -0,0 +1,32 @@
{
"name": "ip-rodionov",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0",
"bootstrap": "^5.3.2",
"react-bootstrap": "^2.9.1",
"react-bootstrap-icons": "^1.10.3",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"vite": "^4.4.5"
}
}

BIN
png/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

BIN
png/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 KiB

BIN
png/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

BIN
png/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
png/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

3
public/favicon.svg Normal file
View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cart2" viewBox="0 0 16 16">
<path d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l1.25 5h8.22l1.25-5H3.14zM5 13a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm9-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0z"/>
</svg>

After

Width:  |  Height:  |  Size: 463 B

0
src/App.css Normal file
View File

24
src/App.jsx Normal file
View File

@ -0,0 +1,24 @@
import PropTypes from 'prop-types';
import { Container } from 'react-bootstrap';
import { Outlet } from 'react-router-dom';
import './App.css';
import Footer from './components/footer/Footer.jsx';
import Navigation from './components/navigation/Navigation.jsx';
const App = ({ routes }) => {
return (
<>
<Navigation routes={routes}></Navigation>
<Container className="d-flex flex-column justify-content-center flex-grow-1" as="main" fluid="md">
<Outlet />
</Container>
<Footer />
</>
);
};
App.propTypes = {
routes: PropTypes.array,
};
export default App;

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 KiB

BIN
src/assets/icons/card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

BIN
src/assets/icons/check.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

BIN
src/assets/icons/email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
src/assets/icons/fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/icons/line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

BIN
src/assets/icons/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/assets/icons/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src/assets/icons/photo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/assets/icons/skype.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/assets/icons/trash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/assets/icons/vk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

View File

@ -0,0 +1,18 @@
import PropTypes from 'prop-types';
import Desktop from './cartItemDesktop/CartItemDesktop.jsx';
import Mobile from './cartItemMobile/CartItemMobile.jsx';
const CartItem = ({ info }) => {
return (
<>
<Desktop info={info} />
<Mobile info={info} />
</>
);
};
CartItem.propTypes = {
info: PropTypes.object,
};
export default CartItem;

View File

@ -0,0 +1,63 @@
import PropTypes from 'prop-types';
const CartItemDesktop = ({ info }) => {
return (
<>
<div className="col-2 border-top border-black pt-3 d-sm-none">
<div className="block">
<img
src={info.cover}
className="cart-book-cover me-3"
alt="cart-book-cover"
width="88"
height="138"
/>
</div>
</div>
<div className="col-10 pt-3 border-top border-black d-sm-none">
<div className="block ms-4">
<p className="cart-book-description-title mb-2">{info.title}</p>
<p className="cart-book-description-author mb-2">{info.author}</p>
<p className="cart-price mb-2">{info.price}</p>
<div className="d-flex align-items-center">
<button
type="button"
className="button-minus border border-end-0 rounded-start bg-white"
>
</button>
<label className="cart-input-label d-flex">
<input
type="tel"
className="cart-input h-100 w-100 border text-center"
placeholder="1"
/>
</label>
<button
type="button"
className="button-plus border border-start-0 rounded-end bg-white"
>
+
</button>
<div className="flex-grow-1"></div>
<button className="cart-button-remove d-flex align-items-end lh-1 border-0 bg-white pe-0">
<img
src={info.trash}
className="trash-icon"
alt="trash"
width="24"
height="24"
/>
</button>
</div>
</div>
</div>
</>
);
};
CartItemDesktop.propTypes = {
info: PropTypes.object,
};
export default CartItemDesktop;

View File

@ -0,0 +1,70 @@
import PropTypes from 'prop-types';
const CartItemMobile = ({ info }) => {
return (
<>
<div className="col-1 border-top border-black pt-3 d-none d-sm-block">
<div className="block">
<img
src={info.cover}
className="cart-book-cover me-3"
alt="cart-book-cover-1"
width="88"
height="138"
/>
</div>
</div>
<div className="col-6 pt-3 border-top border-black d-none d-sm-block">
<div className="cart-book-description block d-flex flex-column justify-content-start ms-5 ms-lg-4 ms-xl-0 ps-0 ps-sm-2 ps-md-0 ps-xl-3 ps-xxl-0">
<p className="cart-book-description-title mb-2">{info.title}</p>
<p className="cart-book-description-author">{info.author}</p>
</div>
</div>
<div className="col-3 pt-2 border-top border-black d-none d-sm-block">
<div className="block d-flex align-items-start justify-content-end">
<button
type="button"
className="button-minus border border-end-0 rounded-start bg-white"
>
</button>
<label className="cart-input-label">
<input
type="tel"
className="cart-input h-100 w-100 border text-center"
placeholder="1"
/>
</label>
<button
type="button"
className="button-plus border border-start-0 rounded-end bg-white"
>
+
</button>
</div>
</div>
<div className="col-2 pt-3 border-top border-black d-none d-sm-block">
<div className="block d-flex flex-column align-items-end h-100">
<p className="cart-price">{info.price}</p>
<div className="flex-grow-1"></div>
<button className="cart-button-remove d-flex align-items-end lh-1 border-0 bg-white pe-0">
<img
src={info.trash}
className="trash-icon me-2"
alt="trash"
width="24"
height="24"
/>
Удалить
</button>
</div>
</div>
</>
);
};
CartItemMobile.propTypes = {
info: PropTypes.object,
};
export default CartItemMobile;

View File

@ -0,0 +1,39 @@
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
const CatalogBook = ({ description }) => {
return (
<div className="col-sm-6 col-md-4 col-lg-3 mt-4">
<div className="block d-flex flex-column h-100">
<div className="d-flex justify-content-center mb-4">
<Link to={description.destination}>
<img src={description.cover} className="catalog-book-cover" alt="book-cover-catalog-2" width="155" height="245" />
</Link>
</div>
<div className="catalog-book-description d-flex flex-column align-items-start">
<p className="catalog-price mb-3">
{description.price}
</p>
<p className="catalog-book-title mb-3">
{description.title}
</p>
<p className="catalog-author mb-3">
{description.author}
</p>
</div>
<div className="flex-grow-1"></div>
<div className="catalog-btn-checkout-div d-flex justify-content-start">
<button className="catalog-bth-checkout btn rounded-5 px-3">
В корзину
</button>
</div>
</div>
</div>
);
};
CatalogBook.propTypes = {
description: PropTypes.object,
};
export default CatalogBook;

View File

@ -0,0 +1,15 @@
import Form from 'react-bootstrap/Form';
const CatalogSelect = () => {
return (
<Form.Select aria-label="catalogSelect" className="border-black" id="catalog-select">
<option>Сначала популярные</option>
<option value="1">Сначала дешевые</option>
<option value="2">Сначала дорогие</option>
<option value="3">Сначала со скидкой</option>
<option value="4">Сначала новые</option>
</Form.Select>
);
};
export default CatalogSelect;

View File

@ -0,0 +1,53 @@
import { Link } from 'react-router-dom';
import Call from '../../assets/icons/telephone-call.png';
import VK from '../../assets/icons/vk.png';
import YouTube from '../../assets/icons/youtube.png';
import Telegram from '../../assets/icons/telegram.png';
import Odnoklassniki from '../../assets/icons/odnoklassniki.png';
const Footer = () => {
const year = new Date().getFullYear();
return (
<footer className="footer flex-shrink-0">
<div className="container-md" id="footer-container">
<div className="row d-flex align-items-center gy-3 gy-lg-0 gx-0" id="footer-row">
<div className="col-md-6 col-lg-4">
<div className="block d-flex justify-content-center justify-content-md-start" id="footer-copyright">
© И. А. Родионов, {year}.
</div>
</div>
<div className="col-md-6 col-lg-3">
<div className="block d-flex align-items-center justify-content-center justify-content-md-end">
<img src={Call} className="me-2" alt="telephone-call" width="32" height="32" />
<p id="footer-phone-number-text">
+7 927 818-61-60
</p>
</div>
</div>
<div className="col-md-12 col-lg-5 mb-3 mb-lg-0">
<div className="block d-flex align-items-center justify-content-center justify-content-lg-end">
<p className="me-3" id="footer-social-media-text">
Мы в соцсетях:
</p>
<Link to="/" className="me-3">
<img src={VK} alt="vk" width="32" height="32" />
</Link>
<Link to="/" className="me-3">
<img src={YouTube} alt="youtube" width="32" height="32" />
</Link>
<Link to="/" className="me-3">
<img src={Telegram} alt="telegram" width="32" height="32" />
</Link>
<Link to="/">
<img src={Odnoklassniki} alt="odnoklassniki" width="32" height="32" />
</Link>
</div>
</div>
</div>
</div>
</footer>
);
};
export default Footer;

View File

@ -0,0 +1,37 @@
import PropTypes from 'prop-types';
import Book from './mainPageBook/MainPageBook.jsx';
const MainPageRow = ({ title, books }) => {
return (
<div className="row bg-white pb-1 rounded-3 gy-3 my-2">
<div className="col-12 ms-2 mt-1">
<div className="main-page-section-title block d-flex align-items-end">
<img src={title.image} className="me-2" alt="fire" width="25" height="30" id="fire-icon" />
<p className="main-page-section-title-text lh-1 m-0">
{title.name}
</p>
</div>
</div>
{
books.map((book) =>
<Book
key = {book.id}
description = {{
cover: book.cover,
price: book.price,
title: book.title,
author: book.author,
destination: book.destination,
}}
/>)
}
</div>
);
};
MainPageRow.propTypes = {
title: PropTypes.object,
books: PropTypes.array,
};
export default MainPageRow;

View File

@ -0,0 +1,33 @@
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
const MainPageBook = ({ description }) => {
return (
<div className="col-6 col-md-4 col-lg-2">
<div className="block d-flex flex-column">
<div className="d-flex justify-content-center">
<Link to={description.destination}>
<img src={description.cover} className="main-page-book-cover" alt="book-cover-novelties-1" width="100" height="152" />
</Link>
</div>
<div className="d-flex flex-column align-items-center align-items-md-start">
<p className="main-page-price">
{description.price}
</p>
<p className="main-page-book-title">
{description.title}
</p>
<p className="main-page-author">
{description.author}
</p>
</div>
</div>
</div>
);
};
MainPageBook.propTypes = {
description: PropTypes.object,
};
export default MainPageBook;

View File

@ -0,0 +1,59 @@
import PropTypes from 'prop-types';
import { Container, Navbar } from 'react-bootstrap';
import { Link, NavLink } from 'react-router-dom';
import Cart from '../../assets/icons/card.png';
import Logo from '../../assets/icons/logo.png';
const Navigation = ({ routes }) => {
const indexPageLink = routes.filter((route) => route.index === false).shift();
return (
<header className = "w-100 position-sticky top-0 z-3">
<Navbar expand="lg" bg="white" data-bs-theme="white" className="my-nav">
<Container fluid="md">
<Navbar.Brand as={Link} to={indexPageLink?.path ?? '/' } className="me-lg-5 d-flex align-items-center" id="logo">
<img src={Logo} alt="logo" className="me-2" />
Читай-комната
</Navbar.Brand>
<Navbar.Toggle aria-controls='main-navbar' />
<Navbar.Collapse id='main-navbar'>
<ul className="navbar-nav align-items-lg-center justify-content-lg-start w-100">
<li className="header-link nav-item ms-lg-2 me-lg-3">
<NavLink to="/" className="nav-link">Главная</NavLink>
</li>
<li className="header-link nav-item me-lg-3">
<NavLink to="/pageCatalog" className="nav-link">Каталог</NavLink>
</li>
<li className="header-link nav-item me-lg-5" id="header-contacts">
<NavLink to="/pageContacts" className="nav-link">Контакты</NavLink>
</li>
<div className="flex-grow-1 me-lg-4" id="header-search">
<input className="form-control h-25" type="search" placeholder="Я ищу..." aria-label="Search" id="search-bar" />
</div>
<li className="nav-item">
<NavLink to="/pageLogin" className="nav-link">Вход</NavLink>
</li>
<p className="d-none d-lg-block">
/
</p>
<li className="nav-item me-lg-3">
<NavLink to="/pageRegistration" className="nav-link">Регистрация</NavLink>
</li>
<li className="nav-item">
<NavLink to="/pageCart" className="nav-link">
<img src={Cart} alt="cart" width="30" height="35" id="cart-icon" />
</NavLink>
</li>
</ul>
</Navbar.Collapse>
</Container>
</Navbar >
</header>
);
};
Navigation.propTypes = {
routes: PropTypes.array,
};
export default Navigation;

854
src/index.css Normal file
View File

@ -0,0 +1,854 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,800;0,900;1,700&display=swap');
body {
font-family: Montserrat, Arial;
background-color: rgb(238, 236, 236);
}
p {
margin: 0;
}
main {
margin: 4%;
}
.row {
margin: 0;
}
.my-nav {
background-color: rgb(23, 154, 183) !important;
color: white !important;
}
#logo, .nav-link, #catalog-categories-list li a,
#catalog-page-navigation a, #catalog-categories-mobile-list li a,
#password-help a, #login-admin a {
color: inherit;
text-decoration: none;
}
#logo {
font-size: 20px;
font-weight: 800;
}
.nav-link {
font-size: 16px;
font-weight: 600;
}
.my-nav a.active {
font-weight: 900 !important;
text-decoration: underline !important;
text-decoration-skip-ink: none !important;
color: white !important;
}
#cart-icon {
transition: border-color 0.15s;
}
.active-icon #cart-icon {
border-width: 1px;
border-style: solid;
border-color: white;
}
#search-bar {
min-width: 94px;
}
#search-bar::placeholder {
font-size: 14px;
font-weight: 400;
color: rgb(145, 141, 141);
}
.my-nav a {
transition: color 0.15s !important;
}
.my-nav a:hover {
color: rgb(6, 69, 173) !important;
}
#cart-icon:hover {
border-width: 1px;
border-style: solid;
border-color: white;
}
.active-icon #cart-icon:hover {
border-color: rgb(6, 69, 173);
}
.main-page-section-title {
min-height: 32px;
}
.main-page-section-title-text {
font-size: 20px;
font-weight: 700;
}
.main-page-price {
font-size: 14px;
font-weight: 700;
}
.main-page-book-title {
font-size: 11px;
font-weight: 500;
}
.main-page-author {
font-size: 11px;
font-weight: 500;
color: rgb(97, 95, 95);
}
#product-card-order-container {
width: 294px;
}
#product-card-book-name {
font-size: 26px;
font-weight: 600;
}
#product-card-author {
font-size: 16px;
font-weight: 600;
color: rgb(14, 173, 208)
}
#product-card-characteristics {
font-size: 16px;
}
#product-card-characteristics dt {
color: rgb(97, 95, 95);
font-weight: 600 !important;
padding-left: 0;
}
#product-card-characteristics dd {
padding-left: 0;
font-weight: 700;
}
#product-card-text-available {
font-size: 21px;
font-weight: 600;
color: rgb(80, 176, 84);
}
#product-card-price {
font-size: 28px;
font-weight: 600;
}
#product-card-button-add {
font-size: 21px;
font-weight: 600;
color: white;
background-color: rgb(23, 154, 183);
transition: opacity 0.25s;
}
#product-card-button-add:hover {
opacity: 0.85;
}
.product-card-book-description-h {
font-size: 18px;
font-weight: 700;
}
.product-card-book-description-text {
font-size: 18px;
font-weight: 500;
}
#contacts-title {
font-size: 30px;
font-weight: 900;
}
.contacts-item {
font-weight: 900;
}
.contacts-item-main-info {
font-size: 20px;
}
.contacts-item-clarification {
font-size: 16px;
color: rgb(145, 141, 141);
}
#skype-link {
font-size: 20px;
font-weight: 900;
color: rgb(6, 69, 173);
}
#contacts-address {
font-size: 20px;
font-weight: 900;
}
#contacts-address-value {
font-size: 16px;
font-weight: 600;
}
#cart-title {
font-size: 36px;
font-weight: 900;
}
#cart-items-num-text {
font-size: 24px;
font-weight: 900;
}
.cart-button-remove {
font-size: 18px;
font-weight: 700;
color: rgb(145, 141, 141);
transition: color 0.15s;
}
.cart-button-remove:hover {
color: blue;
}
.cart-book-description {
font-weight: 500;
}
.cart-book-description-title {
font-size: 20px;
}
.cart-book-description-author {
font-size: 16px;
color: rgb(145, 141, 141);
}
.button-minus, .button-plus {
font-size: 20px;
font-weight: 600;
width: 32px;
height: 34px;
color: rgb(145, 141, 141);
transition: background-color 0.15s, color 0.15s;
}
.button-minus:hover, .button-plus:hover {
background-color: rgb(114, 187, 5) !important;
color: white;
}
.cart-input-label {
width: 42px;
height: 34px;
}
.cart-input {
font-size: 16px;
font-weight: 900;
border-color: rgb(222, 226, 230) !important;
}
.cart-input::placeholder {
color:black;
}
.cart-price {
font-size: 18px;
font-weight: 700;
}
#cart-final-price {
font-weight: 700;
}
#cart-final-price-text {
font-size: 24px;
}
#cart-final-price-value {
font-size: 20px;
}
#cart-btn-checkout {
font-size: 18px;
font-weight: 700;
background-color: rgb(217, 217, 217);
transition: opacity 0.25s;
}
#cart-btn-checkout:hover {
opacity: 0.85;
}
#catalog-categories, #catalog-categories-mobile {
border-color: rgb(23, 154, 183) !important;
}
#catalog-categories-title, #catalog-categories-mobile-title {
font-weight: 700;
}
#catalog-categories-title {
font-size: 24px;
}
#catalog-categories-list, #catalog-categories-mobile-list {
font-weight: 500;
color:rgb(6, 69, 173) !important;
}
#catalog-categories-list {
font-size: 14px;
}
.active-category, .active-category-mobile {
font-weight: 700;
}
#catalog-categories-mobile-title {
font-size: 48px;
}
#catalog-categories-mobile-list {
font-size: 24px;
}
#catalog-title {
font-size: 40px;
font-weight: 900;
}
#catalog-select {
font-size: 14px;
font-weight: 500;
width: 264px;
height: 35px;
}
.catalog-price {
font-size: 18px;
font-weight: 700;
}
.catalog-book-title,
.catalog-author {
font-size: 12px;
font-weight: 600;
}
.catalog-bth-checkout {
font-size: 14px;
font-weight: 600;
background-color: rgb(217, 217, 217);
transition: background-color 0.15s, color 0.15s;
}
.catalog-bth-checkout:hover {
background-color: rgb(114, 187, 5) !important;
color: white;
}
#catalog-page-navigation {
font-size: 20px;
font-weight: 700;
}
#catalog-selected-page {
color: rgb(80, 176, 84) !important;
}
#catalog-page-navigation a {
transition: color 0.15s;
}
#catalog-page-navigation a:hover {
color: rgb(0, 0, 238) !important;
}
#catalog-section-navigation {
font-size: 16px;
}
#login-input-email, #login-input-password,
#reg-input-name, #reg-input-email, .reg-input-password {
font-size: 16px;
min-width: 165px;
}
#login-title, #reg-title {
font-size: 24px;
font-weight: 900;
}
#login-btn, #reg-btn {
font-size: 16px;
font-weight: 900;
background-color: rgb(6, 69, 173);
transition: opacity 0.25s;
min-width: 160px;
}
#login-btn:hover, #reg-btn:hover {
opacity: 0.85;
}
#password-help, #login-admin {
font-size: 16px;
font-weight: 900;
color: rgb(145, 141, 141);
}
#add-btn {
min-width: 150px;
}
footer {
background-color: rgb(23, 154, 183);
color: white;
min-height: 60px;
}
#footer-container {
min-height: 60px;
}
#footer-row {
min-height: 60px;
}
#footer-copyright {
font-size: 24px;
font-weight: 900;
}
#footer-phone-number-text {
font-size: 20px;
font-weight: 900;
}
#footer-social-media-text {
font-size: 19px;
font-weight: 900;
}
@media (min-width: 992px) and (max-width: 1200px) {
#logo {
margin-right: 25px !important;
}
.header-link {
margin-right: 10px !important;
}
#header-contacts, #header-search {
margin-right: 20px !important;
}
}
@media (min-width: 992px) {
.my-nav {
height: 60px !important;
}
main {
margin: 2%;
}
}
@media (max-width: 1200px) {
#catalog-categories-list {
font-size: 12px;
}
.active-category {
font-size: 11px;
}
#catalog-categories-title {
font-size: 18px;
}
#catalog-title {
font-size: 36px;
}
}
@media (max-width: 992px) {
#catalog-categories-title {
font-size: 16px;
}
#catalog-categories-list {
font-size: 11px;
}
.active-category {
font-size: 10px;
}
#catalog-title {
font-size: 30px;
}
}
@media (max-width: 768px) {
#product-card-characteristics {
display: inline-block;
}
#product-card-characteristics dt,
#product-card-characteristics dd {
text-align: left;
padding-right: 0;
}
}
@media (max-width: 576px) {
.cart-book-cover {
width: 66px;
height: 104px;
}
.cart-button-remove {
font-size: 0 !important;
}
.catalog-book-description, .catalog-btn-checkout-div {
margin-left: 15%;
}
#admin-title {
font-size: 18px !important;
}
}
@media (max-width: 510px) {
#login-input-email, #login-input-password,
#login-btn, #password-help, #login-admin {
font-size: 12px;
}
#reg-input-name, #reg-input-email,
.reg-input-password, #reg-btn {
font-size: 12px;
}
#login-title, #reg-title {
font-size: 20px;
}
}
@media (max-width: 475px) {
#cart-title {
font-size: 30px;
}
#cart-items-num-text, #cart-final-price-text {
font-size: 20px;
}
.cart-book-description-title, #cart-final-price-value {
font-size: 16px;
}
.cart-book-description-author {
font-size: 12px;
}
.cart-price, #cart-btn-checkout,
.cart-input {
font-size: 14px;
}
.button-minus, .button-plus {
font-size: 16px;
width: 26px;
height: 28px;
}
.cart-input-label {
width: 34px;
height: 28px;
}
#catalog-categories-mobile-title {
font-size: 44px;
}
#catalog-categories-mobile-list {
font-size: 18px;
}
#image-preview {
width: 300px;
height: 450px;
}
}
@media (max-width: 400px) {
.main-page-book-title, .main-page-author {
font-size: 0 !important;
}
.main-page-book-cover {
width: 80px;
height: 122px;
}
#footer-copyright {
font-size: 20px !important;
}
#footer-phone-number-text {
font-size: 18px !important;
}
#footer-social-media-text {
font-size: 0 !important;
margin-right: 0 !important;
}
#catalog-section-navigation {
font-size: 12px;
}
#login-btn, #password-help, #login-admin,
.reg-input-password, #reg-btn {
font-size: 16px;
}
#reg-input-name, #reg-input-email,
#login-input-email, #login-input-password {
font-size: 14px;
}
#login-title, #reg-title {
font-size: 20px;
}
}
@media (max-width: 361px) {
#logo {
font-size: 0 !important;
}
.contacts-icon {
width: 55px !important;
height: 55px !important;
}
#contacts-title {
font-size: 22px;
}
.contacts-item-main-info, #skype-link,
#contacts-address {
font-size: 14px;
}
.contacts-item-clarification, #contacts-address-value {
font-size: 12px;
}
#catalog-title {
font-size: 20px;
}
#catalog-select {
font-size: 11px;
width: 164px;
height: 28px;
padding: 5px;
}
#image-preview {
width: 200px;
height: 300px;
}
}
@media (max-width: 335px) {
#cart-title {
font-size: 24px;
}
#cart-items-num-text {
font-size: 14px;
}
.cart-book-description-title, #cart-final-price-value {
font-size: 10px;
}
.cart-book-description-author {
font-size: 8px;
}
#cart-final-price-text {
font-size: 12px;
}
.button-minus, .button-plus {
font-size: 10px;
width: 16px;
height: 18px;
}
.cart-input-label {
width: 22px;
height: 18px;
}
.cart-input, #cart-btn-checkout,
.cart-price {
font-size: 9px;
}
.trash-icon {
width: 16px;
height: 16px;
}
.cart-book-cover {
width: 44px;
height: 69px;
}
}
@media (max-width: 320px) {
#product-card-price {
font-size: 22px !important;
}
#novelty-icon {
width: 74px !important;
height: 25px !important;
}
#discont-icon {
width: 49px !important;
height: 25px !important;
}
.product-card-book-description-h, .product-card-book-description-text,
#product-card-button-add, #product-card-text-available {
font-size: 16px !important;
}
#catalog-section-navigation {
font-size: 11px;
}
#catalog-categories-mobile-title {
font-size: 38px;
}
#catalog-categories-mobile-list {
font-size: 16px;
}
}
@media (max-width: 282px) {
#footer-copyright {
font-size: 14px !important;
}
#footer-phone-number-text {
font-size: 12px !important;
}
#admin-title {
font-size: 16px !important;
}
}
@media (max-width: 272px) {
#fire-icon {
height: 38px;
width: 30px;
}
.catalog-book-description, .catalog-btn-checkout-div {
margin-left: 0;
}
.contacts-icon {
width: 44px !important;
height: 44px !important;
margin-right: 20px !important;
}
#contacts-title {
font-size: 16px;
}
.contacts-item-main-info, #skype-link
#contacts-address {
font-size: 11px;
}
#catalog-title {
font-size: 16px;
}
#catalog-select {
width: 140px;
height: 22px;
padding: 5px;
}
#catalog-select, #contacts-address-value,
.contacts-item-clarification {
font-size: 9px;
}
#catalog-page-navigation {
font-size: 15px;
font-weight: 700;
}
#catalog-section-navigation {
font-size: 11px;
}
#catalog-categories-mobile-title {
font-size: 26px;
}
#catalog-categories-mobile-list {
font-size: 13px;
}
#image-preview {
width: 155px;
height: 235px;
}
}
@media (max-width: 204px) {
#footer-copyright {
font-size: 13px !important;
}
#footer-phone-number-text {
font-size: 11px !important;
}
}

86
src/main.jsx Normal file
View File

@ -0,0 +1,86 @@
import 'bootstrap/dist/css/bootstrap.min.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import App from './App.jsx';
import './index.css';
import ErrorPage from './pages/ErrorPage.jsx';
import PageMain from './pages/PageMain.jsx';
import PageProductСard from './pages/PageProductСard.jsx';
import PageContacts from './pages/PageContacts.jsx';
import PageCatalog from './pages/PageCatalog.jsx';
import PageCatalogMobile from './pages/PageCatalogMobile.jsx';
import PageCart from './pages/PageCart.jsx';
import PageLogin from './pages/PageLogin.jsx';
import PageRegistration from './pages/PageRegistration.jsx';
import PageAdmin from './pages/PageAdmin.jsx';
import PageAddItem from './pages/PageAddItem.jsx';
const routes = [
{
index: true,
path: '/',
element: <PageMain />,
title: 'Главная страница',
},
{
path: '/pageProductСard',
element: <PageProductСard />,
title: 'Карточка товара',
},
{
path: '/pageContacts',
element: <PageContacts />,
title: 'Контакты',
},
{
path: '/pageCatalog',
element: <PageCatalog />,
title: 'Каталог',
},
{
path: '/pageCatalogMobile',
element: <PageCatalogMobile />,
title: 'Каталог',
},
{
path: '/pageCart',
element: <PageCart />,
title: 'Корзина',
},
{
path: '/pageLogin',
element: <PageLogin />,
title: 'Вход на сайт',
},
{
path: '/pageRegistration',
element: <PageRegistration />,
title: 'Регистрация',
},
{
path: '/pageAdmin',
element: <PageAdmin />,
title: 'Панель администратора',
},
{
path: '/pageAddItem',
element: <PageAddItem />,
title: 'Панель администратора',
},
];
const router = createBrowserRouter([
{
path: '/',
element: <App routes={routes} />,
children: routes,
errorElement: <ErrorPage />,
},
]);
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>,
);

19
src/pages/ErrorPage.jsx Normal file
View File

@ -0,0 +1,19 @@
import { Alert, Button, Container } from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
const ErrorPage = () => {
const navigate = useNavigate();
return (
<Container fluid className="p-2 row justify-content-center">
<Container className='col-md-6'>
<Alert variant="danger">
Страница не найдена
</Alert>
<Button className="w-25 mt-2" variant="primary" onClick={() => navigate(-1)}>Назад</Button>
</Container>
</Container>
);
};
export default ErrorPage;

106
src/pages/PageAddItem.jsx Normal file
View File

@ -0,0 +1,106 @@
import { useState } from 'react';
import { Form, Button } from 'react-bootstrap';
const PageAddItem = () => {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
setValidated(true);
};
return (
<>
<div className="row justify-content-center">
<Form className="col-lg-8 col-xl-7 col-xxl-6" noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className="mb-4 mt-5">
<Form.Label>Название книги</Form.Label>
<Form.Control type="text" name="text" id="item-name" required />
<Form.Control.Feedback>Название книги введено</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Название книги не введено</Form.Control.Feedback>
</Form.Group>
<Form.Group className="mb-4">
<Form.Label>Автор</Form.Label>
<Form.Control type="text" name="text" id="item-author" required />
<Form.Control.Feedback>Имя автора введено</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Имя автора не введено</Form.Control.Feedback>
</Form.Group>
<Form.Group className="mb-4">
<Form.Label>Цена</Form.Label>
<Form.Control type="number" name="number" id="price" required />
<Form.Control.Feedback>Цена введена</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Цена не введена</Form.Control.Feedback>
</Form.Group>
<Form.Group className="mb-4">
<Form.Label>Описание книги</Form.Label>
<Form.Control as="textarea" id="item-descrition" rows="3"/>
</Form.Group>
<Form.Group className="mb-4">
<Form.Label>Аннотация</Form.Label>
<Form.Control as="textarea" id="item-annotation" rows="3"/>
</Form.Group>
<p className="mb-3">
Xарактеристики:
</p>
<div className="mb-4 border border-1 border-secondary p-2">
<Form.Group className="mb-3">
<Form.Label>ID товара</Form.Label>
<Form.Control type="number" name="number" id="item-id" required />
<Form.Control.Feedback>ID товара введено</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">ID товара не введено</Form.Control.Feedback>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Издательство</Form.Label>
<Form.Control type="text" name="text" id="item-publisher"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Серия</Form.Label>
<Form.Control type="text" name="text" id="item-series"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Год издания</Form.Label>
<Form.Control type="number" name="number" id="item-publication-year"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Количество страниц</Form.Label>
<Form.Control type="number" name="number" id="item-pages-num"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Размер</Form.Label>
<Form.Control type="text" name="text" id="item-size"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Тип обложки</Form.Label>
<Form.Control type="text" name="text" id="item-cover-type"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Тираж</Form.Label>
<Form.Control type="number" name="number" id="item-circulation"/>
</Form.Group>
<Form.Group className="mb-3">
<Form.Label>Вес, г</Form.Label>
<Form.Control type="number" name="number" id="item-weight"/>
</Form.Group>
</div>
<Form.Group className="mb-4">
<Form.Label>Обложка книги</Form.Label>
<Form.Control type="file" id="item-cover"/>
</Form.Group>
<div className="text-center mb-5">
<Button className="w-50 rounded-5" variant="primary" type="submit" id="add-btn">Добавить товар</Button>
</div>
</Form>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageAddItem;

67
src/pages/PageAdmin.jsx Normal file
View File

@ -0,0 +1,67 @@
import { Link } from 'react-router-dom';
const PageAdmin = () => {
return (
<>
<div className="row gy-3">
<div className="col-12 px-0">
<div className="block d-flex justify-content-center fs-2 fw-bold mb-3 mb-sm-4" id="admin-title">
Панель администратора
</div>
</div>
<div className="col-12 px-0">
<div className="block table-responsive">
<table className="table table-hover table-bordered align-middle">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Название книги</th>
<th scope="col">Автор</th>
<th scope="col">Цена</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody className="table-group-divider">
<tr>
<th scope="row">1</th>
<td>Форсайт</td>
<td>Сергей Лукьяненко</td>
<td>775 </td>
<td><Link to="/pageAddItem" className="btn btn-primary w-100">Редактировать</Link></td>
<td><Link className="btn btn-primary w-100">Удалить</Link></td>
</tr>
<tr>
<th scope="row">2</th>
<td>Колесо времени. Книга 11. Нож сновидений</td>
<td>Роберт Джордан</td>
<td>977 </td>
<td><Link to="/pageAddItem" className="btn btn-primary w-100">Редактировать</Link></td>
<td><Link className="btn btn-primary w-100">Удалить</Link></td>
</tr>
<tr>
<th scope="row">3</th>
<td>Четвертое крыло</td>
<td>Яррос Ребекка</td>
<td>999 </td>
<td><Link to="/pageAddItem" className="btn btn-primary w-100">Редактировать</Link></td>
<td><Link className="btn btn-primary w-100">Удалить</Link></td>
</tr>
</tbody>
</table>
</div>
</div>
<div className="col-12 px-0 mb-2">
<div className="block mb-4">
<Link to="/pageAddItem" className="btn btn-primary">Добавить товар</Link>
</div>
</div>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageAdmin;

82
src/pages/PageCart.jsx Normal file
View File

@ -0,0 +1,82 @@
import Trash from '../assets/icons/trash.png';
import Cover1 from '../assets/book_covers/cart/1.png';
import Cover2 from '../assets/book_covers/cart/2.png';
import Item from '../components/cartItem/CartItem.jsx';
const PageCart = () => {
return (
<>
<div className="row gy-3 mb-1">
<div className="col-12 mb-3 mb-sm-4 mt-0 px-0">
<div
className="block d-flex justify-content-center lh-1"
id="cart-title"
>
Моя корзина
</div>
</div>
<div className="col-8 px-0">
<div
className="block d-flex align-items-end lh-1"
id="cart-items-num-text"
>
В корзине два товара:
</div>
</div>
<div className="col-4 d-flex justify-content-end px-0">
<div className="block align-self-end">
<button className="cart-button-remove d-flex justify-content-end align-items-end lh-1 border-0 bg-white pe-0">
<img
src={Trash}
className="trash-icon me-sm-2"
alt="trash"
width="24"
height="24"
/>
Удалить все
</button>
</div>
</div>
<Item
info={{
title: 'Наследник Каладана',
author: 'Брайан Герберт, Кевин Андерсон',
price: '929 р.',
cover: Cover1,
trash: Trash,
}}
/>
<Item
info={{
title: 'Восхождение фениксов',
author: 'Тянься Гуйюань',
price: '834 р.',
cover: Cover2,
trash: Trash,
}}
/>
<div className="col-12 pt-3 border-top border-black px-0">
<div
className="block d-flex justify-content-end align-items-end lh-1"
id="cart-final-price"
>
<span className="me-4" id="cart-final-price-text">
Итого:
</span>{' '}
<span id="cart-final-price-value">1763 р.</span>
</div>
</div>
<div className="col-12 px-0">
<div className="block d-flex justify-content-end">
<button className="btn rounded-5" id="cart-btn-checkout">
Перейти к оформлению
</button>
</div>
</div>
</div>
{document.body.classList.add('bg-white')}
</>
);
};
export default PageCart;

187
src/pages/PageCatalog.jsx Normal file
View File

@ -0,0 +1,187 @@
import { Link } from 'react-router-dom';
import Select from '../components/catalogSelect/CatalogSelect.jsx';
import Book from '../components/catalogBook/CatalogBook.jsx';
import Cover1 from '../assets/book_covers/catalog/1.png';
import Cover2 from '../assets/book_covers/catalog/2.png';
import Cover3 from '../assets/book_covers/catalog/3.png';
import Cover4 from '../assets/book_covers/catalog/4.png';
import Cover5 from '../assets/book_covers/catalog/5.png';
import Cover6 from '../assets/book_covers/catalog/6.png';
import Cover7 from '../assets/book_covers/catalog/7.png';
import Cover8 from '../assets/book_covers/catalog/8.png';
import Cover9 from '../assets/book_covers/catalog/9.png';
const PageCatalog = () => {
return (
<>
<div className="row gy-3 flex-grow-1">
<div className="col-2 d-none d-md-block ps-0 mt-0 bg-white border border-3" id="catalog-categories">
<div className="block d-flex flex-column justify-content-center p-2 h-100">
<p className="mb-4" id="catalog-categories-title">
Категории
</p>
<ul className="list-unstyled ps-0 mb-4 d-flex flex-column gap-3 flex-grow-1" id="catalog-categories-list">
<li><Link to="/">Книги для подростков</Link></li>
<li><Link to="/">Комиксы</Link></li>
<li><Link to="/">Манга</Link></li>
<li><Link to="/">Эзотерика</Link></li>
<li><Link to="/">Медицина и здоровье</Link></li>
<li><Link to="/">Кулинария</Link></li>
<li><Link to="/">Детские книги</Link></li>
<li className="active-category"><Link to="/pageCatalog">Художественная литература</Link></li>
<li><Link to="/">Дом и хобби</Link></li>
<li><Link to="/">Наука. Техника. IT</Link></li>
<li><Link to="/">Религия и философия</Link></li>
<li><Link to="/">Психология</Link></li>
<li><Link to="/">Искусство</Link></li>
<li><Link to="/">История. Общество</Link></li>
<li><Link to="/">Право</Link></li>
<li><Link to="/">Книги на английском</Link></li>
<li><Link to="/">Новый год</Link></li>
<li><Link to="/">Публицистика</Link></li>
<li><Link to="/">Эксклюзивные товары</Link></li>
<li><Link to="/">Педагогика и воспитание</Link></li>
<li><Link to="/">Литературные премии</Link></li>
<li><Link to="/">Фэнтези</Link></li>
<li><Link to="/">Ужасы. Мистика</Link></li>
<li><Link to="/">Любовный роман</Link></li>
<li><Link to="/">Юмор и сатира</Link></li>
<li><Link to="/">Проза</Link></li>
<li><Link to="/">Боевики и триллеры</Link></li>
<li><Link to="/">Эпос и фольклор</Link></li>
<li><Link to="/">Научная фантастика</Link></li>
<li><Link to="/">Детективы</Link></li>
</ul>
</div>
</div>
<div className="col-12 col-md-10 d-flex flex-column bg-white mt-0 pt-2 pt-lg-5">
<div className="row gy-3">
<div className="col-12 mb-3 mb-lg-5 px-0 d-md-none">
<div className="block d-flex lh-1" id="catalog-section-navigation">
<Link to="/pageCatalogMobile" className="me-2 text-decoration-none">
Каталог
</Link>
<span className="text-secondary me-2"> {'>'} </span>
<Link to="/pageCatalog" className="text-decoration-none">
Художественная литература
</Link>
</div>
</div>
<div className="col-12 mb-3 mb-lg-5 px-0">
<div className="block d-flex justify-content-center lh-1" id="catalog-title">
<div>
Художественная литература
</div>
</div>
</div>
<div className="col-12 mb-3 mb-lg-5 gx-0">
<div className="block">
<Select />
</div>
</div>
<Book
description = {{
cover: Cover1,
price: '593 ₽',
title: 'Граф Аверин. Колдун Российской империи',
author: 'Виктор Дашкевич',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover2,
price: '977 ₽',
title: 'Колесо времени. Книга 11. Нож сновидений',
author: 'Роберт Джордан',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover3,
price: '775 ₽',
title: 'Форсайт',
author: 'Сергей Лукьяненко',
destination: '/pageProductСard',
}}
/>
<Book
description = {{
cover: Cover4,
price: '662 ₽',
title: 'Шолох. Долина Колокольчиков',
author: 'Антонина Крейн',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover5,
price: '594 ₽',
title: 'Скрижаль Исет. Грешные души',
author: 'Мишина Влада',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover6,
price: '2 112 ₽',
title: 'Мир игры Pathologic 2. Хроники второй эпидемии',
author: '',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover7,
price: '1 250 ₽',
title: 'Благословение небожителей. Том 5',
author: 'Тунсю Мосян',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover8,
price: '999 ₽',
title: 'Четвертое крыло',
author: 'Яррос Ребекка',
destination: '/',
}}
/>
<Book
description = {{
cover: Cover9,
price: '519 ₽',
title: 'Волкодав',
author: 'Семенова М.',
destination: '/',
}}
/>
<div className="col-12 mt-5 mt-sm-4 mt-lg-5 mb-2 gx-0">
<div className="block d-flex">
<div className="me-2" id="catalog-page-navigation">
<Link to="/pageCatalog" id="catalog-selected-page">1 </Link>
<Link to="/">2 </Link>
<Link to="/">3 </Link>
<Link to="/">4 </Link>
<Link to="/">5 </Link>
<Link to="/">6 </Link>
<Link to="/"> ....</Link>
<Link to="/"> 2310</Link>
</div>
</div>
</div>
</div>
</div>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageCatalog;

View File

@ -0,0 +1,54 @@
import { Link } from 'react-router-dom';
const PageCatalog = () => {
return (
<>
<div className="row">
<div className="col-12 ps-0 mt-0 bg-white border border-3 border-top-0 border-bottom-0" id="catalog-categories-mobile">
<div className="block d-flex flex-column justify-content-center p-2 h-100">
<p className="mb-4" id="catalog-categories-mobile-title">
Категории
</p>
<ul className="list-unstyled ps-0 mb-4 d-flex flex-column gap-3 flex-grow-1" id="catalog-categories-mobile-list">
<li><Link to="/">Книги для подростков</Link></li>
<li><Link to="/">Комиксы</Link></li>
<li><Link to="/">Манга</Link></li>
<li><Link to="/">Эзотерика</Link></li>
<li><Link to="/">Медицина и здоровье</Link></li>
<li><Link to="/">Кулинария</Link></li>
<li><Link to="/">Детские книги</Link></li>
<li className="active-category-mobile"><Link to="/pageCatalog">Художественная литература</Link></li>
<li><Link to="/">Дом и хобби</Link></li>
<li><Link to="/">Наука. Техника. IT</Link></li>
<li><Link to="/">Религия и философия</Link></li>
<li><Link to="/">Психология</Link></li>
<li><Link to="/">Искусство</Link></li>
<li><Link to="/">История. Общество</Link></li>
<li><Link to="/">Право</Link></li>
<li><Link to="/">Книги на английском</Link></li>
<li><Link to="/">Новый год</Link></li>
<li><Link to="/">Публицистика</Link></li>
<li><Link to="/">Эксклюзивные товары</Link></li>
<li><Link to="/">Педагогика и воспитание</Link></li>
<li><Link to="/">Литературные премии</Link></li>
<li><Link to="/">Фэнтези</Link></li>
<li><Link to="/">Ужасы. Мистика</Link></li>
<li><Link to="/">Любовный роман</Link></li>
<li><Link to="/">Юмор и сатира</Link></li>
<li><Link to="/">Проза</Link></li>
<li><Link to="/">Боевики и триллеры</Link></li>
<li><Link to="/">Эпос и фольклор</Link></li>
<li><Link to="/">Научная фантастика</Link></li>
<li><Link to="/">Детективы</Link></li>
</ul>
</div>
</div>
</div>
{
document.body.classList.remove('bg-white')
}
</>
);
};
export default PageCatalog;

View File

@ -0,0 +1,73 @@
import { Link } from 'react-router-dom';
import Call from '../assets/icons/phone-call.png';
import Email from '../assets/icons/email.png';
import Skype from '../assets/icons/skype.png';
import Map from '../assets/icons/map.png';
const PageContacts = () => {
return (
<>
<div className="row">
<div className="col-lg-5 px-0 me-lg-5">
<div className="block d-flex flex-column align-items-start">
<p className="mb-4 mb-sm-5 lh-1" id="contacts-title">
Контакты
</p>
<div className="contacts-item d-flex mb-5">
<img src={Call} className="contacts-icon me-4" alt="phone-call" width="88" height="88" />
<div className="d-flex flex-column">
<p className="contacts-item-main-info mb-3">
+7 927 818-61-60
</p>
<p className="contacts-item-clarification">
Служба клиентской поддержки
c 8:00 - 22:00 (Мск)
</p>
</div>
</div>
<div className="contacts-item d-flex mb-5">
<img src={Email} className="contacts-icon me-4" alt="email" width="88" height="88" />
<div className="d-flex flex-column justify-content-center">
<p className="contacts-item-main-info mb-3">
readroom@mail.ru
</p>
<p className="contacts-item-clarification">
Электронный адрес компании
</p>
</div>
</div>
<div className="contacts-item d-flex mb-3">
<img src={Skype} className="contacts-icon me-4" alt="skype" width="88" height="88" />
<div className="d-flex flex-column justify-content-center">
<p className="contacts-item-main-info">
Пообщайтесь с сотрудниками по видеосвязи
</p>
</div>
</div>
<Link to="/" className="mb-3 mb-sm-4 text-decoration-none" id="skype-link">
Перейти в Skype
</Link>
<div className="mb-4 mb-sm-5 mt-2 mb-lg-0">
<p className="mb-3" id="contacts-address">
Наш адрес:
</p>
<p id="contacts-address-value">
432064, Россия, г. Ульяновск, проспект Врача Сурова, 2А
</p>
</div>
</div>
</div>
<div className="col px-0 align-self-center">
<div className="block d-flex justify-content-center justify-content-lg-end">
<img src={Map} className="border border-black border-2 img-fluid h-100" alt="map" width="665" height="689" />
</div>
</div>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageContacts;

59
src/pages/PageLogin.jsx Normal file
View File

@ -0,0 +1,59 @@
import { useState } from 'react';
import { Form, Button } from 'react-bootstrap';
import { Link } from 'react-router-dom';
const PageLogin = () => {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
setValidated(true);
};
return (
<>
<div className="row gy-3 justify-content-center">
<div className="col-12 mt-2">
<div className="block d-flex justify-content-center mb-3 mb-sm-4" id="login-title">
Вход на сайт
</div>
</div>
<Form className="col-lg-8 col-xl-7 col-xxl-6 m-0 mt-2 mt-sm-3 d-flex flex-column gap-2" noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="email" name="email" className="w-75 border-black" id="login-input-email" placeholder="Имя пользователя / email" required />
<Form.Control.Feedback>Электронная почта заполнена</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Электронная почта не заполнена</Form.Control.Feedback>
</Form.Group>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="password" name="password" className="w-75 border-black" id="login-input-password" placeholder="Пароль" required />
<Form.Control.Feedback>Пароль заполнен</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Пароль не заполнен</Form.Control.Feedback>
</Form.Group>
<div className="text-center">
<Button className="w-50 rounded-5" variant="primary" type="submit" id="login-btn">Отправить</Button>
</div>
</Form>
<div className="col-12">
<div className="block d-flex justify-content-center my-2 my-sm-3" id="password-help">
<Link to="/">Забыли пароль?</Link>
</div>
</div>
<div className="col-12">
<div className="block d-flex justify-content-center mb-2 mb-sm-3" id="login-admin">
<Link to="/pageAdmin">Админ</Link>
</div>
</div>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageLogin;

102
src/pages/PageMain.jsx Normal file
View File

@ -0,0 +1,102 @@
import Row from '../components/mainPageRow/MainPageRow.jsx';
import Fire from '../assets/icons/fire.png';
import Nothing from '../assets/icons/nothing.png';
import Cover1 from '../assets/book_covers/novelties/1.png';
import Cover2 from '../assets/book_covers/novelties/2.png';
import Cover3 from '../assets/book_covers/novelties/3.png';
import Cover4 from '../assets/book_covers/novelties/4.png';
import Cover5 from '../assets/book_covers/novelties/5.png';
import Cover6 from '../assets/book_covers/novelties/6.png';
import Cover7 from '../assets/book_covers/promotions/1.png';
import Cover8 from '../assets/book_covers/promotions/2.png';
import Cover9 from '../assets/book_covers/promotions/3.png';
import Cover10 from '../assets/book_covers/promotions/4.png';
import Cover11 from '../assets/book_covers/promotions/5.png';
import Cover12 from '../assets/book_covers/promotions/6.png';
import Cover13 from '../assets/book_covers/recommendations/1.png';
import Cover14 from '../assets/book_covers/recommendations/2.png';
import Cover15 from '../assets/book_covers/recommendations/3.png';
import Cover16 from '../assets/book_covers/recommendations/4.png';
import Cover17 from '../assets/book_covers/recommendations/5.png';
import Cover18 from '../assets/book_covers/recommendations/6.png';
const PageMain = () => {
return (
<>
<Row
title = {{ name: 'Горячие новинки', image: Fire }}
books = {[
{
cover: Cover1, price: '932 ₽', title: 'Вавилон. Сокрытая история', author: 'Ребекка Ф. Куанг', destination: '/', id: 1,
},
{
cover: Cover2, price: '775 ₽', title: 'Форсайт', author: 'Сергей Лукьяненко', destination: '/pageProductСard', id: 2,
},
{
cover: Cover3, price: '642 ₽', title: 'Во главе раздора', author: 'Лия Арден', destination: '/', id: 3,
},
{
cover: Cover4, price: '949 ₽', title: 'Путешествие в Элевсин', author: 'Виктор Пелевин', destination: '/', id: 4,
},
{
cover: Cover5, price: '699 ₽', title: 'Восстание клана Чан', author: 'Тянься Гуйюань', destination: '/', id: 5,
},
{
cover: Cover6, price: '551 ₽', title: 'Дебютная постановка. Том 2', author: 'Александра Маринина', destination: '/', id: 6,
},
]}
/>
<Row
title = {{ name: 'Книги по акциям', image: Nothing }}
books = {[
{
cover: Cover7, price: '576 ₽', title: 'Шестерка воронов', author: 'Ли Бардуго', destination: '/', id: 1,
},
{
cover: Cover8, price: '200 ₽', title: 'Портрет Дориана Грея', author: 'Оскар Уальд', destination: '/', id: 2,
},
{
cover: Cover9, price: '768 ₽', title: 'Царство Страха', author: 'Керри Манискалко', destination: '/', id: 3,
},
{
cover: Cover10, price: '162 ₽', title: 'Клуб самоубийц', author: 'Роберт Льюис Стивенсон', destination: '/', id: 4,
},
{
cover: Cover11, price: '600 ₽', title: 'Некромант-одиночка. Новелла. Том 1', author: 'JJJ', destination: '/', id: 5,
},
{
cover: Cover12, price: '711 ₽', title: 'Кристальный пик', author: 'Гор А.', destination: '/', id: 6,
},
]}
/>
<Row
title = {{ name: 'Выбор редакции', image: Nothing }}
books = {[
{
cover: Cover13, price: '1001 ₽', title: 'Испытание', author: 'Трейси Вульф', destination: '/', id: 1,
},
{
cover: Cover14, price: '210 ₽', title: 'Мастер и Маргарита', author: 'Михаил Булгаков', destination: '/', id: 2,
},
{
cover: Cover15, price: '618 ₽', title: 'Песнь Сорокопута', author: 'Фрэнсис Кель', destination: '/', id: 3,
},
{
cover: Cover16, price: '754 ₽', title: 'Кодекс Алеры. Кн. 1. Фурии Кальдерона', author: 'Джим Батчер', destination: '/', id: 4,
},
{
cover: Cover17, price: '711 ₽', title: 'Небесная река', author: 'Деннис Тейлор', destination: '/', id: 5,
},
{
cover: Cover18, price: '699 ₽', title: 'Кузнец магии. Клинок тайн', author: 'Триша Левенселлер', destination: '/', id: 6,
},
]}
/>
{
document.body.classList.remove('bg-white')
}
</>
);
};
export default PageMain;

View File

@ -0,0 +1,134 @@
import Cover from '../assets/book_covers/product_card/cover13d__w410.png';
import Novelty from '../assets/icons/novelty.png';
import Discont from '../assets/icons/discont.png';
import Check from '../assets/icons/check.png';
const PageProductСard = () => {
return (
<>
<div className="row gy-3">
<div className="col-md-6 col-lg-3 mt-0 px-0">
<div className="block d-flex justify-content-center justify-content-md-start">
<img src={Cover} className="img-fluid" alt="book-cover-product-card" width="270" height="416" />
</div>
</div>
<div className="col-md-6 col-lg-5 mt-5 mt-md-0 px-0">
<div className="block d-flex flex-column align-items-center align-items-md-start ms-md-4">
<div className="d-flex align-self-center align-self-md-end align-self-lg-start mb-4">
<img src={Novelty} className="me-5" alt="novelty" width="95" height="32" id="novelty-icon" />
<img src={Discont} alt="discont" width="63" height="32" id="discont-icon" />
</div>
<p className="mb-2" id="product-card-book-name">
Форсайт
</p>
<p className="mb-4" id="product-card-author">
Сергей Лукьяненко
</p>
<dl className="row gx-5 gy-2 text-center text-md-start" id="product-card-characteristics">
<dt className="col-md-6 mt-0">ID товара</dt>
<dd className="col-md-6 mt-0">3001249</dd>
<dt className="col-md-6">Издательство</dt>
<dd className="col-md-6">АСТ</dd>
<dt className="col-md-6">Серия</dt>
<dd className="col-md-6">Книги Сергея Лукьяненко</dd>
<dt className="col-md-6">Год издания</dt>
<dd className="col-md-6">2023</dd>
<dt className="col-md-6">Количество страниц</dt>
<dd className="col-md-6">352</dd>
<dt className="col-md-6">Размер</dt>
<dd className="col-md-6">20.5x13x2</dd>
<dt className="col-md-6">Тип обложки</dt>
<dd className="col-md-6">Твердый переплёт</dd>
<dt className="col-md-6">Тираж</dt>
<dd className="col-md-6">20000</dd>
<dt className="col-md-6">Вес, г</dt>
<dd className="col-md-6">350</dd>
</dl>
</div>
</div>
<div className="col-lg-4 mt-0 px-0 d-none d-lg-block">
<div className="block d-flex flex-column align-items-center align-items-lg-end">
<div className="border border-secondary-subtle rounded-1 p-3" id="product-card-order-container">
<div className="d-flex align-items-center mb-3">
<img src={Check} className="me-4" alt="check" width="24" height="24" />
<p id="product-card-text-available">
В наличии
</p>
</div>
<p className="mb-3" id="product-card-price">
775
</p>
<div>
<button type="button" className="btn rounded-1 p-3" id="product-card-button-add">
Добавить в корзину
</button>
</div>
</div>
</div>
</div>
</div>
<div className="row mt-4 mt-md-0 mb-4">
<div className="col px-0">
<div className="block">
<p className="product-card-book-description-h mb-2">
О товаре
</p>
<p className="product-card-book-description-text">
Новый долгожданный роман от автора бестселлеров «Ночной дозор» и «Черновик».
Увлекательная история о Мире После и мире настоящего, где
5 процентов людей знают о надвигающемся апокалипсисе больше,
чем кто-либо может представить.
</p>
</div>
</div>
</div>
<div className="row gy-3">
<div className="col-12 px-0 mb-4 mb-lg-0">
<div className="block">
<p className="product-card-book-description-h mb-2">
Аннотация
</p>
<p className="product-card-book-description-text">
Людям порой снится прошлое. Иногда хорошее, иногда не очень.
Но что делать, если тебе начинает сниться будущее?
И в нём ничего хорошего нет совсем.
</p>
</div>
</div>
<div className="col px-0 d-lg-none">
<div className="block d-flex flex-column align-items-center border border-secondary-subtle rounded-1 p-3">
<div className="d-flex align-items-center mb-3">
<img src={Check} className="me-4" alt="check" width="24" height="24" />
<p id="product-card-text-available">
В наличии
</p>
</div>
<p className="mb-3" id="product-card-price">
775
</p>
<div>
<button type="button" className="btn rounded-1 p-3" id="product-card-button-add">
Добавить в корзину
</button>
</div>
</div>
</div>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageProductСard;

View File

@ -0,0 +1,58 @@
import { useState } from 'react';
import { Form, Button } from 'react-bootstrap';
const PageRegistration = () => {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
setValidated(true);
};
return (
<>
<div className="row gy-3 justify-content-center">
<div className="col-12 mt-0">
<div className="block d-flex justify-content-center mb-3 mb-sm-4" id="login-title">
Регистрация
</div>
</div>
<Form className="col-lg-8 col-xl-7 col-xxl-6 m-0 mt-2 mt-sm-3 d-flex flex-column gap-2" noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="text" name="text" className="w-75 border-black" id="reg-input-name" placeholder="Имя пользователя" required />
<Form.Control.Feedback>Имя пользователя заполнено</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Имя пользователя не заполнено</Form.Control.Feedback>
</Form.Group>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="email" name="email" className="w-75 border-black" id="reg-input-email" placeholder="Адрес электронной почты" required />
<Form.Control.Feedback>Электронная почта заполнена</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Электронная почта не заполнена</Form.Control.Feedback>
</Form.Group>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="password" name="password" className="reg-input-password w-75 border-black" placeholder="Пароль" required />
<Form.Control.Feedback>Пароль заполнен</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Пароль не заполнен</Form.Control.Feedback>
</Form.Group>
<Form.Group className="d-flex justify-content-center mb-3 mb-sm-4">
<Form.Control type="password" name="password" className="reg-input-password w-75 border-black" placeholder="Подтвердите пароль" required />
<Form.Control.Feedback>Пароль заполнен</Form.Control.Feedback>
<Form.Control.Feedback type="invalid">Пароль не заполнен</Form.Control.Feedback>
</Form.Group>
<div className="text-center mb-3">
<Button className="w-50 rounded-5" variant="primary" type="submit" id="reg-btn">Отправить</Button>
</div>
</Form>
</div>
{
document.body.classList.add('bg-white')
}
</>
);
};
export default PageRegistration;

13
vite.config.js Normal file
View File

@ -0,0 +1,13 @@
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
sourcemap: true,
chunkSizeWarningLimit: 1024,
emptyOutDir: true,
},
});

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.