RelicDetail.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div
  3. class="relic-detail"
  4. :class="{
  5. isDarkTheme,
  6. notDarkTheme: !isDarkTheme,
  7. }"
  8. >
  9. <el-switch
  10. :model-value="isDarkTheme"
  11. class="theme-switch"
  12. inline-prompt
  13. :active-icon="Moon"
  14. :inactive-icon="Sunny"
  15. @update:modelValue="onThemeChange"
  16. />
  17. <article
  18. class="desc"
  19. :class="{
  20. isDarkTheme,
  21. notDarkTheme: !isDarkTheme,
  22. }"
  23. >
  24. <h1 v-html="$gConfigInfo.objInfo[$route.query.m]" />
  25. <div
  26. v-show="isShowDescDetail"
  27. class="splitter"
  28. />
  29. <div
  30. v-show="isShowDescDetail"
  31. class="detail"
  32. v-html="$gConfigTxt.txtObj[$route.query.m]"
  33. />
  34. </article>
  35. <!-- 假的阴影 -->
  36. <!-- <img
  37. class="relic-shadow"
  38. src="@/assets/images/relic-shadow.png"
  39. alt=""
  40. draggable="false"
  41. > -->
  42. <transition name="fade-out">
  43. <img
  44. v-if="isShowLogo"
  45. :src="require(`@/assets/images/logo-for-${isDarkTheme ? 'dark' : 'light'}-theme.png`)"
  46. alt=""
  47. class="logo"
  48. draggable="false"
  49. >
  50. </transition>
  51. <menu>
  52. <button class="go-homepage">
  53. <img
  54. :src="require(`@/assets/images/btn-home-${isDarkTheme ? 'dark' : 'light'}.png`)"
  55. alt=""
  56. draggable="false"
  57. >
  58. </button>
  59. <button
  60. class="show-detail"
  61. @click="onClickShowDetail"
  62. >
  63. <img
  64. :src="require(`@/assets/images/btn-desc-${isDarkTheme ? 'dark' : 'light'}${isShowDescDetail ? '-active' : ''}.png`)"
  65. alt=""
  66. draggable="false"
  67. >
  68. </button>
  69. <button
  70. class="show-help"
  71. @click="onClickShowHelp"
  72. >
  73. <img
  74. :src="require(`@/assets/images/btn-help-${isDarkTheme ? 'dark' : 'light'}${isShowHelp ? '-active' : ''}.png`)"
  75. alt=""
  76. draggable="false"
  77. >
  78. </button>
  79. <button class="share">
  80. <img
  81. :src="require(`@/assets/images/btn-share-${isDarkTheme ? 'dark' : 'light'}.png`)"
  82. alt=""
  83. draggable="false"
  84. >
  85. </button>
  86. </menu>
  87. <help-comp
  88. v-show="isShowHelp"
  89. @close="isShowHelp = false"
  90. />
  91. </div>
  92. </template>
  93. <script>
  94. import { Moon, Sunny } from '@element-plus/icons-vue'
  95. import { mapMutations, mapState } from 'vuex'
  96. import HelpComp from "@/components/HelpComp.vue"
  97. export default {
  98. components: {
  99. HelpComp,
  100. },
  101. data() {
  102. return {
  103. isShowDescDetail: false,
  104. isShowLogo: true,
  105. isShowHelp: false,
  106. }
  107. },
  108. computed: {
  109. ...mapState([
  110. 'isDarkTheme',
  111. ]),
  112. Sunny() {
  113. return Sunny
  114. },
  115. Moon() {
  116. return Moon
  117. },
  118. },
  119. created() {
  120. fdage.embed('user-config/4dage/' + this.$route.query.m + '.4dage', {
  121. width: 800,
  122. height: 600,
  123. autoStart: true,
  124. fullFrame: true,
  125. pagePreset: false
  126. })
  127. document.addEventListener('model-loaded', this.onModelLoad)
  128. },
  129. beforeUnmount() {
  130. const fdageUIElem = document.querySelector('#fdageUI')
  131. if (fdageUIElem && fdageUIElem.parentNode) {
  132. fdageUIElem.parentNode.parentNode.removeChild(fdageUIElem.parentNode)
  133. }
  134. },
  135. methods: {
  136. ...mapMutations([
  137. 'setIsDarkTheme'
  138. ]),
  139. onThemeChange(v) {
  140. this.setIsDarkTheme(v)
  141. },
  142. onModelLoad() {
  143. this.isShowLogo = false
  144. },
  145. onClickShowDetail() {
  146. this.isShowDescDetail = !this.isShowDescDetail
  147. },
  148. onClickShowHelp() {
  149. this.isShowHelp = !this.isShowHelp
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="less" scoped>
  155. .relic-detail {
  156. position: absolute;
  157. left: 0;
  158. top: 0;
  159. width: 100%;
  160. height: 100%;
  161. &.isDarkTheme {
  162. background: #303030;
  163. }
  164. &.notDarkTheme {
  165. background-image: url(@/assets/images/relic-bg-light.jpg);
  166. background-size: cover;
  167. background-repeat: no-repeat;
  168. background-position: center center;
  169. }
  170. > .theme-switch {
  171. position: absolute;
  172. top:10px;
  173. right: 10px;
  174. z-index: 1;
  175. }
  176. > article.desc {
  177. position: absolute;
  178. top: 127px;
  179. left: 110px;
  180. width: 503px;
  181. z-index: 1;
  182. pointer-events: none;
  183. &.isDarkTheme {
  184. color: #fff;
  185. }
  186. &.notDarkTheme {
  187. color: #585858;
  188. }
  189. > h1 {
  190. font-size: 32px;
  191. font-family: Source Han Serif CN-Heavy, Source Han Serif CN;
  192. font-weight: 800;
  193. line-height: 64px;
  194. }
  195. > .splitter {
  196. width: 100%;
  197. border-top: 1px dashed rgba(255,255,255,0.32);
  198. margin-top: 33px;
  199. margin-bottom: 29px;
  200. }
  201. > .detail {
  202. max-height: 500px;
  203. overflow: auto;
  204. padding-right: 10px;
  205. font-size: 20px;
  206. line-height: 40px;
  207. }
  208. }
  209. > .relic-shadow {
  210. position: absolute;
  211. bottom: 104px;
  212. left: 50%;
  213. transform: translateX(-50%);
  214. width: 824px;
  215. height: 55.82px;
  216. }
  217. > img.logo {
  218. position: absolute;
  219. bottom: 59px;
  220. left: 50%;
  221. transform: translateX(-50%);
  222. width: 229.57px;
  223. pointer-events: none;
  224. z-index: 1;
  225. }
  226. > menu {
  227. position: absolute;
  228. bottom: 67px;
  229. right: 79px;
  230. z-index: 1;
  231. > button {
  232. width: 32px;
  233. height: 32px;
  234. margin-left: 16px;
  235. > img {
  236. width: 100%;
  237. height: 100%;
  238. }
  239. }
  240. }
  241. ::-webkit-scrollbar { width: 6px; height: 6px; }
  242. ::-webkit-scrollbar-thumb { background: #fff; }
  243. ::-webkit-scrollbar-button { display: none; }
  244. ::-webkit-scrollbar-track { background: #000; }
  245. // 横竖滚动条轨道交汇处
  246. ::-webkit-scrollbar-corner { background: transparent; }
  247. ::-webkit-scrollbar-resizer { background: transparent; }
  248. }
  249. </style>