js+css实现电子书翻页阅读效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现电子书翻页阅读效果代码

代码标签: js cs 电子书 翻页 阅读

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Georgia", serif;
  background: linear-gradient(135deg, #8b4513, #a0522d);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.reader-container {
  background: transparent;
  max-width: 1200px;
  width: 100%;
  position: relative;
}

.controls {
  background: rgba(139, 69, 19, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 10px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-group label {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.slider {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.book-container {
  height: 700px;
  position: relative;
  perspective: 2000px;
  background: var(--bg-color, #faf7f0);
  border-radius: 0 0 15px 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.book {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  display: flex;
}

.book-spread {
  width: 100%;
  height: 100%;
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
}

.page-left,
.page-right {
  width: calc(50% - 20px);
  height: 100%;
  background: var(--bg-color, #faf7f0);
  padding: 50px 40px 80px 40px;
  position: relative;
}

.page-left {
  margin-right: 10px;
  border-radius: 0 8px 8px 0;
  background: radial-gradient(
      ellipse 100px 300px at 100% 50%,
      rgba(139, 69, 19, 0.03) 0%,
      transparent 50%
    ),
    linear-gradient(
      to right,
      var(--bg-color, #faf7f0) 0%,
      rgba(139, 69, 19, 0.01) 95%,
      rgba(139, 69, 19, 0.05) 100%
    ),
    var(--bg-color, #faf7f0);
  box-shadow: inset -8px 0 20px -10px rgba(139, 69, 19, 0.1),
    inset -2px 0 5px -2px rgba(139, 69, 19, 0.05);
  transform-origin: right center;
  transform: perspective(1000px) rotateY(-1deg);
}

.page-right {
  margin-left: 10px;
  border-radius: 8px 0 0 8px;
  background: radial-gradient(
      ellipse 100px 300px at 0% 50%,
      rgba(139, 69, 19, 0.03) 0%,
      transparent 50%
    ),
    linear-gradient(
      to left,
      var(--bg-color, #faf7f0) 0%,
      rgba(139, 69, 19, 0.01) 95%,
      rgba(139, 69, 19, 0.05) 100%
    ),
    var(--bg-color, #faf7f0);
  box-shadow: inset 8px 0 20px -10px rgba(139, 69, 19, 0.1),
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0