home-cards.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <script lang="ts" setup>
  2. import { computed } from 'vue'
  3. import { useLang } from '../../composables/lang'
  4. import homeLocale from '../../../i18n/pages/home.json'
  5. const lang = useLang()
  6. const homeLang = computed(() => homeLocale[lang.value])
  7. </script>
  8. <template>
  9. <div class="cards">
  10. <ul class="container">
  11. <li>
  12. <div class="card">
  13. <guide-svg w="40" m="y-12" />
  14. <h3>{{ homeLang['3'] }}</h3>
  15. <p>{{ homeLang['4'] }}</p>
  16. <a :href="`/${lang}/guide/design.html`">{{ homeLang['5'] }}</a>
  17. </div>
  18. </li>
  19. <li>
  20. <div class="card">
  21. <component-svg w="40" m="y-12" />
  22. <h3>{{ homeLang['6'] }}</h3>
  23. <p>{{ homeLang['7'] }}</p>
  24. <a :href="`/${lang}/component/layout.html`">
  25. {{ homeLang['5'] }}
  26. </a>
  27. </div>
  28. </li>
  29. <li>
  30. <div class="card">
  31. <resource-svg w="40" m="y-12" />
  32. <h3>{{ homeLang['8'] }}</h3>
  33. <p>{{ homeLang['9'] }}</p>
  34. <a :href="`/${lang}/resource/index.html`"> {{ homeLang['5'] }} </a>
  35. </div>
  36. </li>
  37. </ul>
  38. </div>
  39. </template>
  40. <style lang="scss">
  41. .home-page {
  42. .cards {
  43. margin: 0 auto 110px;
  44. max-width: 900px;
  45. .container {
  46. padding: 0;
  47. margin: 0 -11px;
  48. width: auto;
  49. &::before,
  50. &::after {
  51. display: table;
  52. content: '';
  53. }
  54. &::after {
  55. clear: both;
  56. }
  57. }
  58. li {
  59. width: 33.3%;
  60. padding: 0 19px;
  61. box-sizing: border-box;
  62. float: left;
  63. list-style: none;
  64. }
  65. img {
  66. width: 160px;
  67. height: 120px;
  68. }
  69. }
  70. .card {
  71. height: 430px;
  72. width: 100%;
  73. background: var(--bg-color);
  74. border: 1px solid var(--border-color);
  75. border-radius: 5px;
  76. box-sizing: border-box;
  77. text-align: center;
  78. position: relative;
  79. transition: all 0.3s ease-in-out;
  80. bottom: 0;
  81. &:hover {
  82. box-shadow: 0px 12px 32px 4px rgba(237, 239, 245, 0.24),
  83. 0px 8px 20px rgba(237, 239, 245, 0.48);
  84. }
  85. img {
  86. margin: 48px auto;
  87. }
  88. h3 {
  89. margin: 0;
  90. font-size: 18px;
  91. color: var(--el-text-color-primary);
  92. font-weight: normal;
  93. }
  94. p {
  95. font-size: 14px;
  96. color: #99a9bf;
  97. padding: 0 25px;
  98. line-height: 20px;
  99. }
  100. a {
  101. height: 53px;
  102. line-height: 52px;
  103. font-size: 14px;
  104. color: var(--brand-color);
  105. text-align: center;
  106. border: 0;
  107. border-top: 1px solid var(--border-color);
  108. padding: 0;
  109. cursor: pointer;
  110. width: 100%;
  111. position: absolute;
  112. bottom: 0;
  113. left: 0;
  114. background-color: var(--bg-color);
  115. border-radius: 0 0 5px 5px;
  116. transition: all 0.3s;
  117. text-decoration: none;
  118. display: block;
  119. &:hover {
  120. color: #fff;
  121. background: var(--brand-color);
  122. }
  123. }
  124. &:hover {
  125. bottom: 6px;
  126. // box-shadow: 0 6px 18px 0 rgba(232, 237, 250, 0.5);
  127. }
  128. }
  129. @media (max-width: 1140px) {
  130. .cards {
  131. width: 100%;
  132. .container {
  133. width: 100%;
  134. margin: 0;
  135. }
  136. }
  137. .banner .container {
  138. width: 100%;
  139. box-sizing: border-box;
  140. }
  141. .banner img {
  142. right: 0;
  143. }
  144. }
  145. }
  146. .dark {
  147. .home-page {
  148. .card {
  149. &:hover {
  150. box-shadow: 0px 12px 32px 4px rgba(9, 11, 16, 0.24),
  151. 0px 8px 20px rgba(9, 11, 16, 0.48);
  152. }
  153. }
  154. }
  155. }
  156. </style>