js+css模拟逼真书本翻页交互显示代码
代码语言:html
所属分类:拖放
代码描述:js+css模拟逼真书本翻页交互显示代码,右下角点击拖动翻页。
代码标签: js css 模拟 逼真 书本 翻页 交互 显示 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
min-height: 100vh;
background-color: #333;
font-family: sans-serif;
margin: 0;
}
:root {
--width: min(1000px, 80vw);
--height: 80vh;
}
.container {
overflow: clip;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.book-container {
width: var(--width);
height: var(--height);
position: relative;
background: #f0f0f0;
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
cursor: grab;
touch-action: none;
}
.book-container:active {
cursor: grabbing;
}
.page {
width: calc(var(--width) / 2);
height: var(--height);
position: absolute;
top: 0;
padding: 40px;
box-sizing: border-box;
background-color: #fff;
user-select: none;
background-image: linear-gradient(to left, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0) 8%);
}
/* Internal spine shadows applied directly to the pages */
#left-front, #left-under {
left: 0;
background-image: linear-gradient(to left, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0) 8%);
}
#right-front, #right-under {
left: 50%;
background-image: linear-gradient(to right, rgba.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0