MixedAlbumPresenter.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div v-if="status.sensitive == true">
  3. <details class="details-animated">
  4. <summary>
  5. <p class="mb-0 lead font-weight-bold">{{ status.spoiler_text ? status.spoiler_text : 'CW / NSFW / Hidden Media'}}</p>
  6. <p class="font-weight-light">(click to show)</p>
  7. </summary>
  8. <b-carousel :id="status.id + '-carousel'"
  9. style="text-shadow: 1px 1px 2px #333; background-color: #000;"
  10. controls
  11. img-blank
  12. background="#ffffff"
  13. :interval="0"
  14. >
  15. <b-carousel-slide v-for="(media, index) in status.media_attachments" :key="media.id + '-media'">
  16. <video v-if="media.type == 'Video'" slot="img" class="embed-responsive-item" preload="none" controls loop :alt="media.description" width="100%" height="100%">
  17. <source :src="media.url" :type="media.mime">
  18. </video>
  19. <img v-else-if="media.type == 'Image'" slot="img" class="d-block img-fluid w-100" :src="media.url" :alt="media.description">
  20. <p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  21. </b-carousel-slide>
  22. </b-carousel>
  23. </details>
  24. </div>
  25. <div v-else>
  26. <b-carousel :id="status.id + '-carousel'"
  27. style="text-shadow: 1px 1px 2px #333; background-color: #000;"
  28. controls
  29. img-blank
  30. background="#ffffff"
  31. :interval="0"
  32. >
  33. <b-carousel-slide v-for="(media, index) in status.media_attachments" :key="media.id + '-media'">
  34. <video v-if="media.type == 'Video'" slot="img" class="embed-responsive-item" preload="none" controls loop :alt="media.description" width="100%" height="100%">
  35. <source :src="media.url" :type="media.mime">
  36. </video>
  37. <img v-else-if="media.type == 'Image'" slot="img" class="d-block img-fluid w-100" :src="media.url" :alt="media.description">
  38. <p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  39. </b-carousel-slide>
  40. </b-carousel>
  41. </div>
  42. </template>
  43. <script type="text/javascript">
  44. export default {
  45. props: ['status']
  46. }
  47. </script>