guide.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div v-if="show && isMobile" class="user-guide-overlay">
  3. <div class="user-guide-mobile">
  4. <div class="zh">
  5. <div class="btn" @click="onSet"></div>
  6. </div>
  7. </div>
  8. </div>
  9. </template>
  10. <script lang="ts" setup>
  11. import { computed } from 'vue';
  12. import { useApp } from '/@/hooks/userApp';
  13. import { useAppStore } from '/@/store/modules/app';
  14. import browser from '/@/utils/browser';
  15. const appStore = useAppStore();
  16. const isMobile = browser.isMobile();
  17. const show = computed(() => appStore.player.showUserGuide);
  18. // const store = useStore();
  19. const onSet = () => {
  20. // store.commit("showUserGuide", false);
  21. // localStorage.setItem("user_guide", Date.now());
  22. };
  23. // const getTips = (tips) => {
  24. // let text = tips.split("<br />");
  25. // return `<span>${text[0]}</span><div>${text[1]}</div>`;
  26. // };
  27. useApp().then((app) => {
  28. app.Scene.on('loaded', () => {
  29. if (!localStorage.getItem('user_guide')) {
  30. // store.commit("showUserGuide", true);
  31. }
  32. });
  33. });
  34. </script>
  35. <style lang="scss" scoped>
  36. .user-guide-overlay {
  37. position: fixed;
  38. left: 0;
  39. top: 0;
  40. width: 100%;
  41. height: 100%;
  42. z-index: 1099999;
  43. background-color: rgba(0, 0, 0, 0.7);
  44. }
  45. .user-guide {
  46. white-space: normal;
  47. position: absolute;
  48. top: 50%;
  49. left: 1.2rem;
  50. right: 1.2rem;
  51. border-radius: 0.15rem;
  52. color: #fff;
  53. transform: translateY(-50%);
  54. background-color: rgba(0, 0, 0, 0.7);
  55. z-index: 999999;
  56. .main {
  57. padding: 0.8rem;
  58. padding-bottom: 0;
  59. h4 {
  60. margin: 0;
  61. font-size: 0.5rem;
  62. text-align: center;
  63. }
  64. ul,
  65. li {
  66. list-style: none;
  67. padding: 0;
  68. margin: 0;
  69. width: 100%;
  70. }
  71. ul {
  72. margin: 0.4rem 0;
  73. }
  74. li {
  75. display: flex;
  76. align-items: center;
  77. padding: 0.6rem 0;
  78. i {
  79. font-size: 1.2rem;
  80. }
  81. > div {
  82. line-height: 1.6;
  83. font-size: 0.4rem;
  84. margin-left: 0.35rem;
  85. }
  86. }
  87. button {
  88. width: 100%;
  89. margin-bottom: 0.5rem;
  90. background-color: #fff;
  91. font-size: 0.4rem;
  92. color: #444;
  93. height: 1.1rem;
  94. border: none;
  95. border-radius: 0.15rem;
  96. &[type='submit'] {
  97. color: #fff;
  98. background-color: transparent;
  99. }
  100. }
  101. }
  102. @media (orientation: landscape) {
  103. width: 400px;
  104. left: 50% !important;
  105. right: auto !important;
  106. margin-left: -200px;
  107. .main {
  108. padding: 0.5rem;
  109. h4 {
  110. font-size: 0.35rem;
  111. }
  112. ul {
  113. margin: 0.3rem 0;
  114. }
  115. li {
  116. padding: 0.1rem 0;
  117. i {
  118. font-size: 0.6rem;
  119. }
  120. > div {
  121. font-size: 0.25rem;
  122. }
  123. }
  124. button {
  125. margin-bottom: 0rem;
  126. font-size: 0.3rem;
  127. height: 0.8rem;
  128. }
  129. }
  130. }
  131. }
  132. .user-guide-mobile {
  133. position: absolute;
  134. top: 3.15789rem;
  135. left: 50%;
  136. width: 7.89474rem;
  137. transform: translateX(-50%);
  138. .zh {
  139. width: 100%;
  140. height: 7rem;
  141. background-image: url(~@/assets/images/guide/novice_guide_text@2x.png);
  142. background-size: contain;
  143. background-position: center top;
  144. background-repeat: no-repeat;
  145. }
  146. .en {
  147. width: 100%;
  148. color: #fff;
  149. ul,
  150. li {
  151. list-style: none;
  152. padding: 0;
  153. margin: 0;
  154. width: 100%;
  155. }
  156. ul {
  157. margin: 0;
  158. }
  159. li {
  160. display: flex;
  161. align-items: flex-start;
  162. padding: 0.5rem 0;
  163. &:first-child {
  164. padding-top: 0;
  165. }
  166. i {
  167. font-size: 1.32rem;
  168. }
  169. > div {
  170. font-size: 0.4rem;
  171. margin-left: 0.3rem;
  172. :deep(span) {
  173. font-size: 0.6rem;
  174. color: #00c2c4;
  175. }
  176. :deep(div) {
  177. font-size: 0.5rem;
  178. margin-top: 0.1rem;
  179. white-space: pre-line;
  180. line-height: 1.3;
  181. }
  182. }
  183. }
  184. .btn {
  185. background-image: none;
  186. color: #00c2c4;
  187. line-height: 1.2rem;
  188. text-align: center;
  189. font-size: 0.52632rem;
  190. background-image: url(~@/assets/images/guide/novice_guide_button_empty@2x.png);
  191. }
  192. }
  193. .btn {
  194. position: absolute;
  195. bottom: -3.15789rem;
  196. left: 50%;
  197. width: 3.5rem;
  198. height: 1.31579rem;
  199. background-image: url(~@/assets/images/guide/novice_guide_button@2x.png);
  200. background-size: contain;
  201. background-position: center top;
  202. background-repeat: no-repeat;
  203. transform: translateX(-50%);
  204. }
  205. .guide-tips {
  206. font-size: 16px;
  207. margin-top: 1rem;
  208. line-height: 1.5;
  209. }
  210. @media (orientation: landscape) {
  211. top: 0.5rem;
  212. .zh {
  213. height: 4rem;
  214. .btn {
  215. width: 2.5rem;
  216. height: 0.8rem;
  217. bottom: -1.4rem;
  218. }
  219. }
  220. .en {
  221. li {
  222. padding: 0.15rem 0;
  223. i {
  224. font-size: 1rem;
  225. }
  226. > div {
  227. margin-left: 0.3rem;
  228. :deep(span) {
  229. font-size: 0.3rem;
  230. }
  231. :deep(div) {
  232. font-size: 0.25rem;
  233. margin-top: 0.1rem;
  234. }
  235. }
  236. }
  237. .btn {
  238. height: 0.7rem;
  239. line-height: 0.63rem;
  240. font-size: 0.25rem;
  241. bottom: -0.7rem;
  242. }
  243. }
  244. }
  245. }
  246. @media (orientation: landscape) {
  247. .user-guide-mobile {
  248. overflow-y: auto;
  249. }
  250. }
  251. </style>