Browse Source

Merge branch 'ohnoyoutriggeredmytrapcard'

master
johan 3 years ago
parent
commit
3d7dde29dc
  1. 6
      static/css/main.css
  2. 15
      static/js/main.js

6
static/css/main.css

@ -73,6 +73,8 @@ a:hover {
background: url("../img/background-letter.jpg"); background: url("../img/background-letter.jpg");
background-size: cover; background-size: cover;
background-position: right; background-position: right;
transition: 1.5s transform 0s ease-out;
} }
#logo { #logo {
@ -138,6 +140,10 @@ a:hover {
width: 50vw; width: 50vw;
} }
.away {
transform: translate(-200vw, -100vh) rotate(-10deg);
}
.form-group { .form-group {
margin: 10px; margin: 10px;
width: 100%; width: 100%;

15
static/js/main.js

@ -11,11 +11,18 @@ window.onpopstate = history.onpushstate = function(e) {
history.pushState("#main-page", "", "") history.pushState("#main-page", "", "")
function show_page(id, historyPush) { function show_page(id, historyPush) {
//si le z-index de la nouvelle page est inférieur on fait un transi 'forward' sinon 'backward'
for(i in page) { for(i in page) {
$(page[i]).hide(); $(page[i]).hide().removeClass("away");
} }
$(id).show();
if (!historyPush) { $hs = $(history.state).show();
if(!historyPush)
$hs.addClass('away');
$id = $(id).show();
if(!historyPush) {
history.pushState(id, "", "") history.pushState(id, "", "")
} }
} }
@ -498,7 +505,7 @@ $(window).on("load", function() {
} }
for(i in page) { for(i in page) {
$(page[i]).css('z-index', i); $(page[i]).css('z-index', page.length - i);
} }
/* load timer */ /* load timer */

Loading…
Cancel
Save