index.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!doctype html>
  2. <html <?php language_attributes(); ?>>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <?php wp_head(); ?>
  7. </head>
  8. <body <?php body_class(); ?>>
  9. <?php wp_body_open(); ?>
  10. <?php do_action('get_header'); ?>
  11. <div id="app" class="banner bg-jlg-dark-blue text-jlg-white font-authentic flex w-full flex-col justify-center items-center">
  12. <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  13. </div>
  14. <script>
  15. document.addEventListener('DOMContentLoaded', function () {
  16. // CLEANER LE TABLEAU
  17. let minHeadTh = document.querySelector("#main table thead tr th:first-of-type");
  18. minHeadTh.style.width = `${100 / 8}%`;
  19. let otherHeadThs = document.querySelectorAll("#main table thead tr th:not(:first-of-type)");
  20. for (let otherHeadTh of otherHeadThs) {
  21. otherHeadTh.style.width = `${100 / 8 * 1.75}%`;
  22. }
  23. let minTableTds = document.querySelectorAll("#main table tbody tr td:first-of-type");
  24. for (let minTableTd of minTableTds) {
  25. minTableTd.style.width = `${100 / 8}%`;
  26. }
  27. let otherTableTds = document.querySelectorAll("#main table tbody tr td:not(:first-of-type)");
  28. for (let otherTableTd of otherTableTds) {
  29. otherTableTd.style.width = `${100 / 8 * 1.75}%`;
  30. }
  31. // HEADER AU SCROLL
  32. let tableHead = document.querySelector("thead tr");
  33. let tHeadHeight = tableHead.offsetHeight;
  34. window.onscroll = () => {
  35. tableHead.style.minHeight = `${document.querySelector("header").offsetHeight + 72}px`;
  36. let scroll = window.pageYOffset;
  37. let headerNewHeight = tHeadHeight - scroll;
  38. tableHead.style.height = `${headerNewHeight}px`;
  39. }
  40. }, false);
  41. </script>
  42. <?php do_action('get_footer'); ?>
  43. <?php wp_footer(); ?>
  44. </body>
  45. </html>