This commit is contained in:
root
2022-10-13 07:07:04 +03:00
parent 30fd8f0ec3
commit 6d6712e9d2
21 changed files with 590 additions and 98 deletions

View File

@@ -68,6 +68,7 @@
#authentication>div#account>p>b {
margin-right: 8px;
font-weight: 900;
}
#authentication>div#account>p>span {

View File

@@ -26,6 +26,50 @@ main>section#books>article.book {
margin-right: 20px;
display: flex;
flex-direction: column;
border-radius: 3px;
overflow: hidden;
background: #b38b8b;
transition: .1s ease-in-out;
font-weight: 900;
}
main>section#books>article.book:hover {
scale: 1.05;
z-index: 1000;
}
main>section#books>article.book>button {
position: absolute;
display: flex;
top: 10px;
right: 10px;
width: 25px;
height: 25px;
flex-direction: column;
justify-content: center;
font-size: 110%;
opacity: 0;
pointer-events: none;
border-radius: 3px;
border: none;
color: #ff5757;
background-color: rgba(0, 0, 0, .5);
}
main>section#books>article.book:hover>button {
opacity: 1;
pointer-events: all;
transition: .2s ease-in-out;
}
main>section#books>article.book>button:hover {
color: #ff6b6b;
background-color: rgba(0, 0, 0, .4);
}
main>section#books>article.book>button:active {
color: #e04d4d;
background-color: rgba(0, 0, 0, .6);
}
main>section#books>article.book:nth-child(3n) {
@@ -42,7 +86,8 @@ main>section#books>article.book>img {
height: 100%;
object-fit: cover;
object-position: right;
overflow: hidden;
text-align: center;
/* overflow: hidden; */
/* clip-path: polygon(5px calc(100% - 5px), calc(100% - 5px) calc(100% - 5px), calc(100% - 5px) 5px, 5px 5px); */
}
@@ -58,8 +103,16 @@ main>section#books>article.book>h4 {
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
color: #e8e8e8;
background-color: rgba(0, 0, 0, .5);
}
main>section#books>article.book>h4:hover {
color: #fff;
background: rgba(0, 0, 0, 50%);
}
main>section#books>article.book>h4:active {
color: #e7e4e4;
}
main>section#books>article.book>p {
@@ -96,11 +149,35 @@ main>section#book>nav>ul>li:only-of-type {
margin-right: auto;
}
main>section#book>nav>ul>li.previous {
margin-left: auto;
main>section#book>nav>ul>li {
margin-right: 15px;
}
main>section#book>nav>ul>li:first-of-type,
main>section#book>nav>ul>li.previous {
margin-left: auto;
}
main>section#book>nav>ul>li:last-of-type,
main>section#book>nav>ul>li.next {
margin-right: auto;
}
main>section#book>nav>ul>li.icon {
display: flex;
}
main>section#book>nav>ul>li.icon>i {
height: 1rem;
margin: auto;
color: #9b3d10;
}
main>section#book>nav>ul>li.icon>i:hover {
color: #bd4f1c;
}
main>section#book>nav>ul>li.icon>i:active {
color: #813410;
}

View File

@@ -1,6 +1,15 @@
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:wght@200;400;500;600;700&display=swap');
* {
font-family: "open sans";
font-family: 'IBM Plex Serif', serif;
text-decoration: none;
transition: .2s ease-out;
}
button,
*[type="button"] {
cursor: pointer;
font-weight: 900;
}
::selection,
@@ -12,7 +21,8 @@ body {
margin: 0;
display: grid;
grid-template-rows: auto auto 150px;
grid-template-columns: minmax(100px, auto) 300px minmax(500px, auto) minmax(100px, auto);;
/* grid-template-columns: minmax(100px, auto) 300px minmax(500px, auto) minmax(100px, auto); */
grid-template-columns: minmax(100px, auto) 300px minmax(500px, 1000px) minmax(100px, auto);
background-color: #e5ddd1;
}
@@ -112,6 +122,7 @@ header>.menu>nav>.link {
margin-right: 50px;
text-decoration: none;
color: #e5ddd1;
font-weight: 900;
}
header>.menu>nav>.link:last-child {

View File

@@ -0,0 +1,7 @@
main>section#page>article *:first-child {
margin-top: 0;
}
main>section#page>article *:last-child {
margin-bottom: 0;
}

View File

@@ -8,12 +8,16 @@ use mirzaev\minimal\core;
use mirzaev\minimal\router;
define('VIEWS', realpath('..' . DIRECTORY_SEPARATOR . 'views'));
define('STORAGE', '..' . DIRECTORY_SEPARATOR . 'storage');
define('STORAGE', realpath('..' . DIRECTORY_SEPARATOR . 'storage'));
define('TYPE', 'mysql');
define('BASE', 'surikovlib');
define('HOST', '127.0.0.1');
define('LOGIN', 'root');
define('PASSWORD', '');
define('PASSWORD', 'sUrikov_topchik_228!');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
// Автозагрузка
require __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
@@ -29,9 +33,14 @@ $router->write('/account/deauthentication', 'accounts', 'deauthentication', 'POS
$router->write('/account/deauthentication', 'accounts', 'deauthentication', 'GET');
$router->write('/books', 'books', 'index', 'GET');
$router->write('/books/$id', 'books', 'index', 'GET');
$router->write('/books/$id/cover', 'books', 'cover', 'GET');
$router->write('/books/$id/0', 'books', 'cover', 'GET');
$router->write('/books/write', 'books', 'write', 'POST');
$router->write('/books/$id/$page', 'books', 'index', 'GET');
$router->write('/books/$id/$page/rotate', 'books', 'rotate', 'POST');
$router->write('/books/$id/delete', 'books', 'delete', 'POST');
$router->write('/storage/books/$id/$file', 'books', 'read', 'GET');
$router->write('/storage/books/write', 'books', 'write', 'POST');
$router->write('/kemenov', 'kemenov', 'index', 'GET');
$router->write('/surikov', 'surikov', 'index', 'GET');
$router->write('/contacts', 'contacts', 'index', 'GET');
// Инициализация ядра
$core = new core(namespace: __NAMESPACE__, router: $router);

View File

@@ -0,0 +1,25 @@
'use strict';
function remove(id, element = null) {
if (typeof id === 'number') {
// Получены входные параметры
// Запрос
fetch(`https://surikovlib.ru/books/${id}/delete`, {
method: 'POST'
}).then(
(value) => {
return value.json();
}
).then(
(response) => {
if (response.status === true) {
// Удалена книга
// Удаление элемента
if (typeof element === 'object') element.remove();
}
}
);
}
}

View File

@@ -0,0 +1,24 @@
'use strict';
function rotate(id, page, reload = false) {
if (typeof id === 'number' && typeof page === 'number') {
// Получены входные параметры
// Запрос
fetch(`https://surikovlib.ru/books/${id}/${page}/rotate`, {
method: 'POST'
}).then(
(value) => {
return value.json();
}
).then(
(response) => {
if (response.status === true) {
// Перевёрнута страница
if (reload === true) location.reload();
}
}
);
}
}