home-cards.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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), 0px 8px 20px rgba(237, 239, 245, 0.48);
  83. }
  84. img {
  85. margin: 48px auto;
  86. }
  87. h3 {
  88. margin: 0;
  89. font-size: 18px;
  90. color: var(--el-text-color-primary);
  91. font-weight: normal;
  92. }
  93. p {
  94. font-size: 14px;
  95. color: #99a9bf;
  96. padding: 0 25px;
  97. line-height: 20px;
  98. }
  99. a {
  100. height: 53px;
  101. line-height: 52px;
  102. font-size: 14px;
  103. color: var(--brand-color);
  104. text-align: center;
  105. border: 0;
  106. border-top: 1px solid var(--border-color);
  107. padding: 0;
  108. cursor: pointer;
  109. width: 100%;
  110. position: absolute;
  111. bottom: 0;
  112. left: 0;
  113. background-color: var(--bg-color);
  114. border-radius: 0 0 5px 5px;
  115. transition: all 0.3s;
  116. text-decoration: none;
  117. display: block;
  118. &:hover {
  119. color: #fff;
  120. background: var(--brand-color);
  121. }
  122. }
  123. &:hover {
  124. bottom: 6px;
  125. // box-shadow: 0 6px 18px 0 rgba(232, 237, 250, 0.5);
  126. }
  127. }
  128. @media (max-width: 1140px) {
  129. .cards {
  130. width: 100%;
  131. .container {
  132. width: 100%;
  133. margin: 0;
  134. }
  135. }
  136. .banner .container {
  137. width: 100%;
  138. box-sizing: border-box;
  139. }
  140. .banner img {
  141. right: 0;
  142. }
  143. }
  144. }
  145. .dark {
  146. .home-page {
  147. .card {
  148. &:hover {
  149. box-shadow: 0px 12px 32px 4px rgba(9, 11, 16, 0.24), 0px 8px 20px rgba(9, 11, 16, 0.48);
  150. }
  151. }
  152. }
  153. }
  154. </style>