grid-card.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="discover-grid-card">
  3. <div
  4. class="discover-grid-card-body"
  5. :class="{ 'dark': dark, 'small': small }"
  6. >
  7. <div class="section-copy">
  8. <p class="subtitle">{{ subtitle }}</p>
  9. <h1 class="title">{{ title }}</h1>
  10. <button v-if="buttonText" class="btn btn-outline-dark rounded-pill py-1" @click.prevent="handleLink()">{{ buttonText }}</button>
  11. </div>
  12. <div class="section-icon">
  13. <i :class="iconClass"></i>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script type="text/javascript">
  19. export default {
  20. props: {
  21. small: {
  22. type: Boolean,
  23. default: false
  24. },
  25. dark: {
  26. type: Boolean,
  27. default: false
  28. },
  29. subtitle: {
  30. type: String
  31. },
  32. title: {
  33. type: String
  34. },
  35. buttonText: {
  36. type: String
  37. },
  38. buttonLink: {
  39. type: String
  40. },
  41. buttonEvent: {
  42. type: Boolean,
  43. default: false
  44. },
  45. iconClass: {
  46. type: String
  47. }
  48. },
  49. methods: {
  50. handleLink() {
  51. if(this.buttonEvent == true) {
  52. this.$emit('btn-click');
  53. return;
  54. }
  55. if(!this.buttonLink || this.buttonLink == undefined) {
  56. swal('Oops', 'This is embarassing, we cannot redirect you to the proper page at the moment', 'warning');
  57. return;
  58. }
  59. this.$router.push(this.buttonLink);
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .discover-grid-card {
  66. width: 100%;
  67. &-body {
  68. width: 100%;
  69. padding: 3rem 3rem 0;
  70. border-radius: 8px;
  71. text-align: center;
  72. color: #212529;
  73. background: #f8f9fa;
  74. overflow: hidden;
  75. .section-copy {
  76. margin-top: 1rem;
  77. margin-bottom: 1rem;
  78. padding-top: 1rem;
  79. padding-bottom: 1rem;
  80. .subtitle {
  81. font-size: 16px;
  82. margin-bottom: 0;
  83. color: #6c757d;
  84. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  85. letter-spacing: -0.7px;
  86. }
  87. .title,
  88. .btn {
  89. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  90. letter-spacing: -0.7px;
  91. }
  92. }
  93. .section-icon {
  94. display: flex;
  95. justify-content: center;
  96. align-items: center;
  97. margin-left: auto;
  98. margin-right: auto;
  99. width: 80%;
  100. height: 300px;
  101. border-radius: 21px 21px 0 0;
  102. background: #232526;
  103. background: linear-gradient(to right, #414345, #232526);
  104. box-shadow: 0 0.125rem 0.25rem rgb(0 0 0 / 8%) !important;
  105. i {
  106. color: #fff;
  107. font-size: 10rem;
  108. }
  109. }
  110. &.small {
  111. .section-icon {
  112. height: 120px;
  113. i {
  114. font-size: 4rem;
  115. }
  116. }
  117. }
  118. &.dark {
  119. color: #fff;
  120. background: #232526;
  121. background: linear-gradient(to right, #414345, #232526);
  122. .section-icon {
  123. color: #fff;
  124. background: #f8f9fa;
  125. i {
  126. color: #232526;
  127. }
  128. }
  129. .btn-outline-dark {
  130. color: #f8f9fa;
  131. border-color: #f8f9fa;
  132. }
  133. }
  134. }
  135. }
  136. </style>