Show.Header.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <div class="v_header" @touchmove.prevent v-clickoutside="handleoutside">
  3. <div v-if="vtitle" class="title">{{vtitle}}</div>
  4. <div class="right" :class="{ more: showMore }" @click="onShowMore">
  5. <i class="iconfont icon-a-9gedian"></i>
  6. <div v-if="showMore">
  7. <ul>
  8. <li @click.stop="onShowIntro">
  9. <i class="iconfont icon-jianjie"></i>
  10. <span v-html="'简介'"></span>
  11. </li>
  12. <li @click="isBgm = !isBgm">
  13. <i
  14. class="iconfont"
  15. :class="!isBgm ? 'icon-yinleguan' : 'icon-yinlekai'"
  16. ></i>
  17. <span v-html="'音乐'"></span>
  18. </li>
  19. <li @click.stop="onShowShare">
  20. <i class="iconfont icon-fenxiang"></i>
  21. <span v-html="'分享'"></span>
  22. </li>
  23. </ul>
  24. </div>
  25. </div>
  26. <vIntro v-if="isShowIntro" @close="isShowIntro = false" />
  27. <vShare v-if="isShowShare" @close="isShowShare = false" />
  28. </div>
  29. </template>
  30. <script>
  31. import vIntro from "./intro";
  32. import vShare from "./share";
  33. export default {
  34. props:['vtitle'],
  35. components: { vIntro,vShare },
  36. data() {
  37. return {
  38. showMore: false,
  39. isShowIntro: false,
  40. isShowShare: false,
  41. isBgm: true,
  42. };
  43. },
  44. methods: {
  45. handleoutside() {
  46. this.showMore = false;
  47. },
  48. onShowIntro() {
  49. this.showMore = false;
  50. this.isShowIntro = true;
  51. },
  52. onShowShare() {
  53. this.showMore = false;
  54. this.isShowShare = true;
  55. },
  56. onShowMore() {
  57. this.showMore = !this.showMore;
  58. },
  59. },
  60. watch: {
  61. isBgm(newVal) {
  62. this.$bus.$emit("toggleBgm", newVal);
  63. },
  64. },
  65. mounted() {
  66. console.log(this.vtitle);
  67. },
  68. };
  69. </script>
  70. <style lang="less" scoped>
  71. @bkc: rgba(32, 32, 32, 0.6);
  72. .v_header {
  73. font-size: 16px;
  74. top: 12px;
  75. position: fixed;
  76. left: 0;
  77. width: 100%;
  78. color: #fff;
  79. text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
  80. z-index: 2004;
  81. .content {
  82. position: absolute;
  83. top: 60px;
  84. left: 30px;
  85. right: 30px;
  86. padding: 10px;
  87. background: @bkc;
  88. border-radius: 14px;
  89. font-size: 14px;
  90. text-align: center;
  91. width: auto;
  92. > div {
  93. display: inline-block;
  94. text-align: left;
  95. letter-spacing: 1px;
  96. word-break: break-all;
  97. white-space: normal;
  98. line-height: 1.5;
  99. }
  100. > i {
  101. top: -12px;
  102. left: 50%;
  103. transform: translateX(-50%);
  104. position: absolute;
  105. width: 0;
  106. height: 0;
  107. border-style: solid;
  108. border-width: 0 10px 12px 10px;
  109. border-color: transparent transparent @bkc;
  110. }
  111. }
  112. .right {
  113. position: absolute;
  114. right: 8px;
  115. top: 1px;
  116. width: 44px;
  117. height: 60px;
  118. display: flex;
  119. > i {
  120. font-size: 28px;
  121. position: absolute;
  122. top: 50%;
  123. left: 50%;
  124. transform: translate(-50%, -70%);
  125. background: rgba(0,0,0,0.6);
  126. backdrop-filter: blur(10px);
  127. border-radius: 4px;
  128. }
  129. > div {
  130. position: absolute;
  131. display: flex;
  132. flex-direction: column;
  133. right: 0;
  134. top: 50px;
  135. background-color: @bkc;
  136. border-radius: 5px;
  137. padding: 0 6px;
  138. &::after {
  139. content: "";
  140. position: absolute;
  141. top: -5px;
  142. right: 10px;
  143. width: 0;
  144. height: 0;
  145. border-width: 0 5px 5px;
  146. border-style: solid;
  147. border-color: transparent transparent @bkc;
  148. }
  149. li {
  150. position: relative;
  151. display: flex;
  152. flex-direction: column;
  153. align-items: center;
  154. justify-content: center;
  155. font-size: 0;
  156. text-align: center;
  157. border-bottom: 1px solid @color;
  158. padding: 14px 10px;
  159. &:last-of-type {
  160. border-bottom: none;
  161. }
  162. i {
  163. font-size: 28px;
  164. }
  165. span {
  166. white-space: nowrap;
  167. font-size: 14px;
  168. display: inline-block;
  169. margin-top: 4px;
  170. }
  171. }
  172. }
  173. }
  174. .title {
  175. --height: 40px;
  176. margin: 0;
  177. height: var(--height);
  178. line-height: var(--height);
  179. font-size: 15px;
  180. font-weight: 700;
  181. color: #fff;
  182. padding: 0 15px;
  183. display: inline-block;
  184. text-shadow: 1px 0 2px rgb(0 0 0 / 16%);
  185. left: 50%;
  186. -webkit-transform: translateX(-50%) translateY(0);
  187. transform: translateX(-50%) translateY(0);
  188. position: absolute;
  189. -webkit-transition: background 0.3s ease, min-width 0.3s ease,
  190. border-radius 0.3s ease;
  191. transition: background 0.3s ease, min-width 0.3s ease,
  192. border-radius 0.3s ease;
  193. min-width: 86%;
  194. background: -webkit-gradient(
  195. linear,
  196. left top,
  197. right top,
  198. from(transparent),
  199. color-stop(29%, rgba(0, 0, 0, 0.2)),
  200. color-stop(69%, rgba(0, 0, 0, 0.2)),
  201. to(transparent)
  202. );
  203. background: linear-gradient(
  204. 90deg,
  205. transparent,
  206. rgba(0, 0, 0, 0.2) 29%,
  207. rgba(0, 0, 0, 0.2) 69%,
  208. transparent
  209. );
  210. margin-top: 0;
  211. text-align: center;
  212. }
  213. }
  214. </style>
  215. <style lang="less">
  216. .animated.short {
  217. transition: 0.3s ease all;
  218. &.faster {
  219. animation-duration: 0.3s;
  220. }
  221. @keyframes fadeInUp {
  222. 0% {
  223. opacity: 0;
  224. transform: translate3d(0, 1rem, 0);
  225. }
  226. to {
  227. opacity: 1;
  228. transform: translateZ(0);
  229. }
  230. }
  231. @keyframes fadeOutDown {
  232. 0% {
  233. opacity: 1;
  234. }
  235. to {
  236. opacity: 0;
  237. transform: translate3d(0, 1rem, 0);
  238. }
  239. }
  240. }
  241. </style>