mirror of
https://github.com/flynx/PortableMag.git
synced 2025-11-01 04:20:20 +00:00
added splash screen...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ba9788c600
commit
659465d2aa
133
index.html
133
index.html
@ -11,48 +11,6 @@
|
|||||||
/* this is needed only for live resize... */
|
/* this is needed only for live resize... */
|
||||||
var PAGES_VISIBLE = 1
|
var PAGES_VISIBLE = 1
|
||||||
var PAGES_IN_RIBBON = 6
|
var PAGES_IN_RIBBON = 6
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
$(window).resize(function() {
|
|
||||||
fitNPages(PAGES_VISIBLE)
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.viewer')
|
|
||||||
.swipe({
|
|
||||||
swipeStatus: swipeUpdate,
|
|
||||||
// XXX change this to pinch...
|
|
||||||
swipeUp: function(){
|
|
||||||
togglePageView('off')
|
|
||||||
},
|
|
||||||
// XXX change this to pinch...
|
|
||||||
swipeDown: function(){
|
|
||||||
togglePageView('on')
|
|
||||||
},
|
|
||||||
// XXX for some reason this deos not bubble up the nested elements...
|
|
||||||
click: function(evt, elem){
|
|
||||||
if($(elem).hasClass('page')){
|
|
||||||
setCurrentPage(elem)
|
|
||||||
} else if($(elem).hasClass('content')){
|
|
||||||
setCurrentPage($(elem).parents('.page').first())
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
$('.button.cover').swipe({click: goToMagazineCover})
|
|
||||||
$('.button.next-article').swipe({click: nextArticle})
|
|
||||||
$('.button.prev-article').swipe({click: prevArticle})
|
|
||||||
|
|
||||||
loadState()
|
|
||||||
|
|
||||||
togglePageView('on')
|
|
||||||
|
|
||||||
|
|
||||||
// XXX add splash screen...
|
|
||||||
// XXX
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
// XXX move to generic lib...
|
// XXX move to generic lib...
|
||||||
|
|
||||||
@ -118,6 +76,42 @@ function createCSSClassToggler(elem, css_class, callback_a, callback_b){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// show a jQuary opject in viewer overlay...
|
||||||
|
// XXX need to set .scrollTop(0) when showing different UI...
|
||||||
|
// ...and not set it when the UI is the same
|
||||||
|
// XXX this must create it's own overlay...
|
||||||
|
function showInOverlay(obj){
|
||||||
|
obj.click(function(){ return false })
|
||||||
|
// XXX
|
||||||
|
$('.viewer').addClass('overlay-mode')
|
||||||
|
// clean things up...
|
||||||
|
$('.overlay .content').children().remove()
|
||||||
|
// put it in the overlay...
|
||||||
|
$('.overlay .content').append(obj)
|
||||||
|
// prepare the overlay...
|
||||||
|
$('.overlay')
|
||||||
|
.one('click', function(){
|
||||||
|
$('.overlay')
|
||||||
|
.fadeOut(function(){
|
||||||
|
$('.overlay .content')
|
||||||
|
.children()
|
||||||
|
.remove()
|
||||||
|
$('.overlay-mode').removeClass('overlay-mode')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.fadeIn()
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function overlayMessage(text){
|
||||||
|
return showInOverlay($('<div class="overlay-message">' +text+ '</div>'))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// XXX might be good to use apply here...
|
// XXX might be good to use apply here...
|
||||||
function doWithoutTransitions(obj, func, time){
|
function doWithoutTransitions(obj, func, time){
|
||||||
if(time == null){
|
if(time == null){
|
||||||
@ -479,6 +473,52 @@ function createPage(article, template){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(window).resize(function() {
|
||||||
|
fitNPages(PAGES_VISIBLE)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.viewer')
|
||||||
|
.swipe({
|
||||||
|
swipeStatus: swipeUpdate,
|
||||||
|
// XXX change this to pinch...
|
||||||
|
swipeUp: function(){
|
||||||
|
togglePageView('off')
|
||||||
|
},
|
||||||
|
// XXX change this to pinch...
|
||||||
|
swipeDown: function(){
|
||||||
|
togglePageView('on')
|
||||||
|
},
|
||||||
|
// XXX for some reason this deos not bubble up the nested elements...
|
||||||
|
click: function(evt, elem){
|
||||||
|
if($(elem).hasClass('page')){
|
||||||
|
setCurrentPage(elem)
|
||||||
|
} else if($(elem).hasClass('content')){
|
||||||
|
setCurrentPage($(elem).parents('.page').first())
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$('.button.cover').swipe({click: goToMagazineCover})
|
||||||
|
$('.button.next-article').swipe({click: nextArticle})
|
||||||
|
$('.button.prev-article').swipe({click: prevArticle})
|
||||||
|
|
||||||
|
loadState()
|
||||||
|
|
||||||
|
togglePageView('on')
|
||||||
|
|
||||||
|
|
||||||
|
// hide the splash screen...
|
||||||
|
$(window).one('webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend',
|
||||||
|
function(){
|
||||||
|
$('.splash').fadeOut()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@ -486,6 +526,15 @@ function createPage(article, template){
|
|||||||
|
|
||||||
<div class="viewer">
|
<div class="viewer">
|
||||||
|
|
||||||
|
<!-- Splash screen -->
|
||||||
|
<div class="splash noSwipe">
|
||||||
|
<!-- XXX replace this with a background-image logo... -->
|
||||||
|
<table width="100%" height="100%"><tr><td align="center" valign="middle">
|
||||||
|
<h2><i>loading...</i></h2>
|
||||||
|
</td></tr></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- XXX Magazine title... -->
|
<!-- XXX Magazine title... -->
|
||||||
|
|
||||||
<div class="top-toolbar">
|
<div class="top-toolbar">
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.animated,
|
.animated,
|
||||||
|
.splash,
|
||||||
.content,
|
.content,
|
||||||
.section,
|
.section,
|
||||||
.button,
|
.button,
|
||||||
@ -18,6 +19,7 @@
|
|||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|||||||
16
magazine.css
16
magazine.css
@ -173,6 +173,22 @@ body {
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.splash {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 9000;
|
||||||
|
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.splash * {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* modes */
|
/* modes */
|
||||||
.page-view-mode.viewer {
|
.page-view-mode.viewer {
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user