welcome.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <script setup lang="ts">
  2. import {
  3. ReGithub,
  4. ReInfinite,
  5. RePie,
  6. ReLine,
  7. ReBar
  8. } from "/@/components/ReCharts/index";
  9. import { ref, computed } from "vue";
  10. import avatars from "/@/assets/avatars.jpg";
  11. const date: Date = new Date();
  12. let loading = ref<boolean>(true);
  13. setTimeout(() => {
  14. loading.value = !loading.value;
  15. }, 800);
  16. let greetings = computed(() => {
  17. if (date.getHours() >= 0 && date.getHours() < 12) {
  18. return "上午阳光明媚,祝你薪水翻倍🌞!";
  19. } else if (date.getHours() >= 12 && date.getHours() < 18) {
  20. return "下午小风娇好,愿你青春不老😃!";
  21. } else {
  22. return "折一根天使羽毛,愿拂去您的疲惫烦恼忧伤🌛!";
  23. }
  24. });
  25. const openDepot = (): void => {
  26. window.open("https://github.com/xiaoxian521/vue-pure-admin");
  27. };
  28. </script>
  29. <template>
  30. <div class="welcome">
  31. <el-card class="top-content">
  32. <div class="left-mark">
  33. <img :src="avatars" title="直达仓库地址" @click="openDepot" />
  34. <span>{{ greetings }}</span>
  35. </div>
  36. </el-card>
  37. <el-row :gutter="24" style="margin: 20px">
  38. <el-col
  39. :xs="24"
  40. :sm="24"
  41. :md="12"
  42. :lg="12"
  43. :xl="12"
  44. style="margin-bottom: 20px"
  45. v-motion
  46. :initial="{
  47. opacity: 0,
  48. y: 100
  49. }"
  50. :enter="{
  51. opacity: 1,
  52. y: 0,
  53. transition: {
  54. delay: 200
  55. }
  56. }"
  57. >
  58. <el-card>
  59. <template #header>
  60. <div>
  61. <span>GitHub信息</span>
  62. </div>
  63. </template>
  64. <el-skeleton animated :rows="7" :loading="loading">
  65. <template #default>
  66. <ReGithub />
  67. </template>
  68. </el-skeleton>
  69. </el-card>
  70. </el-col>
  71. <el-col
  72. :xs="24"
  73. :sm="24"
  74. :md="12"
  75. :lg="12"
  76. :xl="12"
  77. style="margin-bottom: 20px"
  78. v-motion
  79. :initial="{
  80. opacity: 0,
  81. y: 100
  82. }"
  83. :enter="{
  84. opacity: 1,
  85. y: 0,
  86. transition: {
  87. delay: 200
  88. }
  89. }"
  90. >
  91. <el-card>
  92. <template #header>
  93. <div>
  94. <span>GitHub滚动信息</span>
  95. </div>
  96. </template>
  97. <el-skeleton animated :rows="7" :loading="loading">
  98. <template #default>
  99. <ReInfinite />
  100. </template>
  101. </el-skeleton>
  102. </el-card>
  103. </el-col>
  104. <el-col
  105. :xs="24"
  106. :sm="24"
  107. :md="12"
  108. :lg="8"
  109. :xl="8"
  110. style="margin-bottom: 20px"
  111. v-motion
  112. :initial="{
  113. opacity: 0,
  114. y: 100
  115. }"
  116. :enter="{
  117. opacity: 1,
  118. y: 0,
  119. transition: {
  120. delay: 400
  121. }
  122. }"
  123. >
  124. <el-card>
  125. <template #header>
  126. <div>
  127. <span>GitHub饼图信息</span>
  128. </div>
  129. </template>
  130. <el-skeleton animated :rows="7" :loading="loading">
  131. <template #default>
  132. <RePie />
  133. </template>
  134. </el-skeleton>
  135. </el-card>
  136. </el-col>
  137. <el-col
  138. :xs="24"
  139. :sm="24"
  140. :md="12"
  141. :lg="8"
  142. :xl="8"
  143. style="margin-bottom: 20px"
  144. v-motion
  145. :initial="{
  146. opacity: 0,
  147. y: 100
  148. }"
  149. :enter="{
  150. opacity: 1,
  151. y: 0,
  152. transition: {
  153. delay: 400
  154. }
  155. }"
  156. >
  157. <el-card>
  158. <template #header>
  159. <div>
  160. <span>GitHub折线图信息</span>
  161. </div>
  162. </template>
  163. <el-skeleton animated :rows="7" :loading="loading">
  164. <template #default>
  165. <ReLine />
  166. </template>
  167. </el-skeleton>
  168. </el-card>
  169. </el-col>
  170. <el-col
  171. :xs="24"
  172. :sm="24"
  173. :md="24"
  174. :lg="8"
  175. :xl="8"
  176. style="margin-bottom: 20px"
  177. v-motion
  178. :initial="{
  179. opacity: 0,
  180. y: 100
  181. }"
  182. :enter="{
  183. opacity: 1,
  184. y: 0,
  185. transition: {
  186. delay: 400
  187. }
  188. }"
  189. >
  190. <el-card>
  191. <template #header>
  192. <div>
  193. <span>GitHub柱状图信息</span>
  194. </div>
  195. </template>
  196. <el-skeleton animated :rows="7" :loading="loading">
  197. <template #default>
  198. <ReBar />
  199. </template>
  200. </el-skeleton>
  201. </el-card>
  202. </el-col>
  203. </el-row>
  204. </div>
  205. </template>
  206. <style module scoped>
  207. .size {
  208. height: 335px;
  209. }
  210. </style>
  211. <style lang="scss" scoped>
  212. .main-content {
  213. margin: 0;
  214. }
  215. .welcome {
  216. height: 100%;
  217. .top-content {
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. height: 60px;
  222. background: #fff;
  223. .left-mark {
  224. display: flex;
  225. align-items: center;
  226. img {
  227. display: block;
  228. width: 50px;
  229. height: 50px;
  230. border-radius: 50%;
  231. margin-right: 10px;
  232. cursor: pointer;
  233. }
  234. span {
  235. font-size: 14px;
  236. }
  237. }
  238. }
  239. }
  240. </style>