app/template/user_data/opinion.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block main %}
  3. <div id="iframe-container" style="width: 100%; overflow: hidden;">
  4.     <iframe 
  5.         id="opinion-frame"
  6.         src="https://docs.google.com/forms/d/e/1FAIpQLScIpwCFxDrZp37mo1tiYjX9rSsA664qTRKUQIcLTuigZn3ctg/viewform?embedded=true"
  7.         style="width: 100%; border: none;"
  8.         loading="lazy"
  9.         allowfullscreen
  10.     marginwidth="0">読み込んでいます…</iframe>
  11. </div>
  12. <style>
  13.     body {
  14.     padding-top:150px;
  15.     }
  16. </style>
  17. <script>
  18.   function resizeIframe() {
  19.     const header = document.querySelector('#site_header'); // ←ヘッダー要素のID
  20.     const footer = document.querySelector('#site_footer'); // ←もしあれば
  21.     const headerHeight = header ? header.offsetHeight : 0;
  22.     const footerHeight = footer ? footer.offsetHeight : 0;
  23.     const availableHeight = window.innerHeight - headerHeight - footerHeight;
  24.     document.getElementById('opinion-frame').style.height = availableHeight + 'px';
  25.   }
  26.   window.addEventListener('load', resizeIframe);
  27.   window.addEventListener('resize', resizeIframe);
  28. </script>
  29. {% endblock %}