added night mode to expo
This commit is contained in:
@@ -55,7 +55,7 @@ if(typeof _states_history[0]!="undefined"){if(_states_history[0].caller){state.c
|
||||
break;}}else{state.context=null;}
|
||||
if($link.is('[selector]')){state.selector=$link.attr('selector');}
|
||||
$link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function refreshFavoritesLinks(){void 0;_audioPlayer.reloadNode();if(_states_history[0].view_mode=='index'||_states_history[0].sys_path=="docsindex"){ajaxLoadContent(_states_history[0]);}}
|
||||
function onCorpusMapReady(e){_corpus_ready=true;_$corpus_canvas=$('canvas#corpus-map');_$corpus_canvas.on('corpus-cliked-on-map',function(e){backToFrontPage();}).on('corpus-cliked-on-node',function(e){_audioPlayer.emmit('stop-shuffle').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);if(_is_expo){_randomPlayer.start();}
|
||||
function onCorpusMapReady(e){_corpus_ready=true;_$corpus_canvas=$('canvas#corpus-map');_$corpus_canvas.on('corpus-cliked-on-map',function(e){backToFrontPage();}).on('corpus-cliked-on-node',function(e){_audioPlayer.emmit('stop-shuffle').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);if(_is_expo){initExpo();}
|
||||
initAjaxLinks();_$body.attr('corpus-map','ready');}
|
||||
function openEntree(tid){if(tid){closeAllModals();_$body.removeClass();if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:tid});}else{$('li.entree[tid="'+tid+'"] a.term-link').addClass('is-active');}}};function checkVisibleCorpusMapSpace(){var left_limit=0,right_limit=0;_$row.find('.col').each(function(i,e){var $col=$(this);var offset=$col.offset();void 0;switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-15-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width()+15);break;}});void 0;if(_corpus_ready){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});}else{_corpus_promise.done(function(){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});});}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","playing","pause","timeupdate","ended","error"];this.$container=$('<div id="audio-player">');this.$btns=$('<div>').addClass('btns').appendTo(this.$container);this.$previous=$('<div>').addClass('previous').appendTo(this.$btns);this.$playpause=$('<div>').addClass('play-pause').appendTo(this.$btns);this.$next=$('<div>').addClass('next').appendTo(this.$btns);this.$timelinecont=$('<div>').addClass('time-line-container').appendTo(this.$container);this.$timeline=$('<div>').addClass('time-line').appendTo(this.$timelinecont);this.$loader=$('<div>').addClass('loader').appendTo(this.$timeline);this.$cursor=$('<div>').addClass('cursor').appendTo(this.$timeline);this.$time=$('<div>').addClass('time').appendTo(this.$container);this.$currentTime=$('<div>').addClass('current-time').html('00:00').appendTo(this.$time);this.$duration=$('<div>').addClass('duration').html('00:00').appendTo(this.$time);this.$fav=$('<div>').addClass('favoris').appendTo(this.$container);this.$cartel=$('<div>').addClass('cartel').appendTo(this.$container);this.scndCartel_visible=0;this.cartelSwitchIntervalMS=7000;this.cartelSwitchInterval=false;this.visible=false;this.hideTimer=false;this.hideTimeMS=15000;this.currentHistoricIndex=null;this.historic=[];this.shuffle_is_active=false;this.auto_open_article=false;this.event_handlers={'audio-open-document':[],'audio-play':[],'audio-pause':[],'audio-play-next':[],'audio-ended':[],'stop-shuffle':[]};this.init();};AudioPlayer.prototype={init(){if(!_is_expo){this.$container_parent=$('header[role="banner"] .region-header');}else{this.$container_parent=$('main[role="main"]');}
|
||||
this.$container.appendTo(this.$container_parent);this.timeline_w=parseInt(this.$timeline.width());this.$loader.on('click',this.seek.bind(this));var fn='';for(var i=0;i<this.audio_events.length;i++){fn=this.audio_events[i];fn='on'+fn.charAt(0).toUpperCase()+fn.slice(1);this.audio.addEventListener(this.audio_events[i],this[fn].bind(this),true);}
|
||||
@@ -84,7 +84,9 @@ return this;},showHideControls(){if(this.$controls){if(this.playing&&!this.pause
|
||||
if(this.$playpause){if(this.playlist.length>0){this.$playpause.addClass('is-active');}else{this.$playpause.removeClass('is-active');}}
|
||||
if(this.$next){if(this.playing&&this.playlist.length>1&&this.current_index<this.playlist.length-1){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}}
|
||||
if(this.$previous){if(this.playing&&this.playlist.length>1&&this.current_index>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){void 0;if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){void 0;if(this.playing){this.paused=false;this.next();}},};function initGrid(){void 0;if(!_is_mobile){checkGridBlockHeight();_$row.find('.col').addClass('offfield');}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){void 0;if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){void 0;if(this.playing){this.paused=false;this.next();}},};function initExpo(){void 0;if(window.location.hash=='#black'){$('body').addClass('expo-black');}
|
||||
_randomPlayer.start();}
|
||||
function initGrid(){void 0;if(!_is_mobile){checkGridBlockHeight();_$row.find('.col').addClass('offfield');}
|
||||
if(false){var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',containerStyle:null,resizeContainer:false,transitionDuration:0,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});$grid.on('layoutComplete',checkGridBlockVisible);}else{if(!_is_mobile){checkGridBlockVisible();}}};function checkGridBlockHeight(){var $r_h=_$row.height();var $this;$('.grid .col',_$row).each(function(i,e){$this=$(this);if(!$this.is('[init-height]')){$this.attr('init-height',$this.outerHeight())}
|
||||
$this.height(Math.min($this.attr('init-height'),_$row.height()));});};function checkGridBlockVisible(){var $r_h=_$row.height();var $this,pos;$('.grid .col',_$row).each(function(i,e){$this=$(this);pos=$this.position();if(pos.top+$this.height()<=$r_h){$this.removeClass('offfield');}else{$this.addClass('offfield');}});}
|
||||
function initCollectionNav(){void 0;$('.field--name-field-notice, .index','.taxonomy-term.vocabulary-entrees.home_mobile').addClass('closed');$('.field--name-field-notice>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionNotice);$('.index>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionIndex);};function onClickCollectionNotice(e){toggleEntreeOpening($(this).parent(),'notice');};function onClickCollectionIndex(e){toggleEntreeOpening($(this).parent(),'index');};function toggleEntreeOpening($e,part){$e.toggleClass('closed').parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1044,7 +1044,7 @@
|
||||
_randomPlayer = new RandomPlayer(e.playlist);
|
||||
|
||||
if (_is_expo) {
|
||||
_randomPlayer.start();
|
||||
initExpo();
|
||||
}
|
||||
|
||||
// mainly for articles link
|
||||
@@ -1951,6 +1951,18 @@
|
||||
// }
|
||||
};
|
||||
|
||||
// ___
|
||||
// | __|_ ___ __ ___
|
||||
// | _|\ \ / '_ \/ _ \
|
||||
// |___/_\_\ .__/\___/
|
||||
// |_|
|
||||
function initExpo(){
|
||||
console.log('initExpo', window.location.hash);
|
||||
if(window.location.hash == '#black'){
|
||||
$('body').addClass('expo-black');
|
||||
}
|
||||
_randomPlayer.start();
|
||||
}
|
||||
|
||||
// ___ _ _
|
||||
// / __|_ _(_)__| |
|
||||
|
||||
@@ -64,6 +64,10 @@
|
||||
// }
|
||||
|
||||
|
||||
body.expo-black{
|
||||
background-color: $expo-black;
|
||||
}
|
||||
|
||||
// _ _
|
||||
// | |_ ___ __ _ __| |___ _ _
|
||||
// | ' \/ -_) _` / _` / -_) '_|
|
||||
@@ -1126,6 +1130,14 @@ main[role="main"]{
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
body.expo-black &{
|
||||
background-color: $expo-black-bg;
|
||||
color:#fff;
|
||||
.time-line-container .time-line .loader{
|
||||
border-top: 2px solid $expo-black-bg;
|
||||
border-bottom: 2px solid $expo-black-bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
$transparent-bg: rgba(255,255,255, 0.95);
|
||||
$expo-black:#282828;
|
||||
$expo-black-bg:rgba(40,40,40,0.9);
|
||||
|
||||
Reference in New Issue
Block a user