201 lines
8.1 KiB
HTML
201 lines
8.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
</head>
|
|
<body>
|
|
<main>
|
|
|
|
<style>
|
|
.Shot
|
|
{
|
|
transform: perspective(1000px);
|
|
transform-style: preserve-3d;
|
|
width:500px;
|
|
height: 400px;
|
|
margin:20px auto 0 auto;
|
|
text-align:center;
|
|
transition: transform 1s;
|
|
}
|
|
.Shot[show="cover"]{ transform: perspective(1000px) rotateY(110deg); }
|
|
.Shot[show="spine"]{ transform: perspective(1000px) rotateY(180deg); }
|
|
.Shot[show="back" ]{ transform: perspective(1000px) rotateX(-30deg) rotateY(-60deg); }
|
|
.Shot[show="pages"]{ transform: perspective(800px) rotateY(0deg); }
|
|
|
|
.Book
|
|
{
|
|
height:100%;
|
|
transform-style: preserve-3d;
|
|
transform: translateZ(-100px);
|
|
position: relative;
|
|
display:inline-block;
|
|
}
|
|
.Spine
|
|
{
|
|
display:flex;
|
|
justify-content:space-between;
|
|
margin:0 auto;
|
|
position:absolute;
|
|
top:0;
|
|
left:0;
|
|
width:100%;
|
|
height:100%;
|
|
}
|
|
.Spine__Glue
|
|
{
|
|
flex:0;
|
|
width:0;
|
|
height:100%;
|
|
position:relative;
|
|
transform:rotateY(-90deg);
|
|
transform-style: preserve-3d;
|
|
transition: transform 0.8s;
|
|
}
|
|
.Spine__Glue[swing='right']{transform: translateX(-3px) rotateY( -20deg );}
|
|
.Spine__Glue[swing='left' ]{transform: translateX( 3px) rotateY( -160deg );}
|
|
.Panel
|
|
{
|
|
height:100%;
|
|
top:0%;
|
|
float:left;
|
|
position:relative;
|
|
}
|
|
.Spine__Glue[swing='right'] .Panel {box-shadow:3px 0px 2px rgb(0 0 0 / 24%)}
|
|
.Spine__Glue[swing='left' ] .Panel {box-shadow:3px 0px 2px rgb(0 0 0 / 24%)}
|
|
|
|
.Panel.Page
|
|
{
|
|
height:98%;
|
|
top:1%;
|
|
transform:translateX(1px);
|
|
transform-style:preserve-3d;
|
|
}
|
|
.Panel img
|
|
{
|
|
display:block;
|
|
position:relative;
|
|
z-index:1;
|
|
height:100%;
|
|
width:auto;
|
|
backface-visibility: visible;
|
|
transform: rotateY(180deg);
|
|
}
|
|
.Panel img:last-child
|
|
{
|
|
position:absolute;
|
|
top:0;
|
|
left:0;
|
|
backface-visibility: hidden;
|
|
transform: rotateY(0deg);
|
|
}
|
|
.Panel.Flip
|
|
{
|
|
transform-style:preserve-3d;
|
|
transform:rotateY(180deg);
|
|
}
|
|
.Shadow-Sheet-Before::before, .Shadow-Sheet-After::after
|
|
{
|
|
content:" ";
|
|
|
|
background-size: 100% 100%;
|
|
background-position: 0px 0px;
|
|
background-image: conic-gradient(from 0deg at 0% 0%, #00000000 33%, #000000FF 75%);
|
|
|
|
display:block;
|
|
position:absolute;
|
|
z-index:100;
|
|
top:0;
|
|
left:0;
|
|
width:100%;
|
|
height:100%;
|
|
|
|
backface-visibility: hidden;
|
|
}
|
|
.Shadow-Sheet-Before::before
|
|
{
|
|
transform:rotateY(180deg) scaleX(-1);
|
|
}
|
|
.Shadow-Drop-After::after, .Shadow-Drop-Before::before
|
|
{
|
|
transform: rotateX(90deg) translateY(-100px) translateZ(12px);
|
|
box-shadow: 0px 100px 60px black, 0px 100px 20px black;
|
|
display: block;
|
|
position: absolute;
|
|
top: 100%;
|
|
content: " ";
|
|
width: 100%;
|
|
height: 29px;
|
|
border-radius: 39px;
|
|
}
|
|
.Shadow-Radiosity-Before::before, .Shadow-Radiosity-After::after
|
|
{
|
|
content: " ";
|
|
background-size: 100% 100%;
|
|
background-position: 0px 0px;
|
|
background-image: radial-gradient(188% 24% at 50% 82%, #ffffff52 0%, #0000 100%);
|
|
display: block;
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
z-index:100;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
|
|
<div class="Shot" show="cover">
|
|
<div class="Book">
|
|
|
|
<div class="Spine Shadow-Radiosity-Before Shadow-Drop-After">
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Shadow-Radiosity-Before Shadow-Drop-After"><img src="book-panel-front.jpg"/><img src="book-panel-front.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Page Shadow-Sheet-Before Shadow-Sheet-After"><img src="book-page-1.jpg"/><img src="book-page-2.jpg"/></div></div>
|
|
<div class="Spine__Glue" swing="closed"><div class="Panel Flip Shadow-Radiosity-Before Shadow-Drop-After"><img src="book-panel-back.jpg"/><img src="book-panel-back.jpg"/></div></div>
|
|
</div>
|
|
<img style="display:block; height:100%; width:auto; transform:scaleX(-1);" src="book-panel-spine.jpg"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<button onclick="bookPose('cover'); bookClose();">Front</button>
|
|
<button onclick="bookPose('spine'); bookClose();">Spine</button>
|
|
<button onclick="bookPose('back'); bookClose();">Back</button>
|
|
<button onclick="bookPose('pages'); bookOpen(3);">Intro</button>
|
|
<button onclick="bookPose('pages'); bookOpen(4);">Spread 1</button>
|
|
<button onclick="bookPose('pages'); bookOpen(5);">Spread 2</button>
|
|
<button onclick="bookPose('pages'); bookOpen(6);">3</button>
|
|
<button onclick="bookPose('pages'); bookOpen(7);">4</button>
|
|
</div>
|
|
</main>
|
|
<script>
|
|
let $ = query => Array.from(document.querySelectorAll(query));
|
|
let pages = $("[swing]");
|
|
let table = $(".Shot")[0];
|
|
let bookOpen = index =>
|
|
{
|
|
pages.forEach((p, i)=> p.setAttribute("swing", i>index ? "right" : "left") );
|
|
};
|
|
let bookClose = () =>
|
|
{
|
|
pages.forEach(p=>p.setAttribute("swing", "closed"));
|
|
};
|
|
let bookPose = inPanel =>
|
|
{
|
|
table.setAttribute("show", inPanel);
|
|
bookClose();
|
|
};
|
|
</script>
|
|
</body>
|
|
</html> |