logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

user_avatar.vue (1914B)


  1. <template>
  2. <span
  3. class="Avatar"
  4. :class="{ '-compact': compact }"
  5. >
  6. <StillImage
  7. v-if="user"
  8. class="avatar"
  9. :alt="user.screen_name_ui"
  10. :title="user.screen_name_ui"
  11. :src="imgSrc(user.profile_image_url_original)"
  12. :image-load-error="imageLoadError"
  13. :class="{ '-compact': compact, '-better-shadow': betterShadow }"
  14. />
  15. <div
  16. v-else
  17. class="avatar -placeholder"
  18. :class="{ '-compact': compact }"
  19. />
  20. <FAIcon
  21. v-if="showActorTypeIndicator && user?.actor_type === 'Service'"
  22. icon="robot"
  23. class="actor-type-indicator"
  24. />
  25. <FAIcon
  26. v-if="showActorTypeIndicator && user?.actor_type === 'Group'"
  27. icon="people-group"
  28. class="actor-type-indicator"
  29. />
  30. </span>
  31. </template>
  32. <script src="./user_avatar.js"></script>
  33. <style lang="scss">
  34. .Avatar {
  35. --_avatarShadowBox: var(--shadow);
  36. --_avatarShadowFilter: var(--shadowFilter);
  37. --_avatarShadowInset: var(--shadowInset);
  38. --_still-image-label-visibility: hidden;
  39. display: inline-block;
  40. position: relative;
  41. width: 48px;
  42. height: 48px;
  43. &.-compact {
  44. width: 32px;
  45. height: 32px;
  46. border-radius: var(--roundness);
  47. }
  48. .avatar {
  49. width: 100%;
  50. height: 100%;
  51. box-shadow: var(--_avatarShadowBox);
  52. border-radius: var(--roundness);
  53. &.-better-shadow {
  54. box-shadow: var(--_avatarShadowInset);
  55. filter: var(--_avatarShadowFilter);
  56. }
  57. &.-animated::before {
  58. display: none;
  59. }
  60. &.-compact {
  61. border-radius: var(--roundness);
  62. }
  63. &.-placeholder {
  64. background-color: var(--background);
  65. }
  66. }
  67. img {
  68. width: 100%;
  69. height: 100%;
  70. }
  71. .actor-type-indicator {
  72. position: absolute;
  73. bottom: 0;
  74. right: 0;
  75. margin: -0.2em;
  76. padding: 0.2em;
  77. background: rgb(127 127 127 / 50%);
  78. color: #fff;
  79. border-radius: var(--roundness);
  80. }
  81. }
  82. </style>