mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-28 10:40:07 +00:00
842 lines
15 KiB
CSS
Executable File
842 lines
15 KiB
CSS
Executable File
/**********************************************************************
|
|
*
|
|
**********************************************************************/
|
|
|
|
body {
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
|
|
|
|
/************************************* layers and hidable elements ***/
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
/* keep this empty... */
|
|
.shown {
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************** pages ***/
|
|
.page {
|
|
/* XXX make this browser-sized... */
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
text-align: left;
|
|
overflow: hidden;
|
|
|
|
text-align: center;
|
|
|
|
width: auto;
|
|
height: auto;
|
|
|
|
/* XXX change to relative units... */
|
|
font-size: 12px;
|
|
|
|
background: white;
|
|
|
|
-webkit-transition: all 0.2s ease;
|
|
-moz-transition: all 0.2s ease;
|
|
-o-transition: all 0.2s ease;
|
|
-ms-transition: all 0.2s ease;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.page .content {
|
|
display: inline-block;
|
|
text-align: left;
|
|
position: relative;
|
|
overflow: visible;
|
|
white-space: normal;
|
|
|
|
/* these set the "safe" marks for page content */
|
|
/* XXX change to relative units... */
|
|
width: 800px;
|
|
height: 600px;
|
|
|
|
box-sizing:border-box;
|
|
-moz-box-sizing:border-box;
|
|
-webkit-box-sizing:border-box;
|
|
|
|
-webkit-transition: all 0.2s ease;
|
|
-moz-transition: all 0.2s ease;
|
|
-o-transition: all 0.2s ease;
|
|
-ms-transition: all 0.2s ease;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.page .bookmark {
|
|
position: absolute;
|
|
z-index: 8888;
|
|
width: 60px;
|
|
height: 60px;
|
|
top: 0px;
|
|
right: 0px;
|
|
overflow: hidden;
|
|
}
|
|
.page .bookmark div {
|
|
position: absolute;
|
|
width: 100px;
|
|
height: 100px;
|
|
|
|
background: red;
|
|
|
|
right: -60px;
|
|
top: -60px;
|
|
|
|
cursor: hand;
|
|
|
|
opacity: 0,5;
|
|
|
|
-webkit-transform: rotate(-45deg);
|
|
-moz-transform: rotate(-45deg);
|
|
-o-transform: rotate(-45deg);
|
|
-ms-transform: rotate(-45deg);
|
|
transform: rotate(-45deg);
|
|
|
|
/*
|
|
-webkit-transition: all 0.2s ease;
|
|
-moz-transition: all 0.2s ease;
|
|
-o-transition: all 0.2s ease;
|
|
-ms-transition: all 0.2s ease;
|
|
transition: all 0.2s ease;
|
|
*/
|
|
}
|
|
.page .bookmark-toggler {
|
|
position: absolute;
|
|
width: 40px;
|
|
height: 40px;
|
|
|
|
right: 0px;
|
|
top: 0px;
|
|
|
|
cursor: hand;
|
|
|
|
z-index: 9999;
|
|
}
|
|
|
|
.page-view-mode .page .bookmark div,
|
|
.full-page-view-mode .page .bookmark div {
|
|
right: -70px;
|
|
top: -70px;
|
|
opacity: 0.5;
|
|
}
|
|
.page-view-mode .page .bookmark.justcreated,
|
|
.full-page-view-mode .page .bookmark.justcreated {
|
|
opacity: 1;
|
|
}
|
|
|
|
|
|
|
|
/************************************************** general layout ***/
|
|
|
|
/* top most element, relative to this everything is sized */
|
|
.viewer {
|
|
position: relative;
|
|
/* this makes the magazine behave like a ribbon */
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
font-size: 0px;
|
|
|
|
background: gray;
|
|
|
|
-webkit-transition: all 0.6s ease;
|
|
-moz-transition: all 0.6s ease;
|
|
-o-transition: all 0.6s ease;
|
|
-ms-transition: all 0.6s ease;
|
|
transition: all 0.6s ease;
|
|
}
|
|
|
|
|
|
/* element used to scale the magazine... */
|
|
.scaler {
|
|
position: relative;
|
|
overflow: visible;
|
|
|
|
-webkit-transform: scale(1);
|
|
-moz-transform: scale(1);
|
|
-o-transform: scale(1);
|
|
-ms-transform: scale(1);
|
|
transform: scale(1);
|
|
|
|
-webkit-transition: all 0.1s ease;
|
|
-moz-transition: all 0.1s ease;
|
|
-o-transition: all 0.1s ease;
|
|
-ms-transition: all 0.1s ease;
|
|
transition: all 0.1s ease;
|
|
}
|
|
/* element used to center and align the magazine... */
|
|
.aligner {
|
|
position: relative;
|
|
left: 50%;
|
|
height: 100%;
|
|
}
|
|
|
|
|
|
/* magazine container, this contains a cover and a set of articles */
|
|
.magazine {
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
top: 50%;
|
|
|
|
min-width: 200px;
|
|
/* XXX has to be the same as default page height */
|
|
height: 600px;
|
|
/* XXX has to pe half of page height */
|
|
margin-top: -300px;
|
|
|
|
/* this is minus half the page width */
|
|
/* XXX change to relative units... */
|
|
margin-left: -400px;
|
|
|
|
z-index: 5000;
|
|
|
|
-webkit-transition: all 0.1s ease;
|
|
-moz-transition: all 0.1s ease;
|
|
-o-transition: all 0.1s ease;
|
|
-ms-transition: all 0.1s ease;
|
|
transition: all 0.1s ease;
|
|
}
|
|
/* XXX does not appear to work... (likely because :before/:after mess things up) */
|
|
.magazine:empty {
|
|
background: silver;
|
|
}
|
|
.dragging .magazine {
|
|
-webkit-transition: none;
|
|
-moz-transition: none;
|
|
-o-transition: none;
|
|
-ms-transition: none;
|
|
transition: none;
|
|
}
|
|
.dragging * {
|
|
-webkit-touch-callout: none;
|
|
-webkit-user-select: none;
|
|
-khtml-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
/* user hints, visible when user draggs past the cover or the last page
|
|
* of the mag... */
|
|
.magazine:before, .magazine:after {
|
|
position: absolute;
|
|
display: inline-block;
|
|
text-align: center;
|
|
|
|
top: 25%;
|
|
|
|
height: 300px;
|
|
width: 600px;
|
|
|
|
font-weight: bold;
|
|
font-size: 150px;
|
|
|
|
color: #888;
|
|
|
|
-webkit-transform: rotate(-90deg);
|
|
-moz-transform: rotate(-90deg);
|
|
-o-transform: rotate(-90deg);
|
|
-ms-transform: rotate(-90deg);
|
|
transform: rotate(-90deg);
|
|
}
|
|
.magazine:before {
|
|
content: 'COVER';
|
|
left: -320px;
|
|
}
|
|
.magazine:after {
|
|
content: 'END';
|
|
right: -450px;
|
|
}
|
|
|
|
/* magazine cover */
|
|
.magazine > .cover {
|
|
}
|
|
|
|
|
|
/* magazine article, this can contain a cover and a number of pages */
|
|
.group,
|
|
.article {
|
|
display: inline-block;
|
|
width: auto;
|
|
overflow: visible;
|
|
white-space: nowrap;
|
|
font-size: 0px;
|
|
min-width: 200px;
|
|
|
|
/* XXX this is a bad way to fix shadow visibility outside of
|
|
* the ribbon, but it's better than adding an extra tag */
|
|
overflow: hidden;
|
|
|
|
}
|
|
.article:empty {
|
|
color: silver;
|
|
}
|
|
|
|
.article .cover {
|
|
}
|
|
|
|
|
|
|
|
/************************************************ utility elements ***/
|
|
|
|
/* toolbars... */
|
|
.top-toolbar,
|
|
.bottom-toolbar {
|
|
display: block;
|
|
position: absolute;
|
|
text-align: center;
|
|
overflow: hidden;
|
|
|
|
background: #555;
|
|
opacity: 0.9;
|
|
|
|
height: 50px;
|
|
left: 0px;
|
|
|
|
font-size: 14px;
|
|
color: silver;
|
|
|
|
z-index: 1000;
|
|
}
|
|
.top-toolbar {
|
|
top: 0px;
|
|
width: 100%;
|
|
}
|
|
|
|
.bottom-toolbar {
|
|
bottom: 0px;
|
|
width: 100%;
|
|
}
|
|
.page-view-mode .top-toolbar,
|
|
.page-view-mode .bottom-toolbar,
|
|
.full-page-view-mode .top-toolbar,
|
|
.full-page-view-mode .bottom-toolbar {
|
|
display: none;
|
|
}
|
|
|
|
/* title */
|
|
.top-toolbar .title,
|
|
.bottom-toolbar .title {
|
|
font-size: 40px;
|
|
}
|
|
/* toolbar element sets */
|
|
.top-toolbar .left-set,
|
|
.bottom-toolbar .left-set {
|
|
float: left;
|
|
text-align: left;
|
|
}
|
|
.top-toolbar .right-set,
|
|
.bottom-toolbar .right-set {
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
/* toolbar links */
|
|
.top-toolbar a,
|
|
.bottom-toolbar a {
|
|
color: silver;
|
|
text-decoration: none;
|
|
}
|
|
/* toolbar controls */
|
|
.top-toolbar .controls,
|
|
.bottom-toolbar .controls {
|
|
margin-top: 10px;
|
|
}
|
|
/* toolbar buttons */
|
|
.button {
|
|
display: inline-block;
|
|
font-size: 25px;
|
|
font-weight: bold;
|
|
|
|
cursor: hand;
|
|
|
|
vertical-align: center;
|
|
|
|
width: auto;
|
|
|
|
margin-left: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
|
|
/* page indicator */
|
|
.bottom-toolbar .page-number {
|
|
position: absolute;
|
|
right: 10px;
|
|
top: 10px;
|
|
color: gray;
|
|
}
|
|
|
|
|
|
/*
|
|
.inline-editor-mode .left-toolbar,
|
|
.left-toolbar {
|
|
display: none;
|
|
}
|
|
*/
|
|
.settings.page {
|
|
display: none;
|
|
}
|
|
.editor-mode .settings.page {
|
|
display: inline-block;
|
|
}
|
|
|
|
/*
|
|
.editor-mode .left-toolbar {
|
|
position: absolute;
|
|
display: block;
|
|
top: 30px;
|
|
left: 30px;
|
|
width: 40px;
|
|
height: auto;
|
|
background: black;
|
|
color: white;
|
|
|
|
padding: 10px;
|
|
|
|
z-index: 9999;
|
|
|
|
opacity: 0.7;
|
|
|
|
-webkit-transition: all 0.1s ease;
|
|
-moz-transition: all 0.1s ease;
|
|
-o-transition: all 0.1s ease;
|
|
-ms-transition: all 0.1s ease;
|
|
transition: all 0.1s ease;
|
|
}
|
|
|
|
.editor-mode .left-toolbar svg {
|
|
display: block;
|
|
cursor: hand;
|
|
}
|
|
*/
|
|
|
|
|
|
/* navigator... */
|
|
.navigator {
|
|
opacity: 0.6;
|
|
}
|
|
.navigator .bar {
|
|
position: relative;
|
|
display: inline-block;
|
|
margin: 10px;
|
|
width: 400px;
|
|
height: 2px;
|
|
background: silver;
|
|
overflow: visible;
|
|
}
|
|
.navigator .bar .article,
|
|
.navigator .bar .indicator {
|
|
position: absolute;
|
|
/* set this to the percentage of a page from magazine length */
|
|
min-width: 10px;
|
|
width: 1%;
|
|
height: 100%;
|
|
}
|
|
.navigator .bar .article {
|
|
background: white;
|
|
height: 300%;
|
|
cursor: hand;
|
|
}
|
|
.navigator .bar .indicator {
|
|
background: yellow;
|
|
height: 500%;
|
|
top:-50%;
|
|
|
|
opacity: 0.7;
|
|
|
|
-webkit-transition: all 0.1s ease;
|
|
-moz-transition: all 0.1s ease;
|
|
-o-transition: all 0.1s ease;
|
|
-ms-transition: all 0.1s ease;
|
|
transition: all 0.1s ease;
|
|
}
|
|
|
|
.dragging .navigator .bar .indicator {
|
|
-webkit-transition: none;
|
|
-moz-transition: none;
|
|
-o-transition: all 0 ease;
|
|
-ms-transition: none;
|
|
transition: none;
|
|
}
|
|
.navigator .bar .bookmark {
|
|
position: absolute;
|
|
font-size: 0px;
|
|
width: 5px;
|
|
height: 5px;
|
|
|
|
top: -250%;
|
|
|
|
background: red;
|
|
|
|
cursor: hand;
|
|
|
|
-webkit-transform: rotate(45deg);
|
|
-moz-transform: rotate(45deg);
|
|
-o-transform: rotate(45deg);
|
|
-ms-transform: rotate(45deg);
|
|
transform: rotate(45deg);
|
|
}
|
|
|
|
/* splash screen. used to hide loading and aligning elements */
|
|
.splash {
|
|
position: absolute;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100%;
|
|
height: 100%;
|
|
z-index: 9000;
|
|
|
|
background: white;
|
|
}
|
|
.splash * {
|
|
color: gray;
|
|
}
|
|
|
|
|
|
/* overlay... */
|
|
.overlay {
|
|
display: block;
|
|
position: fixed;
|
|
z-index: 999999;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
.overlay > div:first-child {
|
|
position: absolute;
|
|
display: block;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
opacity: 0.7;
|
|
|
|
cursor: hand;
|
|
|
|
color: silver;
|
|
font-size: 32px;
|
|
text-align: right;
|
|
padding-right: 15px;
|
|
|
|
box-sizing:border-box;
|
|
}
|
|
.overlay > div:last-child {
|
|
position: absolute;
|
|
left: 0px;
|
|
top: 50%;
|
|
width: 100%;
|
|
height: 50%;
|
|
margin-top: -20%;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.9;
|
|
|
|
box-shadow: 5px 5px 200px 30px black;
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************** modes ***/
|
|
|
|
/* page view mode -- fullscreen, single page view */
|
|
.page-view-mode.viewer {
|
|
}
|
|
|
|
.page-view-mode .top-toolbar,
|
|
.page-view-mode .bottom-toolbar {
|
|
}
|
|
|
|
.page-view-mode .page .content {
|
|
}
|
|
.page-view-mode .current.page .content {
|
|
}
|
|
|
|
|
|
.page-view-mode.viewer.dragging {
|
|
}
|
|
.page-view-mode.dragging .page .content {
|
|
}
|
|
|
|
|
|
/******************************************************* templates ***/
|
|
|
|
div.page-number-text {
|
|
position: absolute;
|
|
bottom: 10px;
|
|
right: 10px;
|
|
text-align: right;
|
|
|
|
color: gray;
|
|
}
|
|
|
|
|
|
/* XXX split these into seporate files... */
|
|
.caption {
|
|
display: block;
|
|
position: absolute;
|
|
height: auto;
|
|
min-height: 100px;
|
|
width: 100%;
|
|
bottom: 0px;
|
|
left: 0px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 15px;
|
|
padding-bottom: 30px;
|
|
|
|
color: white;
|
|
background: black;
|
|
|
|
opacity: 0.8;
|
|
|
|
-webkit-transition: all 0.2s ease;
|
|
-moz-transition: all 0.2s ease;
|
|
-o-transition: all 0.2s ease;
|
|
-ms-transition: all 0.2s ease;
|
|
transition: all 0.2s ease;
|
|
}
|
|
.caption.hidden {
|
|
opacity: 0;
|
|
height: 0px;
|
|
}
|
|
.caption.shown {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
|
|
|
|
/************************************************** page templates ***/
|
|
|
|
.page .content .header,
|
|
.page .content .body,
|
|
.page .content .footer {
|
|
position: relative;
|
|
width: 80%;
|
|
left: 13%;
|
|
}
|
|
/* print-like content align */
|
|
.page:nth-child(even) .content .header,
|
|
.page:nth-child(even) .content .body,
|
|
.page:nth-child(even) .content .footer {
|
|
left: 7%;
|
|
}
|
|
|
|
.page .content .header {
|
|
margin-top: 5%;
|
|
min-height: 5%;
|
|
max-height: 15%;
|
|
top: 0px;
|
|
}
|
|
.page .content .body {
|
|
max-height: 80%;
|
|
padding-top: 1%;
|
|
padding-bottom: 1%;
|
|
}
|
|
.page .content .body p:first-child {
|
|
margin-top: 0px;
|
|
}
|
|
.page .content .footer {
|
|
position: absolute;
|
|
min-height: 5%;
|
|
max-height: 15%;
|
|
bottom: 0px;
|
|
margin-bottom: 5%;
|
|
}
|
|
|
|
.body .no-column-break {
|
|
display: inline-block;
|
|
width: 100%;
|
|
}
|
|
|
|
.page .content .footer .page-number-text {
|
|
position: absolute;
|
|
bottom: auto;
|
|
right: 0px;
|
|
text-align: right;
|
|
}
|
|
.page:nth-child(even) .content .footer .page-number-text {
|
|
left: 0px;
|
|
text-align: left;
|
|
}
|
|
|
|
/* column layouts */
|
|
.page .content .one-column {
|
|
column-count: 1;
|
|
-webkit-column-count: 1;
|
|
-moz-column-count: 1;
|
|
|
|
text-align: justify;
|
|
}
|
|
.page .content .two-column {
|
|
column-count: 2;
|
|
-webkit-column-count: 2;
|
|
-moz-column-count: 2;
|
|
|
|
text-align: justify;
|
|
}
|
|
.page .content .three-column {
|
|
column-count: 3;
|
|
-webkit-column-count: 3;
|
|
-moz-column-count: 3;
|
|
|
|
text-align: justify;
|
|
}
|
|
.page .content .four-column {
|
|
column-count: 4;
|
|
-webkit-column-count: 4;
|
|
-moz-column-count: 4;
|
|
|
|
text-align: justify;
|
|
}
|
|
|
|
|
|
/* caption pages... */
|
|
.page.caption-top-arrow,
|
|
.page.caption-bottom-arrow {
|
|
overflow: visible;
|
|
}
|
|
.page.caption-top-arrow .content,
|
|
.page.caption-bottom-arrow .content {
|
|
background: white;
|
|
text-align: justify;
|
|
/* XXX get rid of paddings... */
|
|
padding-right: 7%;
|
|
padding-left: 10%;
|
|
|
|
/* */
|
|
width: 200px;
|
|
}
|
|
.page.caption-top-arrow:before,
|
|
.page.caption-bottom-arrow:before {
|
|
position: absolute;
|
|
content: "";
|
|
font-size: 0px;
|
|
width: 50px;
|
|
height: 50px;
|
|
|
|
left:-25px;
|
|
|
|
background: white;
|
|
|
|
cursor: hand;
|
|
|
|
box-shadow: 20px -20px 50px 0px #000;
|
|
|
|
-webkit-transform: rotate(45deg);
|
|
-moz-transform: rotate(45deg);
|
|
-o-transform: rotate(45deg);
|
|
-ms-transform: rotate(45deg);
|
|
transform: rotate(45deg);
|
|
}
|
|
.page.caption-top-arrow:before {
|
|
/* this is for when we do not need to care about bookmarks...
|
|
top: 10px;*/
|
|
top: 50px;
|
|
}
|
|
.page.caption-bottom-arrow:before {
|
|
/*bottom: 10px;*/
|
|
bottom: 50px;
|
|
|
|
}
|
|
|
|
/* set a fixed shadow...
|
|
* NOTE: use .noshadow to disable shadows.
|
|
*/
|
|
.page.caption-top-arrow,
|
|
.page.caption-bottom-arrow {
|
|
box-shadow: 35px 0px 100px 0px #000;
|
|
}
|
|
.page.caption-top-arrow:before,
|
|
.page.caption-bottom-arrow:before {
|
|
box-shadow: 20px -20px 30px 10px #000;
|
|
}
|
|
/* XXX changing shdows makes things a bit gittery on devices...
|
|
.current.page.caption-top-arrow,
|
|
.current.page.caption-bottom-arrow {
|
|
box-shadow: 30px 0px 100px 0px #000;
|
|
}
|
|
.current.page.caption-top-arrow:before,
|
|
.current.page.caption-bottom-arrow:before {
|
|
box-shadow: 20px -20px 30px 10px #000;
|
|
}
|
|
*/
|
|
|
|
/* addind noshadow will disable shadows compleatly */
|
|
.page.caption-top-arrow.noshadow,
|
|
.page.caption-bottom-arrow.noshadow {
|
|
box-shadow: none;
|
|
}
|
|
.page.caption-top-arrow.noshadow:before,
|
|
.page.caption-bottom-arrow.noshadow:before {
|
|
box-shadow: none;
|
|
}
|
|
|
|
|
|
.page.vertical-image-fit,
|
|
.page.horizontal-image-fit {
|
|
/* prevent link errors from messing up the mag layout... */
|
|
overflow: hidden;
|
|
}
|
|
|
|
.page.vertical-image-fit .content {
|
|
width: auto;
|
|
}
|
|
.page.vertical-image-fit .content img {
|
|
height: 100%;
|
|
cursor: hand;
|
|
}
|
|
|
|
.page.horizontal-image-fit .content {
|
|
display: table-cell;
|
|
vertical-align: middle;
|
|
}
|
|
.page.horizontal-image-fit .content img {
|
|
width: 100%;
|
|
cursor: hand;
|
|
}
|
|
|
|
.page.horizontal-image-fit .caption,
|
|
.page.vertical-image-fit .caption {
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************/
|
|
|
|
body {
|
|
font-family: arial;
|
|
}
|
|
|
|
.page a,
|
|
.page a:visited,
|
|
.page a:active {
|
|
color: blue;
|
|
}
|
|
.page a:hover {
|
|
color: red;
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************/
|
|
/* keep this at the end... */
|
|
.unanimated {
|
|
-webkit-transition: none;
|
|
-moz-transition: none;
|
|
-o-transition: all 0 ease;
|
|
-ms-transition: none;
|
|
transition: none;
|
|
}
|
|
|
|
|
|
/*********************************************************************/
|