diff --git a/static/css/main.css b/static/css/main.css
index 18e4ce4..3eed9d0 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -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;
- }
}
diff --git a/static/index.html b/static/index.html
index 05fd927..3798105 100644
--- a/static/index.html
+++ b/static/index.html
@@ -85,17 +85,17 @@
diff --git a/static/js/anim.js b/static/js/anim.js
index 5744db3..4863aa3 100644
--- a/static/js/anim.js
+++ b/static/js/anim.js
@@ -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) });
+
});
\ No newline at end of file
diff --git a/static/js/main.js b/static/js/main.js
index 347057b..77d249f 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -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');
- }
- });
});