SsGridEntrance.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <script setup lang="ts">
  2. const props = defineProps({
  3. title: {
  4. type: String,
  5. required: true
  6. },
  7. subject: {
  8. type: String,
  9. default: ''
  10. },
  11. image: {
  12. type: String,
  13. default: ''
  14. },
  15. subClass: {
  16. type: String,
  17. default: ''
  18. }
  19. })
  20. const emit = defineEmits(['click'])
  21. const click = () => {
  22. emit('click')
  23. }
  24. </script>
  25. <template>
  26. <view class="entrance hover-scale" :class="subClass" @tap="click">
  27. <view class="entrance-content">
  28. <view class="title">{{ title }}</view>
  29. <view class="subject">{{ subject }}</view>
  30. </view>
  31. <image class="entrance-image" fit="contain" :src="image" />
  32. </view>
  33. </template>
  34. <style scoped lang="scss">
  35. .entrance {
  36. position: relative;
  37. overflow: hidden;
  38. border-radius: 1.25rem;
  39. padding: 1.5rem 1.25rem;
  40. background: linear-gradient(180deg, #FFFFFF, #E5F7FF);
  41. box-shadow: 0 0.25rem 1.25rem 0 rgba(52, 149, 239, 0.4);
  42. .entrance-content {
  43. position: relative;
  44. z-index: 10;
  45. .title {
  46. font-size: 0.88rem;
  47. font-weight: bold;
  48. color: #101333;
  49. line-height: 0.88rem;
  50. margin-bottom: 0.5rem;
  51. }
  52. .subject {
  53. font-size: 0.8rem;
  54. color: #7E8AA2;
  55. }
  56. }
  57. .entrance-image {
  58. position: absolute;
  59. bottom: 0;
  60. right: 2.13rem;
  61. width: 6rem;
  62. height: 4.7rem;
  63. }
  64. &.yellow {
  65. background: linear-gradient(180deg, #FFFFFF, #FFF1F0);
  66. }
  67. }
  68. @media screen and (max-width: 750px) {
  69. .entrance {
  70. padding: 1rem 0.75rem;
  71. border-radius: 0.75rem;
  72. .entrance-image {
  73. width: 4.13rem;
  74. height: 3.63rem;
  75. right: 0;
  76. }
  77. }
  78. }
  79. </style>