index.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <script type="text/javascript" src="jquery.min.1.7.js"></script>
  8. <script type="text/javascript" src="turn.min.js"></script>
  9. </head>
  10. <body>
  11. <style>
  12. body {
  13. display: flex;
  14. justify-content: center;
  15. align-items: center;
  16. height: 100vh;
  17. }
  18. #filipbook {
  19. margin-top: 20px;
  20. }
  21. .animated {
  22. -webkit-transition: margin-left 0.2s ease-in-out;
  23. -moz-transition: margin-left 0.2s ease-in-out;
  24. -o-transition: margin-left 0.2s ease-in-out;
  25. -ms-transition: margin-left 0.2s ease-in-out;
  26. transition: margin-left 0.2s ease-in-out;
  27. }
  28. .page {
  29. background: white;
  30. -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  31. -moz-box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  32. -ms-box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  33. -o-box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  34. box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  35. }
  36. .shadow {
  37. -webkit-transition: -webkit-box-shadow 0.5s;
  38. -moz-transition: -moz-box-shadow 0.5s;
  39. -o-transition: -webkit-box-shadow 0.5s;
  40. -ms-transition: -ms-box-shadow 0.5s;
  41. -webkit-box-shadow: 0 0 20px #ccc;
  42. -moz-box-shadow: 0 0 20px #ccc;
  43. -o-box-shadow: 0 0 20px #ccc;
  44. -ms-box-shadow: 0 0 20px #ccc;
  45. box-shadow: 0 0 20px #ccc;
  46. }
  47. .even .gradient {
  48. position: absolute;
  49. top: 0;
  50. left: 0;
  51. width: 100%;
  52. height: 100%;
  53. background-image: url(./pics/right-border.png);
  54. background-position: right top;
  55. background-repeat: repeat-y;
  56. }
  57. .odd .gradient {
  58. position: absolute;
  59. top: 0;
  60. left: 0;
  61. width: 100%;
  62. height: 100%;
  63. background-image: url(./pics/left-border.png);
  64. background-position: left top;
  65. background-repeat: repeat-y;
  66. }
  67. .page-wrapper {
  68. -webkit-perspective: 2000px;
  69. -moz-perspective: 2000px;
  70. -ms-perspective: 2000px;
  71. perspective: 2000px;
  72. }
  73. </style>
  74. <div class="contianer">
  75. <div id="flipbook" class="animated">
  76. <div class="page">
  77. <img style="width: 100%; height: 100%; object-fit: cover;"
  78. src="https://gyt.ks3-cn-beijing.ksyuncs.com/1688969499129.png" />
  79. </div>
  80. <div class="page">
  81. <div class="gradient"></div>2
  82. </div>
  83. <div class="page">
  84. <div class="gradient"></div>3
  85. </div>
  86. <div class="page">
  87. <div class="gradient"></div>4
  88. </div>
  89. <div class="page">
  90. <div class="gradient"></div>5
  91. </div>
  92. <div class="page">
  93. <div class="gradient"></div>6
  94. </div>
  95. <div class="page">
  96. <div class="gradient"></div>7
  97. </div>
  98. <div class="page">
  99. <div class="gradient"></div>8
  100. </div>
  101. <div class="page">
  102. <div class="gradient"></div>9
  103. </div>
  104. <div class="page">
  105. <div class="gradient"></div>10
  106. </div>
  107. <div class="page">
  108. <div class="gradient"></div>11
  109. </div>
  110. </div>
  111. </div>
  112. <script>
  113. $('#flipbook').turn({
  114. autoCenter: true,
  115. duration: 1000,
  116. acceleration: true, // 是否启动硬件加速 如果为触摸设备必须为true
  117. pages: 11, // 页码总数
  118. elevation: 50, // 转换期间页面的高度
  119. width: window.screen.height * .8 * (3 / 4) * 2, // 宽度 单位 px
  120. height: window.screen.height * .8, // 高度 单位 px
  121. gradients: true, // 是否显示翻页阴影效果
  122. // display: 'single', //设置单页还是双页
  123. });
  124. </script>
  125. </body>
  126. </html>