section3.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="section section3" data-anchor="section3">
  3. <canvas id="canvas"></canvas>
  4. <div class="can-scroll" style="">
  5. <div style="width: 100%; height: 14000px"></div>
  6. <!-- <div class="wwmap hide active" id="videocont-map">
  7. <img src="/img/map/map-rnsys.webp" alt="" />
  8. </div>
  9. <div class="wwintrobox wwintrobox-shadow hide active" id="videocont1-1">
  10. <div class="wwtitle">人鸟兽玉饰</div>
  11. <div class="wwintro">
  12. 原本湖绿色<b>玉质</b>在埋藏千年后<br />已焕发出带有<b>柔和光泽</b>的<br /><b
  13. >白色斑纹</b
  14. >。
  15. </div>
  16. </div>
  17. <div class="wwinfobox hide active" id="videocont1-2">
  18. <div class="wwinfo">良渚文化早期</div>
  19. <div class="wwinfo">南京博物院藏</div>
  20. <div class="wwinfo">
  21. 端饰长5.5厘米,宽1.3厘米,厚0.2厘米-0.4厘米,孔径0.3厘米
  22. </div>
  23. <div class="wwinfo">1991年江苏省昆山市赵陵山遗址出土</div>
  24. </div>
  25. <div class="wwintrobox wwintrobox-shadow hide" id="videocont1-3">
  26. <div class="wwtitle2">飞鸟</div>
  27. <div class="wwintro3">
  28. 飞鸟悠闲驻足于一位跪状显贵者长长的发冠上;鸟的身下,人双手举托起的四足短尾小兽奋力向上攀爬。鸟,遨游云端,上下翻飞,先民深信它们是通天的生灵;
  29. </div>
  30. </div>
  31. <div class="wwintrobox wwintrobox-shadow hide" id="videocont1-4">
  32. <div class="wwtitle2">兽</div>
  33. <div class="wwintro3">兽,奔跑原野,下穿三泉,是大地的主人;</div>
  34. </div>
  35. <div class="wwintrobox wwintrobox-shadow hide" id="videocont1-5">
  36. <div class="wwtitle2">人</div>
  37. <div class="wwintro3">
  38. 人,立于天地之间,与生俱来地拥有智慧而承担起沟通天地的桥梁。
  39. </div>
  40. </div> -->
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { onMounted, onUnmounted } from "vue";
  46. import { emitter } from "../emitter.js";
  47. import { CanvasPlayer } from "../utils/canvasPlayer.js";
  48. const setting = [
  49. {
  50. name: "人鸟兽",
  51. sectionType: 3,
  52. className: ["canvas", ".scroll-container", ".section3 .fp-scrollable"],
  53. canvas: null,
  54. context: null,
  55. imageUrl: "./img/canvas/rsy",
  56. dots: [],
  57. total: 298,
  58. CA: [
  59. {
  60. name: "#videocont1-1",
  61. start: 112,
  62. end: 158,
  63. },
  64. {
  65. name: "#videocont-map",
  66. start: 112,
  67. end: 298,
  68. },
  69. {
  70. name: "#videocont1-2",
  71. start: 130,
  72. end: 158,
  73. },
  74. {
  75. name: "#videocont1-3",
  76. start: 162,
  77. end: 195,
  78. },
  79. {
  80. name: "#videocont1-4",
  81. start: 196,
  82. end: 233,
  83. },
  84. {
  85. name: "#videocont1-5",
  86. start: 245,
  87. end: 298,
  88. },
  89. ],
  90. },
  91. {
  92. name: "金蝉玉叶",
  93. sectionType: 54,
  94. className: ["canvas1", ".scroll-container1", ".jinchanyuye .fp-scrollable"],
  95. canvas: null,
  96. context: null,
  97. imageUrl: "./img/canvas/jcyy",
  98. dots: [],
  99. total: 288,
  100. CA: [
  101. {
  102. name: "#videocont2-1",
  103. start: 74,
  104. end: 116,
  105. },
  106. {
  107. name: "#videocont2-map",
  108. start: 74,
  109. end: 116,
  110. },
  111. {
  112. name: "#videocont2-2",
  113. start: 84,
  114. end: 116,
  115. },
  116. {
  117. name: "#videocont2-3",
  118. start: 84,
  119. end: 116,
  120. },
  121. {
  122. name: "#videocont2-4",
  123. start: 120,
  124. end: 181,
  125. },
  126. {
  127. name: "#videocont2-5",
  128. start: 194,
  129. end: 242,
  130. },
  131. ],
  132. },
  133. ];
  134. const props = defineProps({
  135. fullpage: Object,
  136. });
  137. const player = new CanvasPlayer("canvas", setting);
  138. const handler = ({ index: currentIndex, nextIndex }) => {
  139. const { index } = nextIndex;
  140. if (index === 2) {
  141. console.log("fullpage", props.fullpage.api);
  142. props.fullpage.api.setAllowScrolling(false);
  143. player.enableScroll(3);
  144. } else {
  145. props.fullpage.api.setAllowScrolling(true);
  146. }
  147. };
  148. onMounted(() => {
  149. emitter.on("onLeave", handler);
  150. player.init();
  151. player.on("loaded", () => {
  152. console.log("所有图片完成");
  153. });
  154. window.player = player;
  155. });
  156. onUnmounted(() => {
  157. emitter.off("onLeave", handler);
  158. });
  159. </script>
  160. <style lang="scss" scoped>
  161. @import "/src/assets/style/index.css";
  162. #canvas {
  163. position: absolute;
  164. top: 0;
  165. z-index: 0;
  166. }
  167. .can-scroll {
  168. // background: white;
  169. width: 100%;
  170. overflow-y: scroll;
  171. position: relative;
  172. overflow-x: hidden;
  173. z-index: 10;
  174. }
  175. .section {
  176. position: relative;
  177. }
  178. .section3 {
  179. display: flex;
  180. flex-flow: column;
  181. align-items: center;
  182. line-height: 2;
  183. color: #997946;
  184. justify-content: center;
  185. background: url(/img/section2/bg.webp) no-repeat center/cover;
  186. -webkit-box-pack: center;
  187. -ms-flex-pack: center;
  188. -webkit-box-align: center;
  189. -ms-flex-align: center;
  190. .wwmap {
  191. position: absolute;
  192. top: 5vh !important;
  193. right: 5vw;
  194. left: auto;
  195. width: auto !important;
  196. text-align: right;
  197. }
  198. }
  199. </style>