showCaseCommon.html 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. {{ if .Params.gallery }}
  2. <i id="playButton" class=" fas fa-play"></i>
  3. {{ range $index, $value := (shuffle (union .Params.images .Params.gallery) ) }}
  4. {{ if or (strings.HasPrefix . "youtube:" ) }}
  5. <iframe loading="lazy" class="showcaseElement cover youtubeVid" style='display: {{ if not $index }} block {{else}} none {{end}}'
  6. {{ if not $index }} src {{else}} lazy="true" lazy-src {{end}} ="https://www.youtube-nocookie.com/embed/{{ index ( last 1 ( split . ":" )) 0 }}" frameborder="0"
  7. allow="accelerometer; autoplay; encrypted-media; gyroscope; fullscreen"></iframe>
  8. {{ else if (strings.HasSuffix . ".webm" ) }}
  9. <video class="showcaseElement cover" style='display:{{ if not $index }} block {{else}} none {{end}} ' preload="none"
  10. class="cover">
  11. <source src="{{ safeURL .}}" type="video/webm">
  12. </video>
  13. </div>
  14. {{ else if (strings.HasSuffix . ".mp4" ) }}
  15. <video class="showcaseElement cover" style='display:{{ if not $index }} block {{else}} none {{end}} ' preload="none"
  16. class="cover">
  17. <source type="video/mp4" src="{{ safeURL .}}" >
  18. </video>
  19. {{ else }}
  20. <div class="showcaseElement" style='display:{{ if not $index }} block {{else}} none {{end}} '>
  21. <div class="cover blur" {{ if not $index }} style {{else}} lazy="true" lazy-style {{end}} ="background-image: url('{{ safeURL . }}'); " ></div>
  22. <div class="cover" {{ if not $index }} style {{else}} lazy="true" lazy-style {{end}} ="background-image: url('{{ safeURL . }}'); " ></div>
  23. </div>
  24. {{ end }}
  25. {{end}}
  26. {{end}}