CommonMarkBody.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div
  3. ref="dragContainer"
  4. class="mark-body-container tw-flex-auto tw-p-2 tw-relative"
  5. >
  6. <div
  7. v-if="!store.currentTask"
  8. class="tw-text-center empty-task tw-flex tw-flex-col tw-place-items-center tw-justify-center"
  9. >
  10. <img src="./images/empty-task.png" />
  11. {{ store.message }}
  12. </div>
  13. <div
  14. v-else-if="store.isScanImage"
  15. :style="{ width: answerPaperScale }"
  16. :class="[`rotate-board-${rotateBoard}`]"
  17. >
  18. <div
  19. v-for="(item, index) in sliceImagesWithTrackList"
  20. :key="index"
  21. class="single-image-container"
  22. >
  23. <img
  24. :src="item.url"
  25. draggable="false"
  26. @click="(event) => innerMakeTrack(event, item)"
  27. @contextmenu="showBigImage"
  28. />
  29. <MarkDrawTrack
  30. :trackList="item.trackList"
  31. :specialTagList="item.tagList"
  32. :sliceImageWidth="item.sliceImageWidth"
  33. :sliceImageHeight="item.sliceImageHeight"
  34. :dx="item.dx"
  35. :dy="item.dy"
  36. />
  37. <hr class="image-seperator" />
  38. </div>
  39. </div>
  40. <div v-else-if="store.isMultiMedia">
  41. <MultiMediaMarkBody />
  42. </div>
  43. <div v-else>impossible</div>
  44. <div v-if="markStatus" class="status-container">
  45. {{ markStatus }}
  46. <div class="double-triangle"></div>
  47. </div>
  48. <ZoomPaper v-if="store.isScanImage && store.currentTask" />
  49. </div>
  50. </template>
  51. <script setup lang="ts">
  52. import { onMounted, onUnmounted, reactive, watch, watchEffect } from "vue";
  53. import { store } from "@/store/store";
  54. import MarkDrawTrack from "./MarkDrawTrack.vue";
  55. import type { MarkResult, SliceImage, SpecialTag, Track } from "@/types";
  56. import { useTimers } from "@/setups/useTimers";
  57. import {
  58. getDataUrlForSliceConfig,
  59. getDataUrlForSplitConfig,
  60. loadImage,
  61. } from "@/utils/utils";
  62. import { dragImage } from "./use/draggable";
  63. import MultiMediaMarkBody from "./MultiMediaMarkBody.vue";
  64. import "viewerjs/dist/viewer.css";
  65. import Viewer from "viewerjs";
  66. import ZoomPaper from "@/components/ZoomPaper.vue";
  67. type MakeTrack = (
  68. event: MouseEvent,
  69. item: SliceImage,
  70. maxSliceWidth: number,
  71. theFinalHeight: number
  72. ) => void | (() => void);
  73. // TODO: https://github.com/vuejs/rfcs/discussions/369 defineProps deconstructure retain reactivity
  74. // eslint-disable-next-line vue/no-setup-props-destructure
  75. const {
  76. hasMarkResultToRender = false,
  77. makeTrack = () => console.debug("非评卷界面makeTrack没有意义"),
  78. } = defineProps<{
  79. hasMarkResultToRender?: boolean;
  80. makeTrack?: MakeTrack;
  81. }>();
  82. const emit = defineEmits(["error"]);
  83. //#region : 图片拖动。在轨迹模式下,仅当没有选择分数时可用。
  84. const { dragContainer } = dragImage();
  85. //#endregion : 图片拖动
  86. const { addTimeout } = useTimers();
  87. //#region : 缩略图定位
  88. watch(
  89. () => [store.minimapScrollToX, store.minimapScrollToY],
  90. () => {
  91. const container = document.querySelector(
  92. ".mark-body-container"
  93. ) as HTMLDivElement;
  94. addTimeout(() => {
  95. if (
  96. container &&
  97. typeof store.minimapScrollToX === "number" &&
  98. typeof store.minimapScrollToY === "number"
  99. ) {
  100. const { scrollWidth, scrollHeight } = container;
  101. container.scrollTo({
  102. top: scrollHeight * store.minimapScrollToY,
  103. left: scrollWidth * store.minimapScrollToX,
  104. behavior: "smooth",
  105. });
  106. }
  107. }, 10);
  108. }
  109. );
  110. //#endregion : 缩略图定位
  111. //#region : 快捷键定位
  112. const scrollContainerByKey = (e: KeyboardEvent) => {
  113. const container = document.querySelector(
  114. ".mark-body-container"
  115. ) as HTMLDivElement;
  116. if (e.key === "w") {
  117. container.scrollBy({ top: -100, behavior: "smooth" });
  118. } else if (e.key === "s") {
  119. container.scrollBy({ top: 100, behavior: "smooth" });
  120. } else if (e.key === "a") {
  121. container.scrollBy({ left: -100, behavior: "smooth" });
  122. } else if (e.key === "d") {
  123. container.scrollBy({ left: 100, behavior: "smooth" });
  124. }
  125. };
  126. onMounted(() => {
  127. document.addEventListener("keypress", scrollContainerByKey);
  128. });
  129. onUnmounted(() => {
  130. document.removeEventListener("keypress", scrollContainerByKey);
  131. });
  132. //#endregion : 快捷键定位
  133. //#region : 计算裁切图和裁切图上的分数轨迹和特殊标记轨迹
  134. let rotateBoard = $ref(0);
  135. let sliceImagesWithTrackList: SliceImage[] = reactive([]);
  136. let maxSliceWidth = 0; // 最大的裁切块宽度,图片容器以此为准
  137. let theFinalHeight = 0; // 最终宽度,用来定位轨迹在第几张图片,不包括image-seperator高度
  138. async function processSliceConfig() {
  139. let markResult = store.currentTask?.markResult as MarkResult;
  140. if (hasMarkResultToRender) {
  141. // check if have MarkResult for currentTask
  142. if (!markResult) return;
  143. }
  144. if (!store.currentTask) return;
  145. const images = [];
  146. // 必须要先加载一遍,把“选择整图”的宽高重置后,再算总高度
  147. for (const sliceConfig of store.currentTask.sliceConfig) {
  148. const url = store.currentTask.sliceUrls[sliceConfig.i - 1];
  149. const image = await loadImage(url);
  150. images[sliceConfig.i] = image;
  151. if (sliceConfig.w === 0 && sliceConfig.h === 0) {
  152. // 选择整图时,w/h 为0
  153. sliceConfig.w = image.naturalWidth;
  154. sliceConfig.h = image.naturalHeight;
  155. }
  156. }
  157. theFinalHeight = store.currentTask.sliceConfig
  158. .map((v) => v.h)
  159. .reduce((acc, v) => (acc += v));
  160. maxSliceWidth = Math.max(...store.currentTask.sliceConfig.map((v) => v.w));
  161. // 用来保存sliceImage在整个图片容器中(不包括image-seperator)的高度范围
  162. let accumTopHeight = 0;
  163. let accumBottomHeight = 0;
  164. const tempSliceImagesWithTrackList = [] as Array<SliceImage>;
  165. for (const sliceConfig of store.currentTask.sliceConfig) {
  166. accumBottomHeight += sliceConfig.h;
  167. const url = store.currentTask.sliceUrls[sliceConfig.i - 1];
  168. const indexInSliceUrls = sliceConfig.i;
  169. const image = images[sliceConfig.i];
  170. const dataUrl = await getDataUrlForSliceConfig(
  171. image,
  172. sliceConfig,
  173. maxSliceWidth,
  174. url
  175. );
  176. let trackLists = [] as Array<Track>;
  177. if (hasMarkResultToRender) {
  178. trackLists = markResult.trackList;
  179. } else {
  180. trackLists = store.currentTask.questionList
  181. .map((q) => q.trackList)
  182. .flat();
  183. }
  184. const thisImageTrackList = trackLists.filter(
  185. (t) => t.offsetIndex === indexInSliceUrls
  186. );
  187. let tagLists = [] as Array<SpecialTag>;
  188. if (hasMarkResultToRender) {
  189. tagLists = markResult.specialTagList ?? [];
  190. } else {
  191. tagLists = store.currentTask.specialTagList ?? [];
  192. }
  193. const thisImageTagList = tagLists.filter(
  194. (t) => t.offsetIndex === indexInSliceUrls
  195. );
  196. const sliceImageRendered = await loadImage(dataUrl!);
  197. tempSliceImagesWithTrackList.push({
  198. url: dataUrl!,
  199. indexInSliceUrls: sliceConfig.i,
  200. // 通过positionY来定位是第几张slice的还原,并过滤出相应的track
  201. trackList: thisImageTrackList.filter(
  202. (t) =>
  203. t.positionY >= accumTopHeight / theFinalHeight &&
  204. t.positionY < accumBottomHeight / theFinalHeight
  205. ),
  206. tagList: thisImageTagList.filter(
  207. (t) =>
  208. t.positionY >= accumTopHeight / theFinalHeight &&
  209. t.positionY < accumBottomHeight / theFinalHeight
  210. ),
  211. // originalImageWidth: image.naturalWidth,
  212. // originalImageHeight: image.naturalHeight,
  213. sliceImageWidth: sliceImageRendered.naturalWidth,
  214. sliceImageHeight: sliceImageRendered.naturalHeight,
  215. dx: sliceConfig.x,
  216. dy: sliceConfig.y,
  217. accumTopHeight,
  218. effectiveWidth: sliceConfig.w,
  219. });
  220. accumTopHeight = accumBottomHeight;
  221. }
  222. // console.log("render: ", store.currentTask.secretNumber);
  223. if (sliceImagesWithTrackList.length === 0) {
  224. // 初次渲染,不做动画
  225. sliceImagesWithTrackList.push(...tempSliceImagesWithTrackList);
  226. // 没抽象好,这里不好做校验
  227. // const renderedTrackAndTagNumber = sliceImagesWithTrackList.map(s => s.trackList.length + s.tagList.length).reduce((p,c) => p+ c);
  228. // if(renderedTrackAndTagNumber === thisIma)
  229. } else {
  230. rotateBoard = 1;
  231. setTimeout(() => {
  232. sliceImagesWithTrackList.splice(0);
  233. sliceImagesWithTrackList.push(...tempSliceImagesWithTrackList);
  234. setTimeout(() => {
  235. rotateBoard = 0;
  236. }, 300);
  237. }, 300);
  238. }
  239. }
  240. async function processSplitConfig() {
  241. let markResult = store.currentTask?.markResult as MarkResult;
  242. if (hasMarkResultToRender) {
  243. // check if have MarkResult for currentTask
  244. if (!markResult) return;
  245. }
  246. if (!store.currentTask) return;
  247. const images = [];
  248. for (const url of store.currentTask.sliceUrls) {
  249. const image = await loadImage(url);
  250. images.push(image);
  251. }
  252. // 裁切块,可能是一块,两块,三块... [start, width ...] => [0, 0.3] | [0, 0.55, 0.45, 0.55] | [0, 0.35, 0.33, 0.35, 0.66, 0.35]
  253. const splitConfigPairs = store.setting.splitConfig
  254. .map((v, index, ary) => (index % 2 === 0 ? [v, ary[index + 1]] : false))
  255. .filter((v) => v) as unknown as Array<[number, number]>;
  256. // 最大的 splitConfig 的宽度
  257. const maxSplitConfig = Math.max(
  258. ...store.setting.splitConfig.filter((v, i) => i % 2)
  259. );
  260. maxSliceWidth =
  261. Math.max(...images.map((v) => v.naturalWidth)) * maxSplitConfig;
  262. theFinalHeight =
  263. splitConfigPairs.length *
  264. images.reduce((acc, v) => (acc += v.naturalHeight), 0);
  265. // 高度比宽度大的图片不裁切
  266. const imagesOfBiggerHeight = images.filter(
  267. (v) => v.naturalHeight > v.naturalWidth
  268. );
  269. if (imagesOfBiggerHeight.length > 0) {
  270. maxSliceWidth = Math.max(
  271. maxSliceWidth,
  272. ...imagesOfBiggerHeight.map((v) => v.naturalWidth)
  273. );
  274. // 不裁切的图剪切多加的高度
  275. theFinalHeight -=
  276. imagesOfBiggerHeight.map((v) => v.naturalHeight).reduce((p, c) => p + c) *
  277. (splitConfigPairs.length - 1);
  278. }
  279. let accumTopHeight = 0;
  280. let accumBottomHeight = 0;
  281. const tempSliceImagesWithTrackList = [] as Array<SliceImage>;
  282. for (const url of store.currentTask.sliceUrls) {
  283. for (const config of splitConfigPairs) {
  284. const indexInSliceUrls = store.currentTask.sliceUrls.indexOf(url) + 1;
  285. const image = images[indexInSliceUrls - 1];
  286. let shouldBreak = false;
  287. let [splitConfigStart, splitConfigEnd] = config;
  288. if (image.naturalHeight > image.naturalWidth) {
  289. splitConfigStart = 0;
  290. splitConfigEnd = 1;
  291. shouldBreak = true;
  292. }
  293. accumBottomHeight += image.naturalHeight;
  294. const dataUrl = await getDataUrlForSplitConfig(
  295. image,
  296. [splitConfigStart, splitConfigEnd],
  297. maxSliceWidth,
  298. url
  299. );
  300. let trackLists = [] as Array<Track>;
  301. if (hasMarkResultToRender) {
  302. trackLists = markResult.trackList;
  303. } else {
  304. // 成绩查询 questionList 可能为空
  305. trackLists = (store.currentTask.questionList || [])
  306. .map((q) => q.trackList)
  307. .flat();
  308. }
  309. const thisImageTrackList = trackLists.filter(
  310. (t) => t.offsetIndex === indexInSliceUrls
  311. );
  312. let tagLists = [] as Array<SpecialTag>;
  313. if (hasMarkResultToRender) {
  314. tagLists = markResult.specialTagList ?? [];
  315. } else {
  316. tagLists = store.currentTask.specialTagList ?? [];
  317. }
  318. const thisImageTagList = tagLists.filter(
  319. (t) => t.offsetIndex === indexInSliceUrls
  320. );
  321. const sliceImageRendered = await loadImage(dataUrl!);
  322. tempSliceImagesWithTrackList.push({
  323. url: dataUrl!,
  324. indexInSliceUrls: store.currentTask.sliceUrls.indexOf(url) + 1,
  325. trackList: thisImageTrackList.filter(
  326. (t) =>
  327. t.positionY >= accumTopHeight / theFinalHeight &&
  328. t.positionY < accumBottomHeight / theFinalHeight
  329. ),
  330. tagList: thisImageTagList.filter(
  331. (t) =>
  332. t.positionY >= accumTopHeight / theFinalHeight &&
  333. t.positionY < accumBottomHeight / theFinalHeight
  334. ),
  335. // originalImageWidth: image.naturalWidth,
  336. // originalImageHeight: image.naturalHeight,
  337. sliceImageWidth: sliceImageRendered.naturalWidth,
  338. sliceImageHeight: sliceImageRendered.naturalHeight,
  339. dx: image.naturalWidth * splitConfigStart,
  340. dy: 0,
  341. accumTopHeight,
  342. effectiveWidth: image.naturalWidth * splitConfigEnd,
  343. });
  344. accumTopHeight = accumBottomHeight;
  345. // 如果本图高比宽大,不该裁切,则跳过多次裁切
  346. if (shouldBreak) {
  347. break;
  348. }
  349. }
  350. }
  351. rotateBoard = 1;
  352. addTimeout(() => {
  353. sliceImagesWithTrackList.splice(0);
  354. sliceImagesWithTrackList.push(...tempSliceImagesWithTrackList);
  355. addTimeout(() => {
  356. rotateBoard = 0;
  357. }, 300);
  358. }, 300);
  359. }
  360. // should not render twice at the same time
  361. let renderLock = false;
  362. const renderPaperAndMark = async () => {
  363. if (!store) return;
  364. if (!store.isScanImage) return;
  365. if (renderLock) {
  366. console.log("上个任务还未渲染完毕,稍等一秒再尝试渲染");
  367. await new Promise((res) => setTimeout(res, 1000));
  368. await renderPaperAndMark();
  369. return;
  370. }
  371. renderLock = true;
  372. // check if have MarkResult for currentTask
  373. let markResult = store.currentTask?.markResult;
  374. if ((hasMarkResultToRender && !markResult) || !store.currentTask) {
  375. renderLock = false;
  376. return;
  377. }
  378. try {
  379. store.globalMask = true;
  380. const hasSliceConfig = store.currentTask?.sliceConfig?.length;
  381. if (hasSliceConfig) {
  382. await processSliceConfig();
  383. } else {
  384. await processSplitConfig();
  385. }
  386. // 研究生考试需要停留在上次阅卷的位置,所以注释掉下面的代码
  387. // await new Promise((res) => setTimeout(res, 700));
  388. // const container = <HTMLDivElement>(
  389. // document.querySelector(".mark-body-container")
  390. // );
  391. // addTimeout(() => {
  392. // container?.scrollTo({
  393. // top: 0,
  394. // left: 0,
  395. // behavior: "smooth",
  396. // });
  397. // }, 10);
  398. } catch (error) {
  399. sliceImagesWithTrackList.splice(0);
  400. console.trace("render error ", error);
  401. // 图片加载出错,自动加载下一个任务
  402. emit("error");
  403. } finally {
  404. renderLock = false;
  405. store.globalMask = false;
  406. }
  407. };
  408. // watchEffect(renderPaperAndMark);
  409. // 在阻止渲染的情况下,watchEffect收集不到 store.currentTask 的依赖,会导致本组件不再更新
  410. watch(
  411. () => store.currentTask,
  412. () => renderPaperAndMark()
  413. );
  414. //#endregion : 计算裁切图和裁切图上的分数轨迹和特殊标记轨迹
  415. //#region : 放大缩小和之后的滚动
  416. const answerPaperScale = $computed(() => {
  417. // 放大、缩小不影响页面之前的滚动条定位
  418. let percentWidth = 0;
  419. let percentTop = 0;
  420. const container = document.querySelector(
  421. ".mark-body-container"
  422. ) as HTMLDivElement;
  423. if (container) {
  424. const { scrollLeft, scrollTop, scrollWidth, scrollHeight } = container;
  425. percentWidth = scrollLeft / scrollWidth;
  426. percentTop = scrollTop / scrollHeight;
  427. }
  428. addTimeout(() => {
  429. if (container) {
  430. const { scrollWidth, scrollHeight } = container;
  431. container.scrollTo({
  432. left: scrollWidth * percentWidth,
  433. top: scrollHeight * percentTop,
  434. });
  435. }
  436. }, 10);
  437. const scale = store.setting.uiSetting["answer.paper.scale"];
  438. return scale * 100 + "%";
  439. });
  440. //#endregion : 放大缩小和之后的滚动
  441. //#region : 显示评分状态和清除轨迹
  442. let markStatus = $ref("");
  443. if (hasMarkResultToRender) {
  444. watch(
  445. () => store.currentTask,
  446. () => {
  447. markStatus = store.getMarkStatus;
  448. }
  449. );
  450. // 清除分数轨迹
  451. watchEffect(() => {
  452. for (const track of store.removeScoreTracks) {
  453. for (const sliceImage of sliceImagesWithTrackList) {
  454. sliceImage.trackList = sliceImage.trackList.filter(
  455. (t) =>
  456. !(
  457. t.mainNumber === track.mainNumber &&
  458. t.subNumber === track.subNumber &&
  459. t.number === track.number
  460. )
  461. );
  462. }
  463. }
  464. // 清除后,删除,否则会影响下次切换
  465. store.removeScoreTracks.splice(0);
  466. });
  467. // 清除特殊标记轨迹
  468. watchEffect(() => {
  469. for (const sliceImage of sliceImagesWithTrackList) {
  470. sliceImage.tagList = sliceImage.tagList.filter((t) =>
  471. store.currentTask?.markResult.specialTagList.find(
  472. (st) =>
  473. st.offsetIndex === t.offsetIndex &&
  474. st.offsetX === t.offsetX &&
  475. st.offsetY === t.offsetY
  476. )
  477. );
  478. }
  479. if (store.currentTask?.markResult.specialTagList.length === 0) {
  480. for (const sliceImage of sliceImagesWithTrackList) {
  481. sliceImage.tagList = [];
  482. }
  483. }
  484. });
  485. }
  486. //#endregion : 显示评分状态和清除轨迹
  487. //#region : 评分
  488. const innerMakeTrack = (event: MouseEvent, item: SliceImage) => {
  489. makeTrack(event, item, maxSliceWidth, theFinalHeight);
  490. };
  491. //#endregion : 评分
  492. //#region : 显示大图,供查看和翻转
  493. const showBigImage = (event: MouseEvent) => {
  494. event.preventDefault();
  495. // console.log(event);
  496. let viewer: Viewer = null as unknown as Viewer;
  497. viewer && viewer.destroy();
  498. viewer = new Viewer(event.target as HTMLElement, {
  499. // inline: true,
  500. viewed() {
  501. viewer.zoomTo(1);
  502. },
  503. hidden() {
  504. viewer.destroy();
  505. },
  506. zIndex: 1000000,
  507. });
  508. viewer.show();
  509. };
  510. //#endregion : 显示大图,供查看和翻转
  511. // onRenderTriggered(({ key, target, type }) => {
  512. // console.log({ key, target, type });
  513. // });
  514. </script>
  515. <style scoped>
  516. .mark-body-container {
  517. position: relative;
  518. min-height: calc(100vh - 56px);
  519. height: calc(100vh - 56px);
  520. overflow: auto;
  521. /* background-size: 8px 8px;
  522. background-image: linear-gradient(to right, #e7e7e7 4px, transparent 4px),
  523. linear-gradient(to bottom, transparent 4px, #e7e7e7 4px); */
  524. background-color: var(--app-container-bg-color);
  525. background-image: linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
  526. linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
  527. linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
  528. linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  529. background-size: 20px 20px;
  530. background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  531. transform: inherit;
  532. }
  533. .mark-body-container img {
  534. width: 100%;
  535. }
  536. .empty-task {
  537. width: calc(100%);
  538. height: calc(100%);
  539. font-size: 20px;
  540. overflow: hidden;
  541. background-color: var(--app-container-bg-color);
  542. }
  543. .empty-task img {
  544. display: block;
  545. width: 288px;
  546. height: 225px;
  547. clip-path: polygon(0 0, 0 80%, 100% 80%, 100% 0);
  548. }
  549. .single-image-container {
  550. position: relative;
  551. }
  552. .image-seperator {
  553. border: 2px solid transparent;
  554. }
  555. .status-container {
  556. position: fixed;
  557. top: 56px;
  558. right: 340px;
  559. color: white;
  560. pointer-events: none;
  561. font-size: var(--app-title-font-size);
  562. background-color: #ef7c78;
  563. width: 30px;
  564. height: 50px;
  565. text-align: center;
  566. z-index: 1000;
  567. }
  568. .double-triangle {
  569. background-color: #ef7c78;
  570. width: 30px;
  571. height: 6px;
  572. clip-path: polygon(0 0, 0 6px, 50% 0, 100% 0, 100% 6px, 50% 0);
  573. position: absolute;
  574. bottom: -5px;
  575. }
  576. @keyframes rotate {
  577. 0% {
  578. transform: rotateY(0deg);
  579. opacity: 1;
  580. }
  581. 50% {
  582. transform: rotateY(90deg);
  583. }
  584. 100% {
  585. transform: rotateY(0deg);
  586. opacity: 0;
  587. }
  588. }
  589. .rotate-board-1 {
  590. animation: rotate 0.6s ease-in-out;
  591. }
  592. </style>