SubTitle.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <LayoutContainer>
  3. <div class="title-container">
  4. <v-icon
  5. :size="iconSize"
  6. :style="{ color: iconColor }"
  7. :class="iconClasses"
  8. />
  9. <h4 class="presentation-title" :style="{ color: titleColor }">
  10. {{ titleText }}
  11. </h4>
  12. </div>
  13. </LayoutContainer>
  14. </template>
  15. <script setup>
  16. const router = useRouter();
  17. const iconColor = ref("#2093BE4D");
  18. const updateIconColor = computed(() => {
  19. const path = router.currentRoute.value.path;
  20. if (/^\/opentalent_school\/?$/.test(path)) {
  21. return "#2093BE4D";
  22. } else if (/^\/opentalent_artist\/?$/.test(path)) {
  23. return "#FAC20A";
  24. } else if (/^\/opentalent_manager\/?$/.test(path)) {
  25. return "#D8050B";
  26. } else {
  27. return "#9edbdd";
  28. }
  29. });
  30. watch(
  31. () => router.currentRoute.value,
  32. () => {
  33. iconColor.value = updateIconColor.value;
  34. },
  35. { immediate: true }
  36. );
  37. const props = defineProps({
  38. iconSize: {
  39. type: [String, Number],
  40. default: 5,
  41. },
  42. iconClasses: {
  43. type: String,
  44. default: "fa-solid fa-circle icon-title",
  45. },
  46. titleText: {
  47. type: String,
  48. default: "default title",
  49. },
  50. iconColor: {
  51. type: String,
  52. },
  53. titleColor: {
  54. type: String,
  55. default: "#071b1f",
  56. },
  57. });
  58. </script>
  59. <style scoped>
  60. .title-container {
  61. display: flex;
  62. align-items: center;
  63. gap: 0.5rem;
  64. margin-left: 1rem;
  65. color: #071b1f;
  66. font-size: 10px;
  67. font-weight: 600;
  68. line-height: 15px;
  69. letter-spacing: 1.8px;
  70. text-transform: uppercase;
  71. }
  72. .presentation-title {
  73. font-weight: 500;
  74. color: var(--Vert-90, #0E2D32);
  75. font-size: 1rem;
  76. line-height: 15px;
  77. letter-spacing: 1px;
  78. text-transform: uppercase;
  79. }
  80. </style>