project.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. @if (project){
  2. <section id='details'>
  3. @if (project.images.length > 0){
  4. <img
  5. (click)='galleryOpen(getGalleryIndexForProjectImage(project.images[0].id))'
  6. id='img-{{ getGalleryIndexForProjectImage(project.images[0].id) }}' class='img img_main'
  7. src='{{ this.apiURL }}{{ project.images[0].path }}'
  8. alt='{{ project.images[0].title }}' srcset="{{ utilService.generateSrcset(apiURL + project.images[0].path) }}"
  9. attr.data-description='{{ project.images[0].description }}' attr.data-child-title=''
  10. />
  11. }
  12. <h2 id='project_title'>{{ project.title }}</h2>
  13. <p [innerHTML]='project.description'></p>
  14. </section>
  15. <section id='images'>
  16. @for (image of project.images; track image.id; let imageIndex = $index) {
  17. @if (imageIndex > 0){
  18. @if (image.video == 0){
  19. <img
  20. (click)='galleryOpen(getGalleryIndexForProjectImage(image.id))'
  21. id='img-{{ getGalleryIndexForProjectImage(image.id) }}' class='img'
  22. src='{{ this.apiURL }}{{ image.path }}'
  23. alt='{{ image.title }}' srcset="{{ utilService.generateSrcset(apiURL + image.path) }}"
  24. attr.data-description='{{ image.description }}' data-video='false' attr.data-child-title=''
  25. />
  26. }
  27. @else{
  28. <video
  29. muted (click)='galleryOpen(getGalleryIndexForProjectImage(image.id))'
  30. class='img img_vid' id='img-{{ getGalleryIndexForProjectImage(image.id) }}' playsinline
  31. src='{{ this.apiURL }}{{ image.path }}' data-video='true' attr.data-description='{{ image.description }}' attr.data-child-title=''
  32. >
  33. </video>
  34. <img
  35. (click)='galleryOpen(getGalleryIndexForProjectImage(image.id))' class='video_play' type="video/mp4"
  36. src='/img/icon/video.png' alt='{{ image.title }}'
  37. />
  38. }
  39. }
  40. }
  41. </section>
  42. @if ((project.children?.length ?? 0) > 0){
  43. @for (child of project.children; track child.id) {
  44. <section class='children'>
  45. <section class='children-details'>
  46. <h3 id='project_title'>{{ child.title }}</h3>
  47. <p [innerHTML]='child.description'></p>
  48. </section>
  49. <section class='children-images'>
  50. @for (image of child.images; track image.id) {
  51. @if (image.video == 0){
  52. <img
  53. (click)='galleryOpen(getGalleryIndexForChildImage(child.id, image.id))'
  54. id='img-{{ getGalleryIndexForChildImage(child.id, image.id) }}' class='img'
  55. src='{{ this.apiURL }}{{ image.path }}' alt='{{ image.title }}'
  56. srcset="{{ utilService.generateSrcset(apiURL + image.path) }}"
  57. attr.data-description='{{ image.description }}' data-video='false' attr.data-child-title='{{ child.title }}'
  58. />
  59. }
  60. @else{
  61. <video
  62. muted (click)='galleryOpen(getGalleryIndexForChildImage(child.id, image.id))'
  63. class='img img_vid' id='img-{{ getGalleryIndexForChildImage(child.id, image.id) }}'
  64. src='{{ this.apiURL }}{{ image.path }}' playsinline
  65. data-video='true' attr.data-description='{{ image.description }}' attr.data-child-title='{{ child.title }}'
  66. >
  67. </video>
  68. <img
  69. (click)='galleryOpen(getGalleryIndexForChildImage(child.id, image.id))' class='video_play' type="video/mp4"
  70. src='/img/icon/video.png' alt='{{ image.title }}'
  71. />
  72. }
  73. }
  74. </section>
  75. </section>
  76. }
  77. }
  78. <div id='gallery-cover' (click)='galleryClose();'></div>
  79. <div id='gallery' (touchstart)="gallerySwipe($event, 'start')" (touchend)="gallerySwipe($event, 'end')">
  80. <div id='gallery-fade'></div>
  81. <h3>
  82. <span>{{ project.title }}</span>
  83. <span id='gallery-title'></span>
  84. <input type='button' id='gallery-next' class='gallery-control' (click)='galleryClose();' value='X'/>
  85. </h3>
  86. <div id='gallery-content'>
  87. <div id='gallery-flex'>
  88. <div id='gallery-flex-img-container'>
  89. <img id='gallery-img'/>
  90. <video controls autoplay playsinline type="video/mp4" id='gallery-video'></video>
  91. </div>
  92. <p id='gallery-text'></p>
  93. </div>
  94. <div id='gallery-controls'>
  95. <input type='button' id='gallery-prev' class='gallery-control' (click)='galleryPrev();' value='<'/>
  96. <input type='button' id='gallery-next' class='gallery-control' (click)='galleryNext();' value='>'/>
  97. </div>
  98. </div>
  99. </div>
  100. }