MixedAlbumPresenter.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. <div v-else-if="media.type == 'Image'" slot="img" :class="media.filter_class">
  20. <img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description">
  21. </div>
  22. <p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  23. </b-carousel-slide>
  24. </b-carousel>
  25. </details>
  26. </div>
  27. <div v-else>
  28. <b-carousel :id="status.id + '-carousel'"
  29. style="text-shadow: 1px 1px 2px #333; background-color: #000;"
  30. controls
  31. img-blank
  32. background="#ffffff"
  33. :interval="0"
  34. >
  35. <b-carousel-slide v-for="(media, index) in status.media_attachments" :key="media.id + '-media'">
  36. <video v-if="media.type == 'Video'" slot="img" class="embed-responsive-item" preload="none" controls loop :alt="media.description" width="100%" height="100%">
  37. <source :src="media.url" :type="media.mime">
  38. </video>
  39. <div v-else-if="media.type == 'Image'" slot="img" :class="media.filter_class">
  40. <img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description">
  41. </div>
  42. <p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  43. </b-carousel-slide>
  44. </b-carousel>
  45. </div>
  46. </template>
  47. <script type="text/javascript">
  48. export default {
  49. props: ['status']
  50. }
  51. </script>