AppLink.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <NuxtLink
  3. :to="href"
  4. class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition"
  5. :class="[ variantStyles[ variant ] ]">
  6. <IconsArrow
  7. v-if="arrow === 'left'"
  8. class="mt-0.5 h-5 w-5"
  9. :class="{
  10. 'relative top-px': variant === 'text',
  11. '-ml-1 rotate-180': arrow === 'left',
  12. '-mr-1': arrow === 'right'
  13. }"/>
  14. <slot/>
  15. <IconsArrow
  16. v-if="arrow === 'right'"
  17. class="mt-0.5 h-5 w-5"
  18. :class="{
  19. 'relative top-px': variant === 'text',
  20. '-ml-1 rotate-180': arrow === 'left',
  21. '-mr-1': arrow === 'right'
  22. }"/>
  23. </NuxtLink>
  24. </template>
  25. <script setup>
  26. const props = defineProps({
  27. variant: {
  28. default: 'primary'
  29. },
  30. arrow: {
  31. default: ''
  32. },
  33. href: {
  34. default: ''
  35. }
  36. })
  37. const variantStyles = ref({
  38. primary: 'rounded-full py-1 px-3 bg-emerald-400/10 text-emerald-400 ring-1 ring-inset ring-emerald-400/20 hover:bg-emerald-400/10 hover:text-emerald-300 hover:ring-emerald-300',
  39. secondary: 'rounded-full py-1 px-3 bg-zinc-800/40 text-zinc-400 ring-1 ring-inset ring-zinc-800 hover:bg-zinc-800 hover:text-zinc-300',
  40. filled: 'rounded-full py-1 px-3 bg-emerald-500 text-white hover:bg-emerald-400',
  41. outline: 'rounded-full py-1 px-3 ring-1 ring-inset hover:bg-zinc-900/2.5 hover:text-zinc-900 text-zinc-400 ring-white/10 hover:bg-white/5 hover:text-white',
  42. text: 'text-link hover:text-link',
  43. })
  44. </script>