BambooBookScene1.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <script setup>
  2. import { ref, onMounted } from "vue"
  3. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  4. const { windowSizeInCssForRef, windowSizeWhenDesignForRef } = useSizeAdapt()
  5. const isShowOperationTip = ref(true)
  6. const lastX = ref(0)
  7. // 开始滑动
  8. const handletouchstart = (event) => {
  9. isShowOperationTip.value = false
  10. lastX.value = event.changedTouches[0].pageX
  11. }
  12. // 监听活动
  13. const touchEnd = (event) => {
  14. let currentX = event.changedTouches[0].pageX
  15. let tx = currentX - lastX.value
  16. if (tx < 0) {
  17. emit("slide-right")
  18. } else if (tx > 0) {
  19. emit("slide-left")
  20. }
  21. }
  22. // const onSwipeLeft = () => {
  23. // emit('slide-right')
  24. // }
  25. // const onSwipeRight = () => {
  26. // emit('slide-left')
  27. // }
  28. const emit = defineEmits(["slide-right", "slide-left", "close"])
  29. const x = window.innerHeight / 1018
  30. const innerWidth = ref((15523 / 33) * x + "px")
  31. const innerHeight = ref(window.innerHeight + "px")
  32. </script>
  33. <template>
  34. <div
  35. class="screen-box"
  36. @touchstart="handletouchstart($event)"
  37. @touchend="touchEnd($event)"
  38. >
  39. <!-- 竹叶序列帧 -->
  40. <div class="xuliezheng-box">
  41. <div class="xuliezheng" />
  42. </div>
  43. <div class="screen-box1">
  44. <div class="title-box">
  45. 芥子园画谱
  46. </div>
  47. <div class="zhupu-box">
  48. 竹谱
  49. </div>
  50. <OperationTip
  51. class="operation-h"
  52. text=""
  53. direction="h"
  54. :is-show="isShowOperationTip"
  55. />
  56. <!-- <img
  57. class="disc-img"
  58. src="@/assets/images/zhupu-disc.png"
  59. alt=""
  60. > -->
  61. <div class="text">
  62. 《芥子园画传》又称《芥子园画谱》是清代绘画技法图谱,它较系统地介绍了中国画的基本技法。清代文学家李渔曾在南京营造“芥子园”,并支持其婿沈心友及王氏三兄弟(王概、王著、王臬)编绘画谱,故成书出版之时便以此园命名。
  63. </div>
  64. <div class="system-btns">
  65. <BtnBack
  66. :color="`green`"
  67. @click="emit('close')"
  68. />
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <style lang="less" scoped>
  74. .screen-box {
  75. width: 100%;
  76. height: 100%;
  77. position: absolute;
  78. top: 0;
  79. left: 0;
  80. .xuliezheng-box {
  81. width: 300px;
  82. height: v-bind(innerHeight);
  83. overflow: hidden;
  84. position: absolute;
  85. bottom: 0;
  86. right: 0;
  87. .xuliezheng {
  88. width: calc(v-bind(innerWidth));
  89. // max-width: 30px;
  90. height: v-bind(innerHeight);
  91. background-image: url(@/assets/images/zhupu-min.png);
  92. background-size: cover;
  93. position: absolute;
  94. bottom: 0;
  95. right: 0;
  96. background-position-x: 0;
  97. background-repeat: no-repeat;
  98. animation-name: xuliezhen-animation;
  99. animation-timing-function: steps(33);
  100. animation-duration: 4s;
  101. animation-iteration-count: infinite;
  102. transition-property: bottom;
  103. @keyframes xuliezhen-animation {
  104. 0% {
  105. background-position-x: 0;
  106. }
  107. 100% {
  108. background-position-x: calc(100% - v-bind(innerWidth));
  109. }
  110. }
  111. }
  112. }
  113. .screen-box1 {
  114. width: 100%;
  115. height: 100%;
  116. background-image: url(@/assets/images/bg_zhupu.png);
  117. background-size: 100% 100%;
  118. writing-mode: vertical-rl;
  119. /* 垂直排列,从右向左 */
  120. direction: rtl;
  121. .title-box {
  122. color: #ffffff;
  123. font-size: calc(
  124. 48 / v-bind("windowSizeWhenDesignForRef") *
  125. v-bind("windowSizeInCssForRef")
  126. );
  127. line-height: calc(
  128. 56 / v-bind("windowSizeWhenDesignForRef") *
  129. v-bind("windowSizeInCssForRef")
  130. );
  131. position: absolute;
  132. font-family: "KingHwa_OldSong";
  133. letter-spacing: 0.3em;
  134. top: calc(
  135. 95 / v-bind("windowSizeWhenDesignForRef") *
  136. v-bind("windowSizeInCssForRef")
  137. );
  138. // right: calc(50 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  139. right: 13%;
  140. }
  141. .zhupu-box {
  142. color: #ffffff;
  143. font-size: calc(
  144. 24 / v-bind("windowSizeWhenDesignForRef") *
  145. v-bind("windowSizeInCssForRef")
  146. );
  147. line-height: calc(
  148. 28 / v-bind("windowSizeWhenDesignForRef") *
  149. v-bind("windowSizeInCssForRef")
  150. );
  151. position: absolute;
  152. font-family: "KingHwa_OldSong";
  153. letter-spacing: 0.3em;
  154. top: 50%;
  155. right: 20%;
  156. // right: calc(75 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  157. }
  158. > .operation-h {
  159. position: absolute;
  160. right: 14%;
  161. // right: calc(55 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  162. bottom: 35%;
  163. width: calc(
  164. 50 / v-bind("windowSizeWhenDesignForRef") *
  165. v-bind("windowSizeInCssForRef")
  166. );
  167. }
  168. > .disc-img {
  169. width: calc(
  170. 151 / v-bind("windowSizeWhenDesignForRef") *
  171. v-bind("windowSizeInCssForRef")
  172. );
  173. height: calc(
  174. 456 / v-bind("windowSizeWhenDesignForRef") *
  175. v-bind("windowSizeInCssForRef")
  176. );
  177. position: absolute;
  178. left: calc(
  179. 75 / v-bind("windowSizeWhenDesignForRef") *
  180. v-bind("windowSizeInCssForRef")
  181. );
  182. top: calc(
  183. 153 / v-bind("windowSizeWhenDesignForRef") *
  184. v-bind("windowSizeInCssForRef")
  185. );
  186. // left: 12%;
  187. // margin-right: calc(170 /v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  188. // margin-bottom: calc(250 /v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  189. }
  190. > .text {
  191. width: calc(
  192. 170 / v-bind("windowSizeWhenDesignForRef") *
  193. v-bind("windowSizeInCssForRef")
  194. );
  195. height: calc(
  196. 456 / v-bind("windowSizeWhenDesignForRef") *
  197. v-bind("windowSizeInCssForRef")
  198. );
  199. position: absolute;
  200. left: calc(
  201. 75 / v-bind("windowSizeWhenDesignForRef") *
  202. v-bind("windowSizeInCssForRef")
  203. );
  204. top: calc(
  205. 153 / v-bind("windowSizeWhenDesignForRef") *
  206. v-bind("windowSizeInCssForRef")
  207. );
  208. font-size: calc(
  209. 20 / v-bind("windowSizeWhenDesignForRef") *
  210. v-bind("windowSizeInCssForRef")
  211. );
  212. line-height: calc(
  213. 30 / v-bind("windowSizeWhenDesignForRef") *
  214. v-bind("windowSizeInCssForRef")
  215. );
  216. text-indent: 2em;
  217. color: #7b916b;
  218. font-family: "KaiTi";
  219. writing-mode: initial;
  220. direction: ltr;
  221. }
  222. > .system-btns {
  223. width: 100%;
  224. // padding: 0
  225. // calc(
  226. // 20 / v-bind(windowSizeWhenDesignForRef) *
  227. // v-bind(windowSizeInCssForRef)
  228. // );
  229. // display: flex;
  230. // flex-direction: column;
  231. // justify-content: space-between;
  232. // position: absolute;
  233. // bottom: calc(
  234. // 20 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef)
  235. // );
  236. // z-index: 2;
  237. }
  238. }
  239. }
  240. </style>