LayoutCard.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script setup>
  2. defineProps({
  3. title: {
  4. type: String,
  5. default: ''
  6. },
  7. isLarge: {
  8. type: Boolean,
  9. default: false
  10. }
  11. });
  12. </script>
  13. <template>
  14. <section :class="['layout-card', { 'layout-card_large': isLarge }]">
  15. <div class="card-header">
  16. <p class="title">{{ title }}</p>
  17. </div>
  18. <div class="card-content">
  19. <slot></slot>
  20. </div>
  21. </section>
  22. </template>
  23. <style lang="scss" scoped>
  24. .layout-card {
  25. position: relative;
  26. border-radius: 10px;
  27. border:1px solid rgba(49, 110,175, .3);
  28. background: linear-gradient(180deg, rgba(3, 86, 189, 0.28) 0%, rgba(3, 86, 189, 0.06) 34.06%, rgba(3, 86, 189, 0.00) 50.95%, rgba(3, 86, 189, 0.28) 100%);
  29. .card-header {
  30. height: 94px;
  31. background: url('@/assets/images/carbon/bg-title.png') -16px -10px no-repeat;
  32. background-size: 103% 100%;
  33. .title {
  34. @include flex(x, center, start);
  35. height: 46px;
  36. padding-left: 57px;
  37. background: linear-gradient(180deg, #FFF 28.71%, #9CD2FF 77.35%);
  38. background-clip: text;
  39. -webkit-background-clip: text;
  40. -webkit-text-fill-color: transparent;
  41. font-family: YouSheBiaoTiHei;
  42. font-size: 22px;
  43. font-weight: 400;
  44. }
  45. }
  46. .card-content {
  47. position: absolute;
  48. top: 46px;
  49. left: 0;
  50. width: 100%;
  51. height: calc(100% - 46px);
  52. }
  53. }
  54. .layout-card_large {
  55. .card-header {
  56. height: 94px;
  57. background: url('@/assets/images/carbon/bg-large-title2.png') left 0px no-repeat;
  58. background-size: 100% 94%;
  59. .title {
  60. padding-left: 7%;
  61. }
  62. }
  63. }
  64. </style>