puzzle/views/login.ejs
n0rdye 5133931122 modified: index.js
modified:   object.js
	modified:   project.js
	new file:   public/img/background/photo_2023-06-06_08-53-47 1.png
	new file:   public/img/icon/copy.svg
	new file:   public/img/icon/download.svg
	new file:   public/img/icon/edit.svg
	new file:   public/img/icon/save.svg
	new file:   public/img/icon/trash.svg
	new file:   public/img/new_proj.png
	new file:   public/img/ok.svg
	new file:   public/img/telegram.svg
	new file:   public/img/vk.svg
	new file:   public/img/youtube.svg
	new file:   "public/img/\320\243\320\274\320\275\320\270\321\207\320\272\320\260 \320\273\320\276\320\263\320\276 \321\201 \320\276\320\261\320\262\320\276\320\264\320\272\320\276\320\271-02 1.png"
	modified:   public/lib/fn.js
	modified:   public/lib/inter.js
	modified:   user.js
	modified:   views/admin.ejs
	modified:   views/header.ejs
	new file:   views/load.ejs
	modified:   views/login.ejs
	modified:   views/main.ejs
	new file:   views/old/project.ejs
	modified:   views/project.ejs
	modified:   views/static/end.ejs
	modified:   views/static/start.ejs
2023-08-01 20:20:43 +05:00

171 lines
5.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%- include('./static/start.ejs',{name:'login',async: true}) %>
<%- include('./load.ejs') %>
<style>
body{
/* width: 1920px;
height: 1080px; */
padding: 0%;
margin: 0%;
background-image: url("/img/background/photo_2023-06-06_08-53-47\ 1.png");
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
#login_form{
margin: auto;
background-color: rgba(255, 255, 255, 0.5);
/* width: 680px;
height: 450px; */
width: 52vw;
/* height: 550px; */
height: 55vh;
border-radius: 1.5vw;
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
backdrop-filter: blur(2vh);
}
#inputs{
margin: auto;
/* width: calc(var(--login-inp-w)+20); */
/* background-color: aliceblue; */
}
#login_form div{
margin: auto;
margin-block: 2vh;
}
input{
text-align: center;
}
section{
display: flex;
justify-content: space-around;
width: 100vw;
height: 100vh;
}
.login-inp input{
/* padding-block: 20px;
padding-inline: 40px; */
height: var(--login-inp-h);
width: calc(var(--login-inp-w));
border: 0.1vh solid #505050;
margin: auto;
border-radius: 1.2vh;
}
.login-inp{
height: var(--login-inp-h);
width: calc(var(--login-inp-w)*1.03);
/* margin: auto; */
}
.pass-inp input{
/* padding-block: 5px;
padding-inline: 20px; */
height: var(--login-inp-h);
width: var(--login-inp-w);
border: 0.1vh solid #505050;
border-radius: 1.2vh;
}
.pass-inp{
height: var(--login-inp-h);
width: calc(var(--login-inp-w)*1.03);
}
.login-btn input{
height: var(--login-inp-h);
width: calc(var(--login-inp-w)/2);
border: 0.1vh;
box-shadow: 0px 4px 4px 0px #00000040;
border-radius: 1.2vh;
}
.login-btn{
height: var(--login-inp-h);
width: calc(var(--login-inp-w)/2);
}
#logo{
margin: auto;
/* width: 216px;
height: 144.27px; */
width: 12vw;
height: 12vh;
display: flex;
justify-content: space-around;
}
#helps button{
background-color: transparent;
border: 0px;
}
#helps{
display: flex;
justify-content: space-evenly;
padding-top: 2.4vh;
}
@media (max-width: 900px) {
#helps{
display: grid;
}
}
/* #logo img{
width: 50%;
} */
</style>
<!-- <img id="logo_img_sec" style="width: 12vw; height: 12vh;" src="/img/Умничка лого с обводкой-02 1.png" alt=""> -->
<section>
<form action="#" id="login_form">
<div id="logo"></div>
<div id="inputs">
<div class="login-inp">
<input name="login" type="text" id="login" placeholder="Логин">
</div>
<div class="pass-inp">
<input name="pass" type="password" id="pass" placeholder="Пароль">
</div>
<div class="login-btn" style="display: flex;justify-content: space-around;">
<input type="submit" id="log_btn" onclick="log()" value="Войти">
</div>
</div>
<div id="helps"><button>Восстановить пароль</button><button>Запросить доступ</button></div>
</form>
</section>
<!-- <input type="submit" value="" hidden> -->
<div id="res"></div>
<script>
loaded_pos.y = "30.5%";
loaded_pos.x = "50%";
loaded_pos.w = "12vw";
loaded();
// console.log($.cookie("uuid"));
// log_by_sid();
// let logo = document.getElementById("logo_img");
// logo.style.transform = 'translate(-40vw,-20vh)';
// logo.style.position = "absolute"
function log(){
const login = CryptoJS.AES.encrypt(document.getElementById('login').value,$.cookie("sid")).toString();
const pass = CryptoJS.AES.encrypt(document.getElementById('pass').value,$.cookie("sid")).toString();
const sid = $.cookie("sid");
if(login!=""&&pass!=""){
$.post( "/back_login", { login:login,pass:pass,sid:sid })
.done(function( res ) {
if (res["out"] == "bad"){
console.log(res["err"]);
if (res["err"] == "user" || res["err"] == "pass"){
alert("wrong password or login")
}
}
else{
if(res["out"] == "goto"){
// postForm(res["url"], res["args"]);
loading();
goto(res["url"]);
}
// if(res["out"] == "logged"){
// // postForm(res["url"], res["args"]);
// // document.querySelector("#res").innerHTML = `<p>user already logged in from sid - ${res["sid"]}</p> <br> <button onclick="$.cookie('sid','${res["sid"]}');clear_ck();">log him out</button>`;
// }
}
});
}
}
</script>
<%- include('./static/end.ejs') %>