la blanquette est bonne

This commit is contained in:
johan 2022-12-21 22:20:48 +01:00
parent b6da722513
commit 73a55a95f0
4 changed files with 55 additions and 55 deletions

View file

@ -44,7 +44,6 @@ a {
color: #d75b00;
}
a:hover {
text-decoration: underline;
cursor: pointer;
@ -121,6 +120,7 @@ a:hover {
font-size: 25px;
}
#prank-button:hover{
text-decoration: none;
background: url("../img/circle-hand.png");
background-size: 100% 100%;
}
@ -130,7 +130,7 @@ a:hover {
height: 25px;
}
form {
#login-form {
margin-top: 25vh;
margin-bottom: 10vh;
padding: 0px;
@ -142,7 +142,7 @@ form {
width: 100%;
}
input {
.login-form-control {
width: 100%;
border: none;
border-bottom: 1px solid #d75b00;
@ -151,7 +151,7 @@ input {
padding: 5px;
}
input:focus {
.login-form-control:focus {
outline: none;
border-bottom: 2px solid #923e01;
}
@ -179,12 +179,13 @@ button[type="submit"]:hover {
.bg-full {
display: none;
}
#container {
.container {
margin: 0px;
width: 100%;
top: 0;
border-radius: 0px;
box-shadow: none;
padding: 2vw;
}
#logo {
height: 150px;
@ -203,7 +204,4 @@ button[type="submit"]:hover {
#wrapper{
background: none;
}
#container {
padding: 2vw;
}
}

View file

@ -85,17 +85,17 @@
<div class="container" id="login-page" style="display: none;">
<div class="column-section">
<form id="login-form" method="POST">
<div id="login-form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Nom d'espion" name="login" id="login"/>
<input type="text" class="login-form-control" placeholder="Nom d'espion" name="login" id="login"/>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Mot de passe secret" name="password" id="password" />
<input type="password" class="login-form-control" placeholder="Mot de passe secret" name="password" id="password" />
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Se connecter</button>
<button type="submit" class="btn btn-primary" id="login-button">Se connecter</button>
</div>
</form>
</div>
</div>
<hr/>
<div class="row banner">

View file

@ -23,7 +23,6 @@ function check_if_in_view() {
})
.go();
$element.click(function () {
a.
a.options({speed: 20, lifeLike: false});
});
}
@ -31,6 +30,12 @@ function check_if_in_view() {
});
}
$(window).on("scroll resize", check_if_in_view);
$(window).trigger("scroll");
$("#prank-button").hover(function () { $('.hover-circle').fadeIn(100) }, function(){ $('.hover-circle').fadeOut(100) });
$(window).on("load", function() {
/*let type = new TypeIt("#typed-data", {
@ -43,8 +48,5 @@ $(window).on("load", function() {
$(document).on("click", function() {
type.options({speed: 1});
});*/
$(window).on("scroll resize", check_if_in_view);
$(window).trigger("scroll");
$("#prank-button").hover(function () { $('.hover-circle').fadeIn(100) }, function(){ $('.hover-circle').fadeOut(100) });
});

View file

@ -8,11 +8,47 @@ function show_page(id) {
$(id).show();
}
$("#login-button").click(function (e) {
var data = JSON.stringify({
user: $("#login").val(),
password: $("#password").val()
});
$("#password").val('');
$.ajax({
type: "POST",
url: base_url + "login",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
if(data.success) {
localStorage.setItem("token", data.token);
localStorage.setItem("user", data.user);
show_page('#demande-page');
} else {
}
}
});
});
$("#prank-button").click(function () {
if(localStorage.getItem('token')) {
show_page('#demande-page');
}
else {
show_page('#login-page');
}
});
$(window).on("load", function() {
/* Register the Service Worker */
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./js/sw.js');
navigator.serviceWorker.register('./js/sw.js');
}
/* load timer */
@ -39,41 +75,5 @@ $(window).on("load", function() {
second: '2-digit'
}));
}, 1000);
$("#login-form").submit(function (e) {
e.preventDefault();
var data = JSON.stringify({
user: $("#login").val(),
password: $("#password").val()
});
$.ajax({
type: "POST",
url: base_url + "login",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
if(data.success) {
localStorage.setItem("token", data.token);
localStorage.setItem("user", data.user);
show_page('#demande-page');
} else {
}
}
});
});
$("#prank-button").click(function () {
if(localStorage.getItem('token')) {
show_page('#demande-page');
}
else {
show_page('#login-page');
}
});
});