added pages and keyboard navigation

This commit is contained in:
Bachir Soussi Chiadmi
2016-11-20 11:43:52 +01:00
parent 5a3856e75b
commit 6850fa4d50
191 changed files with 34413 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
$(document).ready(function(){console.log("ready");var _current_pages=-1,_page_left_bg,_page_right_bg,_$page_left=$('#page-left'),_$page_right=$('#page-right'),_bgs_prefix="images/pages/";function init(){console.log("init",_$page_left);initkeyboard();changePages();};function nextPages(){if(_current_pages<_PAGES.length-2){_current_pages+=2;changePages();}};function prevPages(){if(_current_pages>-1){_current_pages-=2;changePages();}};function changePages(){console.log("changePages");_page_left_bg=_bgs_prefix+_PAGES[_current_pages];_page_right_bg=_bgs_prefix+_PAGES[_current_pages+1];console.log(_page_left_bg+" | "+_page_right_bg);_$page_left.css({'background-image':"url("+_page_left_bg+")"});_$page_right.css({'background-image':"url("+_page_right_bg+")"});};function initkeyboard(){keyboardJS.bind('right',function(event){nextPages();});keyboardJS.bind('left',function(event){prevPages();});};init();});
+71
View File
@@ -0,0 +1,71 @@
$(document).ready(function() {
console.log("ready");
var _current_pages = -1,
_page_left_bg, _page_right_bg,
_$page_left = $('#page-left'), _$page_right = $('#page-right'),
_bgs_prefix = "images/pages/";
// ____ _ __
// / _/___ (_) /_
// / // __ \/ / __/
// _/ // / / / / /_
// /___/_/ /_/_/\__/
function init(){
console.log("init", _$page_left);
initkeyboard();
changePages();
};
// ____
// / __ \____ _____ ____ _____
// / /_/ / __ `/ __ `/ _ \/ ___/
// / ____/ /_/ / /_/ / __(__ )
// /_/ \__,_/\__, /\___/____/
// /____/
function nextPages(){
if(_current_pages < _PAGES.length-2){
_current_pages+=2;
changePages();
}
};
function prevPages(){
if(_current_pages > -1){
_current_pages-=2;
changePages();
}
};
function changePages(){
console.log("changePages");
_page_left_bg = _bgs_prefix+_PAGES[_current_pages];
_page_right_bg = _bgs_prefix+_PAGES[_current_pages+1];
console.log(_page_left_bg+" | "+_page_right_bg);
_$page_left.css({'background-image': "url("+_page_left_bg+")"});
_$page_right.css({'background-image': "url("+_page_right_bg+")"});
};
// __ __ __ __
// / //_/__ __ __/ /_ ____ ____ __________/ /
// / ,< / _ \/ / / / __ \/ __ \/ __ `/ ___/ __ /
// / /| / __/ /_/ / /_/ / /_/ / /_/ / / / /_/ /
// /_/ |_\___/\__, /_.___/\____/\__,_/_/ \__,_/
// /____/
function initkeyboard(){
keyboardJS.bind('right', function(event) {
// console.log(event);
nextPages();
});
keyboardJS.bind('left', function(event) {
// console.log(event);
prevPages();
});
};
init();
});
+38
View File
@@ -0,0 +1,38 @@
var _PAGES=[
"00_1couv.jpeg",
"00_1couvV.jpeg",
"01_anan.jpeg",
"02_TH.jpeg",
"03_ologyOf.jpeg",
"04_chance.jpeg",
"05_Stories.jpeg",
"06_byGeorge.jpeg",
"07_Copyright.jpeg",
"08_Brecht.jpeg",
"100_Williams.jpeg",
"104_Wolff.jpeg",
"108_Young.jpeg",
"110_StraightLine.jpeg",
"112_Portrait?.jpeg",
"113_4couv.jpeg",
"114_4couv.jpeg",
"12_Bremer.jpeg",
"14_Brown.jpeg",
"23_Byrd.jpeg",
"26_Cage.jpeg",
"28_deMaria.jpeg",
"32_Flynt.jpeg",
"37_Ono.jpeg",
"39_HIggins.jpeg",
"41_Ichiyanagi.jpeg",
"45_Jennings.jpeg",
"48_Dennis.jpeg",
"54_DingDong.jpeg",
"56_Johnson.jpeg",
"58_MacLow.jpeg",
"79_Maxfield.jpeg",
"90_Simone.jpeg",
"92_Paik.jpeg",
"94_Riley.jpeg",
"99_Rot.jpeg"
]