PersonCard.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div class="flex flex-col justify-center items-center">
  3. <img :src="`/${$props.avatar}`" alt="avatar" height="200" width="200" class="rounded-full mb-3">
  4. <p class="text-xl font-semibold" v-text="$props.name" />
  5. <p class="text-2xl mb-2" v-text="$props.nickname" />
  6. <div class="flex justify-between px-8 w-full">
  7. <div v-if="$props.vk" @click="openURL($props.vk)">
  8. <IVk height="36" width="36" class="hover:text-blue-300 duration-150" />
  9. </div>
  10. <div v-if="$props.tg" @click="openURL($props.tg)">
  11. <ITg height="36" width="36" class="hover:text-[#29a0dc] duration-150" />
  12. </div>
  13. <div v-if="$props.github" @click="openURL($props.github)">
  14. <IGithub height="36" width="36" class="hover:text-black hover:text-opacity-50 duration-150" />
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script setup lang="ts">
  20. import { Browser } from '@capacitor/browser'
  21. defineProps<{
  22. name: string
  23. nickname: string
  24. avatar: string
  25. github: string
  26. vk: string
  27. tg: string
  28. }>()
  29. async function openURL(url: string) {
  30. await Browser.open({ url })
  31. }
  32. </script>