东篱词选
<style>
.book {
left: -180px;
display: flex;
align-items: center;
width: 1000px;
height: 500px;
perspective: 1000px;
cursor: pointer;
padding: 10px;
position: relative;
background: rgba(0,0,0,.0);
}
.page {
background: #FFFFFF;
padding: 0px;
width: 392px;
height: 577px;
left: 50%;
border-left: 1px solid #DCDCDC;
transform-origin: left;
box-shadow: inset 0px 0px 2px rgba(0,0,0,.5), 1px 1px 12px rgba(255,255,255,.8);
transform-style: preserve-3d;
position: absolute;
}
.page div:nth-child(1) {}
.page div:nth-child(2) { display: none; }
@keyframes rot1{
from { transform: rotateY(0deg); }
to { transform: rotateY(-180deg); }
}
@keyframes rot2{
from { transform: rotateY(-180deg); }
to { transform: rotateY(0deg); }
}
</style>
<div class="book">
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpYSde.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpYEsf.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpYmdg.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpYNo4.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpYI6P.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpY7m8.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpYLkQ.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpYXfs.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpYz60.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/Opt9mT.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/Opt0Ag.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/Opts9s.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OptT3R.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpNn8s.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpN1bT.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpNtPJ.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpNhsP.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpN4qf.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpNodS.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpNTIg.jpg" alt="" /></div>
</div>
<div class="page">
<div><img src="https://s1.ax1x.com/2022/04/30/OpUSdU.jpg" alt="" /></div>
<div><img src="https://s1.ax1x.com/2022/04/30/OpUiW9.jpg" alt="" /></div>
</div>
<script>
let page = document.querySelectorAll(".page");
let idx = 0;
let all = page.length;
let currentPage = 0;
setzIdx();
document.querySelector(".book").onclick = function(){
if(idx == 0){ //前翻
page.style.animation = "rot1 .5s linear forwards";
page.children.style.display = "none";
page.children.style.display = "block";
page.children.style.transform = "rotateY(-180deg)";
currentPage ++;
if(currentPage == all){
idx = 1;
currentPage = all - 1;
}
} else { //后翻
page.style.animation = "rot2 .5s linear forwards";
page.children.style.display = "none";
page.children.style.display = "block";
page.children.style.transform = "rotateY(0deg)";
currentPage --;
if(currentPage < 0){
idx = 0;
currentPage = 0;
}
}
setzIdx();
}
function setzIdx(){
for(j=currentPage; j<all; j++){
page.style.zIndex = all - j;
}
for(j=0; j<currentPage;j++) {
page.style.zIndex = j + 1;
}
if(currentPage == all - 1) page.style.zIndex = all;
}
</script>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=1 height=1 src="//music.163.com/outchain/player?type=2&id=5241799&auto=1&height=66"></iframe><br><br><br>
真是太有才了 这帖子太漂亮了{:10_402:} 非常佩服啊 我要收藏 主题好精致 这算不算电子杂志? 夏天啦!还是这身棉袄。 这个只能仰望 哇,厉害,仰视一下
页:
[1]
2