разработана аутентификация и регистрация аккаунта

This commit is contained in:
2023-03-08 21:43:33 +10:00
parent 0d6ceef0f9
commit 87bd15640a
24 changed files with 1082 additions and 1353 deletions

View File

@@ -19,7 +19,14 @@ main {
align-items: unset;
}
div.column {
display: flex;
flex-direction: column;
gap: 20px;
}
section.panel {
--display : flex;
z-index : 1000;
width : 400px;
position : absolute;
@@ -27,6 +34,10 @@ section.panel {
flex-direction: column;
}
div.column>section.panel {
position : unset;
}
section.panel.medium {
width: 300px;
}
@@ -43,7 +54,6 @@ section.panel#classic {
margin-left: 570px;
}
section.panel>section.body>ul {
margin: 0 5%;
padding: 0;
@@ -61,6 +71,34 @@ section.panel>section.body>ul>li {
animation-fill-mode : forwards;
animation-timing-function: cubic-bezier(.47,0,.74,.71);
}
section.panel>section.body>dl {
margin: 0;
display: flex;
flex-direction: column;
gap: 4px;
}
section.panel>section.body>dl>* {
word-break: break-word;
animation-duration : .35s;
animation-name : uprise;
animation-fill-mode : forwards;
animation-timing-function: cubic-bezier(.47,0,.74,.71);
}
section.panel>section.body>dl>dt {
margin-left: 20px;
display: none;
font-size: 0.9rem;
font-weight: bold;
}
section.panel>section.body>dl>dd {
margin-left: unset;
font-size: 0.8rem;
}
section.panel>section.header {
z-index : 1000;
height : 50px;

View File

@@ -21,3 +21,44 @@
filter: blur(0px);
}
}
@keyframes window-vertical-open {
0% {
height: 0;
opacity: 0;
}
100% {
height: var(--height, inherit);
opacity: var(--opacity, 1);
}
}
@keyframes window-vertical-close {
0% {
height: var(--height, inherit);
opacity: var(--opacity, 1);
}
100% {
height: 0;
opacity: 0;
}
}
.animation.window:not(.hidden, .horizontal) {
overflow: hidden;
animation-duration : .1s;
animation-name : window-vertical-open;
animation-fill-mode : forwards;
animation-timing-function: ease-in;
}
.animation.window.hidden:not(.horizontal) {
overflow: hidden;
animation-duration : .05s;
animation-name : window-vertical-close;
animation-fill-mode : forwards;
animation-timing-function: ease-out;
}

View File

@@ -1,5 +1,3 @@
@import url('/fonts/commissioner.ttf');
@media (prefers-color-scheme: light) {
:root {
--background-above-1 : #fff;
@@ -81,9 +79,8 @@
user-select : none;
}
.hidden {
.hidden:not(.animation) {
display: none !important;
opacity: 0;
}
* {

View File

@@ -39,11 +39,7 @@ $router->write('/session/password', 'session', 'password', 'POST');
$router->write('/session/invite', 'session', 'invite', 'POST');
// Инициализация ядра
$core = new core(namespace: __NAMESPACE__, router: $router);
// Инициализация ядер
$core->controller = new controller;
$core->model = new model;
$core = new core(namespace: __NAMESPACE__, router: $router, controller: new controller(false), model: new model(false));
// Обработка запроса
echo $core->start();

View File

@@ -9,6 +9,7 @@ class password {
* @return {object} {(string) password, (array) errors}
*/
static async generate(length = 12, type = "classic") {
// Запрос к серверу
return await fetch("https://account.mirzaev.sexy/api/generate/password", {
method: "POST",
headers: {

View File

@@ -6,12 +6,12 @@ class session {
*
* Записывает входной псевдоним в сессию, а так же проверяет существование аккаунта с ним
*
* @param {string} login Входной
* @param {string} login Входной псевдоним
*
* @return {object} {(bool) exist, (array) errors}
*/
static async login(login) {
// Запрос
// Запрос к серверу
return await fetch('https://account.mirzaev.sexy/session/login', {
method: 'POST',
headers: {
@@ -32,16 +32,16 @@ class session {
*
* @param {string} password Пароль
*
* @return {object} {(bool) verify, (array) errors}
* @return {object} {(bool) verify, (bool) account, (array) errors}
*/
static async password(password) {
// Запрос
// Запрос к серверу
return await fetch('https://account.mirzaev.sexy/session/password', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `password=${password}&return=verify,errors`
body: `password=${password}&remember=1&return=verify,account,errors`
})
.then((response) => response.json())
.then((data) => {
@@ -59,7 +59,7 @@ class session {
* @return {object} {(bool) exist, (array) from, (array) errors}
*/
static async invite(invite) {
// Запрос
// Запрос к серверу
return await fetch("https://account.mirzaev.sexy/session/invite", {
method: "POST",
headers: {
@@ -69,6 +69,16 @@ class session {
})
.then((response) => response.json())
.then((data) => {
if (data.exist === false) {
// Не найдено приглашение
// Инициализация категории ошибок
if (typeof data.errors.session === 'undefined') data.errors.session = [];
// Запись ошибки
data.errors.session.push('Не найдено приглашение');
}
return data;
});
}