MixedAlbumPresenter.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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%" :poster="media.preview_url">
  17. <source :src="media.url" :type="media.mime">
  18. </video>
  19. <div v-else-if="media.type == 'Image'" slot="img" :title="media.description">
  20. <img :class="media.filter_class + ' d-block img-fluid w-100'" :src="media.url" :alt="media.description" loading="lazy" onerror="this.onerror=null;this.src='/storage/no-preview.png'">
  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 class="w-100 h-100 p-0">
  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 :title="media.description" width="100%" height="100%" :poster="media.preview_url">
  37. <source :src="media.url" :type="media.mime">
  38. </video>
  39. <div v-else-if="media.type == 'Image'" slot="img" :title="media.description">
  40. <img :class="media.filter_class + ' d-block img-fluid w-100'" :src="media.url" :alt="media.description" loading="lazy">
  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. <carousel ref="carousel" :centerMode="true" :loop="false" :per-page="1" :paginationPosition="'bottom-overlay'" paginationActiveColor="#3897f0" paginationColor="#dbdbdb" class="p-0 m-0">
  46. <slide v-for="(media, index) in status.media_attachments" :key="'px-carousel-'+media.id + '-' + index" class="w-100 h-100 d-block mx-auto text-center" style="background: #000; display: flex;align-items: center;">
  47. <video v-if="media.type == 'Video'" class="embed-responsive-item" preload="none" controls loop :title="media.description" width="100%" height="100%" :poster="media.preview_url">
  48. <source :src="media.url" :type="media.mime">
  49. </video>
  50. <div v-else-if="media.type == 'Image'" :title="media.description">
  51. <img :class="media.filter_class + ' img-fluid w-100'" :src="media.url" :alt="media.description" loading="lazy" onerror="this.onerror=null;this.src='/storage/no-preview.png'">
  52. </div>
  53. <p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  54. </slide>
  55. </carousel>
  56. </div>
  57. </template>
  58. <script type="text/javascript">
  59. export default {
  60. props: ['status']
  61. }
  62. </script>