css-3d-book/index.html
2021-08-11 09:35:40 -04:00

74 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
figure
{
width:500px;
height:500px;
transform: perspective(400px);
transform-style: preserve-3d;
}
.Sheet
{
display:block;
width:120px;
height:200px;
border:2px solid black;
position:relative;
transform:rotateY(45deg);
transform-style: preserve-3d;
transform-origin: left center;
}
.Sheet img
{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
backface-visibility: hidden;
}
.Sheet img:last-child
{
transform: rotateY(180deg);
}
</style>
</head>
<body>
<main>
<div style="display:flex; justify-content:space-between; width:50px; height:200px;">
<div style="flex:0; width:1px; height:100%; border:1px solid blue; position:relative;"><div style="float:left;"><img style="height:100%; width:auto;" src="http://placekitten.com/120/200"/></div></div>
<div style="flex:0; width:1px; height:100%; border:1px solid blue; position:relative;"><div style="float:left;"><img style="height:100%; width:auto;" src="http://placekitten.com/120/200"/></div></div>
<div style="flex:0; width:1px; height:100%; border:1px solid blue; position:relative;"><div style="float:left;"><img style="height:100%; width:auto;" src="http://placekitten.com/120/200"/></div></div>
</div>
<div style="float:left; width:20px; height:200px; border:1px solid blue;">
<div style="float:left;">
<img style="height:100%; width:auto;" src="http://placekitten.com/120/200"/>
</div>
</div>
<div style="float:left; width:20px; height:200px; border:1px solid blue;">
<div style="float:left;">
<img style="height:100%; width:auto;" src="http://placekitten.com/120/200"/>
</div>
</div>
<div style="clear:left;"></div>
<figure>
<div class="Sheet"><img src=" http://placekitten.com/120/200" alt="cover front"/>
<img src="http://via.placeholder.com/120x200" alt="cover back "/></div>
<div class="Sheet"><img src=" http://placekitten.com/120/200" alt="cover front"/>
<img src="http://via.placeholder.com/120x200" alt="cover back "/></div>
<div class="Sheet"><img src=" http://placekitten.com/120/200" alt="cover front"/>
<img src="http://via.placeholder.com/120x200" alt="cover back "/></div>
<div class="Sheet"><img src=" http://placekitten.com/120/200" alt="cover front"/>
<img src="http://via.placeholder.com/120x200" alt="cover back "/></div>
</figure>
</main>
<script>
</script>
</body>
</html>