mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 19:20:09 +00:00
added template preview...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f82255d44a
commit
7728ef1a50
@ -8,6 +8,7 @@
|
|||||||
<style>
|
<style>
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
position: relative;
|
||||||
border: solid 1px silver;
|
border: solid 1px silver;
|
||||||
width: 750px;
|
width: 750px;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
@ -16,6 +17,35 @@
|
|||||||
box-shadow: 5px 5px 200px 0px silver;
|
box-shadow: 5px 5px 200px 0px silver;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
.container .preview {
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: white;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.container .preview .page {
|
||||||
|
|
||||||
|
margin: 10%;
|
||||||
|
|
||||||
|
-webkit-transform-origin: 0 0;
|
||||||
|
-moz-transform-origin: 0 0;
|
||||||
|
-o-transform-origin: 0 0;
|
||||||
|
-ms-transform-origin: 0 0;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
|
||||||
|
-webkit-transform: scale(0.7);
|
||||||
|
-moz-transform: scale(0.7);
|
||||||
|
-o-transform: scale(0.7);
|
||||||
|
-ms-transform: scale(0.7);
|
||||||
|
transform: scale(0.7);
|
||||||
|
|
||||||
|
box-shadow: 5px 5px 300px 0px gray;
|
||||||
|
}
|
||||||
|
|
||||||
.container .page-box {
|
.container .page-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -33,7 +63,7 @@
|
|||||||
cursor: hand;
|
cursor: hand;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container .page {
|
.page-box .page {
|
||||||
box-shadow: 5px 5px 200px 30px gray;
|
box-shadow: 5px 5px 200px 30px gray;
|
||||||
|
|
||||||
margin: 5%;
|
margin: 5%;
|
||||||
@ -49,14 +79,14 @@
|
|||||||
-o-transform: scale(0.25);
|
-o-transform: scale(0.25);
|
||||||
-ms-transform: scale(0.25);
|
-ms-transform: scale(0.25);
|
||||||
transform: scale(0.25);
|
transform: scale(0.25);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
.container .page {
|
||||||
-webkit-transition: none;
|
-webkit-transition: none;
|
||||||
-moz-transition: none;
|
-moz-transition: none;
|
||||||
-o-transition: all 0 ease;
|
-o-transition: all 0 ease;
|
||||||
-ms-transition: none;
|
-ms-transition: none;
|
||||||
transition: none;
|
transition: none;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container .title {
|
.container .title {
|
||||||
@ -64,7 +94,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
bottom: 10%;
|
bottom: 10%;
|
||||||
right: 10%;
|
right: 10%;
|
||||||
z-index: 1000;
|
/*z-index: 1000;*/
|
||||||
text-shadow: black 0.1em 0.1em 0.4em, black 0.1em 0.1em;
|
text-shadow: black 0.1em 0.1em 0.4em, black 0.1em 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +145,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
function toggleTheme(){
|
function toggleTheme(){
|
||||||
var page = $(this).parents('.page-box').children('.page')
|
var page = $(this).parents('.page-box, .preview').children('.page')
|
||||||
if(page.hasClass('dark')){
|
if(page.hasClass('dark')){
|
||||||
page.add(this)
|
page.add(this)
|
||||||
.removeClass('dark')
|
.removeClass('dark')
|
||||||
@ -125,18 +155,43 @@ function toggleTheme(){
|
|||||||
.removeClass('light')
|
.removeClass('light')
|
||||||
.addClass('dark')
|
.addClass('dark')
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
function addThemeToggleZones(){
|
function addThemeToggleZones(){
|
||||||
$('<div><div/></div>')
|
$('<div><div/></div>')
|
||||||
.addClass('theme-toggle')
|
.addClass('theme-toggle')
|
||||||
.attr('title', 'Toggle dark/light theme')
|
.attr('title', 'Toggle dark/light theme')
|
||||||
.appendTo($('.page-box:not(.no-themes)'))
|
.appendTo($('.page-box:not(.no-themes), .preview'))
|
||||||
.click(toggleTheme)
|
.click(toggleTheme)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
addThemeToggleZones()
|
addThemeToggleZones()
|
||||||
|
|
||||||
|
$('.preview')
|
||||||
|
.click(function(){
|
||||||
|
$(this)
|
||||||
|
.css('display', 'none')
|
||||||
|
.children('.page')
|
||||||
|
.remove()
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.page-box')
|
||||||
|
.click(function(){
|
||||||
|
$(this)
|
||||||
|
.children('.page')
|
||||||
|
.clone()
|
||||||
|
.appendTo($('.container .preview'))
|
||||||
|
.click(function(){
|
||||||
|
alert(this.outerHTML)
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
$('.container .preview')
|
||||||
|
.css('display', 'block')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -162,7 +217,6 @@ $(function(){
|
|||||||
|
|
||||||
|
|
||||||
<div class="page-box">
|
<div class="page-box">
|
||||||
<div class="title">Two Column</div>
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
@ -178,6 +232,8 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- keep this last -->
|
||||||
|
<div class="title">Two Column</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -198,11 +254,12 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- keep this last -->
|
||||||
|
<div class="title">Three Column</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="page-box">
|
<div class="page-box">
|
||||||
<div class="title">Caption</div>
|
|
||||||
<div class="page caption-bottom-arrow">
|
<div class="page caption-bottom-arrow">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h2>Caption Text</h2>
|
<h2>Caption Text</h2>
|
||||||
@ -211,27 +268,33 @@ $(function(){
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- keep this last -->
|
||||||
|
<div class="title">Caption</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="page-box">
|
<div class="page-box">
|
||||||
<div class="title">Raw Page</div>
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- keep this last -->
|
||||||
|
<div class="title">Raw Page</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="page-box no-themes">
|
<div class="page-box no-themes">
|
||||||
|
<!-- keep this last -->
|
||||||
<div class="title">Blank Template</div>
|
<div class="title">Blank Template</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- keep this last -->
|
||||||
|
<div class="preview">
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<!-- vim:set sw=4 ts=4 nowrap : -->
|
<!-- vim:set sw=4 ts=4 nowrap : -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user