ShuangGou.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <div class="shuang-gou-page">
  3. <img
  4. class="bg"
  5. src="@/assets/images/shuang-gou-bg.jpg"
  6. alt=""
  7. draggable="false"
  8. >
  9. <BtnBack
  10. :text-shadow="true"
  11. @click="router.go(-1)"
  12. />
  13. <HotspotComp
  14. class="hotspot-1"
  15. :style="{
  16. left: hotspot1X + 'px',
  17. top: hotspot1Y + 'px',
  18. }"
  19. @click="onClickHotspot(1)"
  20. />
  21. <HotspotComp
  22. class="hotspot-2"
  23. :style="{
  24. left: hotspot2X + 'px',
  25. top: hotspot2Y + 'px',
  26. }"
  27. @click="onClickHotspot(2)"
  28. />
  29. <div class="title">
  30. <h1>双钩设色</h1>
  31. </div>
  32. <div class="text">
  33. <p><span>双钩</span>,中国画技法名。用线条钩描物象的轮廓,通称“勾勒”,因基本上是用左右或上下两笔钩描合拢,故亦称“双钩”。大部用于工笔花鸟画。又旧时摹搨法书。沿字的笔迹两边用细劲的墨线钩出轮廓,也叫“双钩”;双钩后填墨的称为“双钩廓填”。</p>
  34. <p><span>设色</span>,国画中晕染彩色的意思,画面中只要出现彩色就可以说是设色作品。与设色相反的是“水墨”,指画面中不出现彩色,或者极少出现彩色的,以墨色为主绘制的作品。</p>
  35. </div>
  36. <button
  37. class="play-video"
  38. @click="isShowVideos = true"
  39. >
  40. <img
  41. class="icon-normal"
  42. src="@/assets/images/btn-play-video.png"
  43. alt=""
  44. draggable="false"
  45. >
  46. <img
  47. class="icon-active"
  48. src="@/assets/images/btn-play-video-active.png"
  49. alt=""
  50. draggable="false"
  51. >
  52. <span>观看视频</span>
  53. </button>
  54. <div
  55. v-if="isShowVideos"
  56. class="videos"
  57. >
  58. <BtnBack @click="isShowVideos=false" />
  59. <video
  60. v-if="activeVideoIdx === 0"
  61. src="@/assets/videos/shuang-gou.mp4"
  62. controls
  63. autoplay
  64. playsinline
  65. webkit-playsinline="true"
  66. x5-video-player-type="h5"
  67. />
  68. <video
  69. v-if="activeVideoIdx === 1"
  70. src="@/assets/videos/she-se.mp4"
  71. controls
  72. autoplay
  73. playsinline
  74. webkit-playsinline="true"
  75. x5-video-player-type="h5"
  76. />
  77. <menu>
  78. <button
  79. :class="{
  80. active: activeVideoIdx === 0
  81. }"
  82. @click="activeVideoIdx = 0"
  83. >
  84. 双钩
  85. </button>
  86. <button
  87. :class="{
  88. active: activeVideoIdx === 1
  89. }"
  90. @click="activeVideoIdx = 1"
  91. >
  92. 设色
  93. </button>
  94. </menu>
  95. </div>
  96. </div>
  97. </template>
  98. <script setup>
  99. import { ref, computed, watch, onMounted, onBeforeUnmount, inject } from "vue"
  100. import { useRoute, useRouter } from "vue-router"
  101. import { useStore } from "vuex"
  102. import useSizeAdapt from '@/useFunctions/useSizeAdapt.js'
  103. import { useWindowSize } from "@vueuse/core"
  104. const route = useRoute()
  105. const router = useRouter()
  106. const store = useStore()
  107. const {
  108. windowSizeInCssForRef,
  109. windowSizeWhenDesignForRef,
  110. } = useSizeAdapt()
  111. const $env = inject('$env')
  112. const { width: windowWidth, height: windowHeight } = useWindowSize()
  113. const windowHeightDesign = 1080 - 71 - 37 // 设计稿里视口高度。注意要减去上下边栏
  114. const hotspot1X = ref(-100)
  115. const hotspot1Y = ref(-100)
  116. const hotspot2X = ref(-100)
  117. const hotspot2Y = ref(-100)
  118. function setHotspotPos() {
  119. const { x: x1, y: y1 } = utils.mapPosFromDraftToWindow({ x: 484, y: 420 }, 'cover', 1920, 972)
  120. hotspot1X.value = x1
  121. hotspot1Y.value = y1
  122. const { x: x2, y: y2 } = utils.mapPosFromDraftToWindow({ x: 214, y: 700 }, 'cover', 1920, 972)
  123. hotspot2X.value = x2
  124. hotspot2Y.value = y2
  125. }
  126. setHotspotPos()
  127. onMounted(() => {
  128. window.addEventListener('resize', setHotspotPos)
  129. })
  130. onBeforeUnmount(() => {
  131. window.removeEventListener('resize', setHotspotPos)
  132. })
  133. const isShowVideos = ref(false)
  134. function onClickHotspot(idx) {
  135. if (idx === 1) {
  136. router.push({
  137. name: 'PaintingDetailForZhuQin',
  138. })
  139. } else if (idx === 2) {
  140. router.push({
  141. name: 'PaintingDetailForTaoZhu',
  142. })
  143. }
  144. }
  145. const activeVideoIdx = ref(0)
  146. </script>
  147. <style lang="less" scoped>
  148. .shuang-gou-page{
  149. position: absolute;
  150. left: 0;
  151. top: 0;
  152. width: 100%;
  153. height: 100%;
  154. background-color: #fff;
  155. >img.bg{
  156. position: absolute;
  157. top: 0;
  158. left: 0;
  159. height: 100%;
  160. width: 100%;
  161. object-fit: cover;
  162. }
  163. >.hotspot-1, .hotspot-2{
  164. position: absolute;
  165. }
  166. @media (max-aspect-ratio: 855/835) {
  167. .hotspot-1{
  168. left: 2vw !important;
  169. }
  170. }
  171. @media (max-aspect-ratio: 1310/835) {
  172. .hotspot-2{
  173. left: 2vw !important;
  174. }
  175. }
  176. >.title{
  177. position: absolute;
  178. top: 8.13vh;
  179. left: calc(47vw + 17.9vh + 7.61vh + 28.40vh + 14.51vh);
  180. position: absolute;
  181. >h1{
  182. flex: 0 0 auto;
  183. writing-mode: vertical-lr;
  184. font-family: KingHwa_OldSong, KingHwa_OldSong;
  185. font-weight: 400;
  186. font-size: calc(60px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  187. color: #474747;
  188. letter-spacing: 0.2em;
  189. }
  190. @media (max-aspect-ratio: 1250/835) {
  191. left: initial;
  192. right: 3vw;
  193. }
  194. }
  195. >.text{
  196. position: absolute;
  197. left: 47vw;
  198. top: 50%;
  199. transform: translateY(-50%);
  200. width: 61.86vh;
  201. @media (max-aspect-ratio: 1250/835) {
  202. left: initial;
  203. right: 11vw;
  204. }
  205. >p{
  206. font-size: calc(30px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  207. line-height: calc(36px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  208. text-indent: 2em;
  209. font-family: KaiTi, KaiTi;
  210. font-weight: 400;
  211. color: #707F48;
  212. >span{
  213. font-family: KaiTi, KaiTi;
  214. font-weight: 400;
  215. color: #707F48;
  216. font-size: calc(42px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  217. line-height: calc(50px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  218. }
  219. }
  220. >p:nth-of-type(2) {
  221. margin-top: 10vh;
  222. }
  223. }
  224. >button.play-video{
  225. position: absolute;
  226. bottom: calc(37px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  227. right: calc(33px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  228. display: flex;
  229. flex-direction: column;
  230. align-items: center;
  231. >img{
  232. width: calc(48px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  233. height: calc(48px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  234. margin-bottom: calc(14px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  235. }
  236. >img.icon-normal{
  237. display: block;
  238. }
  239. >img.icon-active{
  240. display: none;
  241. }
  242. >span{
  243. font-family: KaiTi, KaiTi;
  244. font-weight: 400;
  245. font-size: calc(20px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  246. color: #7B916B;
  247. line-height: calc(23px / v-bind('windowHeightDesign') * v-bind('windowHeight'));
  248. }
  249. }
  250. >button.play-video:hover{
  251. >img.icon-normal{
  252. display: none;
  253. }
  254. >img.icon-active{
  255. display: block;
  256. }
  257. }
  258. >.videos{
  259. position: absolute;
  260. left: 0;
  261. top: 0;
  262. width: 100%;
  263. height: 100%;
  264. background: rgba(52,73,46,0.7);
  265. backdrop-filter: blur(10px);
  266. >video{
  267. position: absolute;
  268. left: 50%;
  269. top: 50%;
  270. transform: translate(-50%, -50%);
  271. width: calc(1255 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  272. height: calc(735 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  273. object-fit: contain;
  274. background: black;
  275. }
  276. >menu{
  277. position: absolute;
  278. top: 50%;
  279. right: 0;
  280. transform: translateY(-50%);
  281. display: flex;
  282. flex-direction: column;
  283. justify-content: center;
  284. align-items: center;
  285. gap: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  286. width: calc(334 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  287. >button{
  288. width: calc(240 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  289. height: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  290. font-family: KingHwa_OldSong, KingHwa_OldSong;
  291. font-weight: 400;
  292. font-size: calc(30 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  293. color: #FFFFFF;
  294. line-height: calc(35 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  295. }
  296. >button.active{
  297. font-family: KingHwa_OldSong, KingHwa_OldSong;
  298. font-weight: 400;
  299. font-size: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  300. color: #72806D;
  301. line-height: calc(47 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  302. background-image: url(@/assets/images/btn_bg-yellow.png);
  303. background-size: cover;
  304. background-repeat: no-repeat;
  305. background-position: center center;
  306. }
  307. }
  308. }
  309. }
  310. </style>