HomeFadeIn.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="home-fadein">
  3. <video
  4. class="bg-video"
  5. src="@/assets/videos/loading.mp4"
  6. autoplay
  7. playsinline
  8. muted
  9. />
  10. <div class="progress">
  11. <span>{{ progress }}</span><span>%</span>
  12. </div>
  13. <div class="organization">
  14. 上海工业博物馆
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. props: [
  21. 'progress',
  22. ],
  23. emits: ['loading-end'],
  24. data() {
  25. return {
  26. }
  27. },
  28. mounted() {
  29. },
  30. methods: {
  31. }
  32. }
  33. </script>
  34. <style lang="less" scoped>
  35. .home-fadein {
  36. position: absolute;
  37. left: 0;
  38. top: 0;
  39. width: 100%;
  40. height: 100%;
  41. background-color: #000;
  42. >.bg-video {
  43. position: absolute;
  44. left: 0;
  45. top: 0;
  46. width: 100%;
  47. height: 100%;
  48. object-fit: cover;
  49. background-color: #000;
  50. }
  51. >.progress {
  52. position: absolute;
  53. left: 50%;
  54. top: 50%;
  55. transform: translate(-50%, -50%);
  56. >span:nth-of-type(1) {
  57. font-size: 32px;
  58. font-family: Source Han Sans CN-Light, Source Han Sans CN;
  59. font-weight: 400;
  60. color: #FFFFFF;
  61. }
  62. >span:nth-of-type(2) {
  63. font-size: 16px;
  64. font-family: Source Han Sans CN-Light, Source Han Sans CN;
  65. font-weight: 400;
  66. color: #FFFFFF;
  67. }
  68. }
  69. >.organization {
  70. position: absolute;
  71. left: 50%;
  72. bottom: 38px;
  73. transform: translate(-50%, -50%);
  74. font-size: 24px;
  75. font-family: Source Han Sans CN-Bold, Source Han Sans CN;
  76. font-weight: bold;
  77. color: #FFFFFF;
  78. }
  79. }
  80. .mobile {
  81. .home-fadein {
  82. position: absolute;
  83. left: 0;
  84. top: 0;
  85. width: 100%;
  86. height: 100%;
  87. background-color: #000;
  88. >.bg-video {
  89. position: absolute;
  90. left: 0;
  91. top: 0;
  92. width: 100%;
  93. height: 100%;
  94. object-fit: cover;
  95. background-color: #000;
  96. }
  97. >.progress {
  98. position: absolute;
  99. left: 50%;
  100. top: 50%;
  101. transform: translate(-50%, -50%);
  102. >span:nth-of-type(1) {
  103. font-size: calc(32 / 1080 * 100vh);
  104. font-family: Source Han Sans CN-Light, Source Han Sans CN;
  105. font-weight: 400;
  106. color: #FFFFFF;
  107. }
  108. >span:nth-of-type(2) {
  109. font-size: calc(16 / 1080 * 100vh);
  110. font-family: Source Han Sans CN-Light, Source Han Sans CN;
  111. font-weight: 400;
  112. color: #FFFFFF;
  113. }
  114. }
  115. >.organization {
  116. position: absolute;
  117. left: 50%;
  118. bottom: calc(38 / 1080 * 100vh);
  119. transform: translate(-50%, -50%);
  120. font-size: calc(24 / 1080 * 100vh);
  121. font-family: Source Han Sans CN-Bold, Source Han Sans CN;
  122. font-weight: bold;
  123. color: #FFFFFF;
  124. }
  125. }
  126. }
  127. </style>