logo

pleroma-fe

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

shout_panel.vue (2910B)


  1. <template>
  2. <div
  3. v-if="!collapsed || !floating"
  4. class="shout-panel"
  5. >
  6. <div class="panel panel-default">
  7. <div
  8. class="panel-heading"
  9. :class="{ 'shout-heading': floating }"
  10. @click.stop.prevent="togglePanel"
  11. >
  12. <div class="title">
  13. {{ $t('shoutbox.title') }}
  14. <FAIcon
  15. v-if="floating"
  16. icon="times"
  17. class="close-icon"
  18. />
  19. </div>
  20. </div>
  21. <div class="panel-body shout-window">
  22. <div
  23. v-for="message in messages"
  24. :key="message.id"
  25. class="shout-message"
  26. >
  27. <span class="shout-avatar">
  28. <img :src="message.author.avatar">
  29. </span>
  30. <div class="shout-content">
  31. <router-link
  32. class="shout-name"
  33. :to="userProfileLink(message.author)"
  34. >
  35. {{ message.author.username }}
  36. </router-link>
  37. <br>
  38. <span class="shout-text">
  39. {{ message.text }}
  40. </span>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="panel-body shout-input">
  45. <textarea
  46. v-model="currentMessage"
  47. class="shout-input-textarea input"
  48. rows="1"
  49. @keyup.enter="submit(currentMessage)"
  50. />
  51. </div>
  52. </div>
  53. </div>
  54. <div
  55. v-else
  56. class="shout-panel"
  57. >
  58. <div class="panel panel-default">
  59. <div
  60. class="panel-heading -stub timeline-heading shout-heading"
  61. @click.stop.prevent="togglePanel"
  62. >
  63. <div class="title">
  64. <FAIcon
  65. class="icon"
  66. icon="bullhorn"
  67. />
  68. {{ $t('shoutbox.title') }}
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script src="./shout_panel.js"></script>
  75. <style lang="scss">
  76. .floating-shout {
  77. position: fixed;
  78. bottom: 0.5em;
  79. z-index: var(--ZI_popovers);
  80. max-width: 25em;
  81. &.-left {
  82. left: 0.5em;
  83. }
  84. &:not(.-left) {
  85. right: 0.5em;
  86. }
  87. }
  88. .shout-panel {
  89. .shout-heading {
  90. cursor: pointer;
  91. .icon {
  92. color: var(--text);
  93. margin-right: 0.5em;
  94. }
  95. .title {
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. }
  100. }
  101. .shout-window {
  102. overflow-y: auto;
  103. overflow-x: hidden;
  104. max-height: 20em;
  105. }
  106. .shout-window-container {
  107. height: 100%;
  108. }
  109. .shout-message {
  110. display: flex;
  111. padding: 0.2em 0.5em;
  112. }
  113. .shout-avatar {
  114. img {
  115. height: 24px;
  116. width: 24px;
  117. border-radius: var(--roundness);
  118. margin-right: 0.5em;
  119. margin-top: 0.25em;
  120. }
  121. }
  122. .shout-input {
  123. display: flex;
  124. textarea {
  125. flex: 1;
  126. margin: 0.6em;
  127. min-height: 3.5em;
  128. resize: none;
  129. }
  130. }
  131. .shout-panel {
  132. .title {
  133. display: flex;
  134. justify-content: space-between;
  135. }
  136. }
  137. }
  138. </style>