mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 12:00:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			363 lines
		
	
	
		
			9.5 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			363 lines
		
	
	
		
			9.5 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
| <html>
 | |
| <head>
 | |
| <title>Magazine</title>
 | |
| 
 | |
| <link rel="stylesheet" href="magazine.css">
 | |
| <link rel="stylesheet" href="magazine-custom.css">
 | |
| 
 | |
| <script src="jquery.js"></script>
 | |
| <script src="jquery.touchSwipe.js"></script>
 | |
| <script src="jstorage.js"></script>
 | |
| 
 | |
| <script src="jli.js"></script>
 | |
| <script src="magazine.js"></script>
 | |
| 
 | |
| <script>
 | |
| 
 | |
| $(document).ready(function(){
 | |
| 
 | |
| 	if(DEBUG){
 | |
| 		$('.splash').click(function(){
 | |
| 			$('.splash').fadeOut()
 | |
| 		})
 | |
| 	}
 | |
| 
 | |
| 
 | |
| 	$(window)
 | |
| 		.resize(function() {
 | |
| 			// XXX might be good to compensate for document zoom...
 | |
| 			if(document.width/$(document).width() != 1){
 | |
| 				// XXX scale the page...
 | |
| 				console.log('>>> Page Zoom:', document.width/$(document).width())
 | |
| 			}
 | |
| 			//$('.splash').show()
 | |
| 			if(ANIMATE_WINDOW_RESIZE){
 | |
| 				togglePageView(togglePageView('?'))
 | |
| 			} else {
 | |
| 				unanimated(
 | |
| 					$('.scaler'), 
 | |
| 					togglePageView,
 | |
| 					30
 | |
| 				)(togglePageView('?'))
 | |
| 			}
 | |
| 			//$('.splash').fadeOut()
 | |
| 		})
 | |
| 		.bind('hashchange', function(e){
 | |
| 			e.preventDefault()
 | |
| 			setCurrentPage(loadURLState())
 | |
| 		})
 | |
| 
 | |
| 	$('.viewer')
 | |
| 		.swipe({
 | |
| 			swipeStatus: swipeHandler,
 | |
| 			// XXX change this to pinch...
 | |
| 			swipeUp: function(){
 | |
| 				//togglePageView('off')
 | |
| 				togglePageView()
 | |
| 			},
 | |
| 			// XXX change this to pinch...
 | |
| 			swipeDown: function(){
 | |
| 				//togglePageView('on')
 | |
| 				togglePageView()
 | |
| 			},
 | |
| 
 | |
| 			pinchIn: function(event, direction, distance, duration, fingerCount, pinchZoom) {
 | |
| 				if(pinchZoom < distance){
 | |
| 					return
 | |
| 				}
 | |
| 				if(fingerCount == 2){
 | |
| 					togglePageView('on')
 | |
| 				}
 | |
| 			},
 | |
| 			pinchOut: function(event, direction, distance, duration, fingerCount, pinchZoom) {
 | |
| 				if(pinchZoom < distance){
 | |
| 					return
 | |
| 				}
 | |
| 				if(fingerCount == 2){
 | |
| 					togglePageView('off')
 | |
| 				}
 | |
| 			},
 | |
| 
 | |
| 
 | |
| 			// XXX for some reason this deos not bubble up the nested elements...
 | |
| 			click: function(evt, elem){
 | |
| 				if($(elem).hasClass('page')){
 | |
| 					setCurrentPage(elem)
 | |
| 					//togglePageView('on')
 | |
| 				} else if($(elem).hasClass('content')){
 | |
| 					setCurrentPage($(elem).parents('.page').first())
 | |
| 					//togglePageView('on')
 | |
| 				}
 | |
| 				return true
 | |
| 			},
 | |
| 
 | |
| 			//excludedElements: '.noSwipe',
 | |
| 			fingers: $.fn.swipe.fingers.ALL
 | |
| 		})
 | |
| 
 | |
| 	// XXX do we need these here??
 | |
| 	$('.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>
 | |
| </head>
 | |
| <body>
 | |
| 
 | |
| <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... -->
 | |
| 
 | |
| 	<div class="top-toolbar">
 | |
| 		<div class="button cover">Issue Cover</div>
 | |
| 		<div class="button prev-article">Prev Article</div>
 | |
| 		<div class="button next-article">Next Article</div>
 | |
| 	</div>
 | |
| 	<div class="bottom-toolbar">
 | |
| 		<!-- this is just an example-->
 | |
| 		<a href="#home">Cover</a> |
 | |
| 		<a href="#prevArticle">Previous article</a> |
 | |
| 		<a href="#prev">Previous page</a> |
 | |
| 		<a href="#next">Next page</a> | 
 | |
| 		<a href="#nextArticle">Next article</a> |
 | |
| 		<a href="#end">End</a>
 | |
| 	</div>
 | |
| 
 | |
| <div class="scaler">
 | |
| <div class="aligner">
 | |
| 	<div class="magazine">
 | |
| 		<div class="cover page current">
 | |
| 			<div class="content">
 | |
| 				<h1 style="color:gray;font-size:125px;">PortableMag</h1>
 | |
| 				<p>
 | |
| 				[PROJECT DESCRIPTION]
 | |
| 				</p>
 | |
| 				<a href="#navigation">The navigation...</a><br>
 | |
| 				<a href="#anatomy">The anatomy...</a><br>
 | |
| 			</div>
 | |
| 		</div>
 | |
| 
 | |
| 		<!-- XXX do we need a Magazine Credits page??? -->
 | |
| 
 | |
| 		<div class="article">
 | |
| 			<div class="cover page">
 | |
| 				<div class="content">
 | |
| 					<h1 name="basics" style="color:gray;font-size:100px;">The Basics...</h1>
 | |
| 					<div style="position:absolute; width:100%; bottom:10px; text-align: right;">
 | |
| 						<a href="#next">get started...</a><br>
 | |
| 					</div>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					<h1 name="navigation">PortableMag Navigation and Linking</h1>
 | |
| 					<div style="float:left; width: 40%; height: 100%; margin: 10px;">
 | |
| 						<h2>Finger controls</h2>
 | |
| 						<ul>
 | |
| 							<li> Single finger swipe left/right – prev/next page.
 | |
| 							<li> Two finger swipe left/right – prev/next article.
 | |
| 							<li> Single finger swipe up/down – toggle thumbnail view.
 | |
| 							<li> Pinch in/out – go in/out of thumbnail view.
 | |
| 						</ul>
 | |
| 						<h2>Navigation via #URLs</h2>
 | |
| 						<h3>The basics</h3>
 | |
| 						<a href="#1">Page #1</a><br>
 | |
| 						<a href="#ArticleAnchorExample">Named page</a><br>
 | |
| 						<p>
 | |
| 							<a href="#page-3-anchor" style="pointer-events:none">Anchor on page #3</a><br>
 | |
| 							<i> currently navigation via existing anchors
 | |
| 								will break the layout, so use the name attribute
 | |
| 								on any other tags (see example).
 | |
| 							</i>
 | |
| 						</p>
 | |
| 					</div>
 | |
| 
 | |
| 					<div style="float:left; width: 40%; height: 100%; padding: 10px;">
 | |
| 						<h3>Special anchors</h3>
 | |
| 						<p>These show up in the page URL</p>
 | |
| 						<a href="#home">Magazine cover</a><br>
 | |
| 						<a href="#end">Last page</a><br>
 | |
| 						<a href="#thumbnails">Thumbnail view</a><br>
 | |
| 						<a href="#example-layer">Toggle a hidden layer</a><br>
 | |
| 						<span name="example-layer" class="hidden">
 | |
| 							<a href="#hideLayers">Hide all layers</a><br>
 | |
| 						</span>
 | |
| 
 | |
| 						<h3>Relative special anchors</h3>
 | |
| 						<p>These will get replaced by corresponding page numbers in the URL</p>
 | |
| 						<a href="#next">Next page</a><br>
 | |
| 						<a href="#prev">Previous page</a><br>
 | |
| 						<a href="#nextArticle">Next article</a><br>
 | |
| 						<a href="#prevArticle">Previous article</a><br>
 | |
| 					</div>
 | |
| 					<div style="position:absolute; width:100%; bottom:10px; text-align: right;">
 | |
| 						<a href="#next">next page...</a><br>
 | |
| 					</div>
 | |
| 
 | |
| 
 | |
| 					<div name="example-layer" class="hidden" onclick="window.location='#example-layer'" style="position:absolute; left:100px; top:400px; width: 300px; height:50px; text-align: center; padding: 15px; border: solid gray 5px; background: silver; color: white; cursor: hand">
 | |
| 						<h3>This is an example layer</h3>
 | |
| 						<i>click or tap to hide</i>
 | |
| 					</div>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 
 | |
| 			<!-- XXX do we need an Article Credits page??? -->
 | |
| 
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					<h1 name="anatomy">PortableMag Anatomy</h1>
 | |
| 					<p>
 | |
| 					The magazine consists of:
 | |
| 					<ul>
 | |
| 						<li>Magazine cover
 | |
| 						<li>Articles:
 | |
| 						<ul>
 | |
| 							<li>Article cover
 | |
| 							<li>Pages
 | |
| 						</ul>
 | |
| 					</ul>
 | |
| 					Each of these elements can be styled separately...
 | |
| 					</p>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content" style="background: black; color: gray; padding-left: 20px; padding-right: 20px;">
 | |
| 					<h1>The Page <i>content</i> has a fixed size...</h1>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					<a name="page-3-anchor"></a>
 | |
| 					<img src="img.jpg" height="100%" align="left" style="margin-right: 15px"/>
 | |
| 					<h1>Using the content block...</h1>
 | |
| 					<p>
 | |
| 					The content block can contain any HTML.
 | |
| 					</p>
 | |
| 					<p>
 | |
| 					The contents will allways fit the screen, the aspect ratio 
 | |
| 					of the content block is fixed regardless of the viewer.
 | |
| 					</p>
 | |
| 					<p>
 | |
| 					Contents will not get clipped as long as they are within the block.
 | |
| 					</p>
 | |
| 					<p>
 | |
| 					NOTE: by default the overflow is visible (see <a href="#next">next page</a>), so be carefull.
 | |
| 					</p>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					<img src="img.jpg" width="200%" style="position: absolute; left: -50%; top: -20%"/>
 | |
| 					<div style="position:absolute; width:100%; height: 100%; color: white;">
 | |
| 						<h1>You can still use the full page area...</h1>
 | |
| 						<p>
 | |
| 						Though anything outside the content block can and will get clipped,
 | |
| 						depending on viewer aspect ratio...
 | |
| 						</p>
 | |
| 						<p>
 | |
| 						You can see this by resizing the page in browser or rotating the device.
 | |
| 						</p>
 | |
| 					</div>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 		</div>
 | |
| 		<div class="article">
 | |
| 			<div class="cover page">
 | |
| 				<div class="content" name="ArticleAnchorExample">
 | |
| 					<h1>Page Templates</h1>
 | |
| 					<a href="#home">home</a><br>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 		</div>
 | |
| 		<div class="article">
 | |
| 			<div class="cover page">
 | |
| 				<div class="content">
 | |
| 					<h1>Article Cover</h1>
 | |
| 					<a href="#home">home</a><br>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page
 | |
| 				</div>
 | |
| 			</div>
 | |
| 			<div class="page">
 | |
| 				<div class="content">
 | |
| 					Page<br>
 | |
| 					<a href="#home">home</a><br>
 | |
| 				</div>
 | |
| 			</div>
 | |
| 		</div>
 | |
| 	</div>
 | |
| </div>
 | |
| </div>
 | |
| </div>
 | |
| 
 | |
| 
 | |
| </body>
 | |
| </html>
 |