Skip to content

Commit

Permalink
Assignation de la fonction de changement de page aux balises anchor d…
Browse files Browse the repository at this point in the history
…éfini
  • Loading branch information
yacineblr committed Sep 21, 2016
2 parents 761000c + 3bd1cc3 commit 1533a20
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 139 deletions.
2 changes: 1 addition & 1 deletion head.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</div>
<div class="gitbuttondiv">
<form action="http://google.com">
<input class="githubbutton" type="submit" value="Fork on Github" />
<button class="githubbutton" type="submit"><i class="fa fa-code-fork" aria-hidden="true"></i> us on Github</button>
</form>
</div>
</div>
Expand Down
48 changes: 37 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
var toggleButton = {

color:["white", "rgb(77, 77, 77)"],
status: false,
status: true,
selectdiv:"",
sidebar: function() {
this.selectdiv = document.querySelector(".sidebar");
Expand Down Expand Up @@ -173,28 +173,54 @@ function changePage(param_url, param_load=null){
$frame.fadeIn();
$('#contenu').fadeOut();
changeUrl(url.toUpperCase(), url)
displayContentHeader("annexe");
break;

default:
// console.log('Switch: Default ', url)
}
}
function displayContentHeader() {
function displayContentHeader(elem) {
var screenWidth = window.innerWidth;
var contentHeader = document.querySelector('.content_header');
var moon = document.querySelector('.moon');
var cloudsWrapper = document.querySelector('.clouds-wrapper');
var contentMountains = document.querySelector('.content_mountains');
if ("accueil") {
if (screenWidth <= 700) {
contentHeader.style.display = "none";
} if ("atelier") {
contentHeader.style.display = "block";
} if ("animation") {
} else {
if (elem === "accueil" || elem === "annexe") {
contentHeader.style.display = "none";
}
if (elem === "atelier") {
contentHeader.style.display = "none";
setTimeout(function(){
contentHeader.style.display = "block";
} if ("transition") {
contentHeader.style.display = "block";
} if ("annexe") {
contentHeader.style.display = "block";
}
moon.style.display = "block";
contentMountains.style.display = "block";
cloudsWrapper.style.display = "block";
}, 500);
}
if (elem === "animation") {
contentHeader.style.display = "none";
setTimeout(function(){
contentHeader.style.display = "block";
contentHeader.style.height = "20vh";
moon.style.display = "block";
contentMountains.style.display = "block";
}, 500);

}
if (elem === "transition") {
contentHeader.style.display = "none";
setTimeout(function(){
contentHeader.style.display = "block";
moon.style.display = "none";
contentMountains.style.display = "block";
cloudsWrapper.style.display = "none";
}, 500);
}
}
}
function changeUrl(title, url) {
if (typeof (history.pushState) != "undefined") {
Expand Down
Loading

0 comments on commit 1533a20

Please sign in to comment.