index.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. <head>
  4. {{ partial "headers.html" . }}
  5. </head>
  6. <body style="overflow-x: hidden;">
  7. <div id="all">
  8. {{ partial "nav.html" . }}
  9. {{ partial "carousel.html" . }}
  10. {{ partial "features.html" . }}
  11. {{ partial "footer.html" . }}
  12. </div>
  13. {{ partial "scripts.html" . }}
  14. <script>
  15. // 暫時隱藏首頁第一篇作品(因文案尚未確定)
  16. // let bottomBox = document.querySelector('.bottom-box');
  17. // bottomBox.style.display = "none"
  18. window.onload = () => {
  19. // 取得圖片尺寸
  20. let collectionImg = document.querySelectorAll('.collection-content img');
  21. for (let index = 0; index < collectionImg.length; index++) {
  22. const element = collectionImg[index];
  23. // 若圖片失效則隱藏
  24. if (element.naturalHeight < 50) {
  25. console.log('圖片失效', element);
  26. let parent = element.parentNode.parentNode;
  27. parent.style.display = "none";
  28. }
  29. }
  30. }
  31. </script>
  32. </body>
  33. </html>