← Commit history

readme.html: post height to parent so the readme-frame grows (kills the inner scrollbar); fixed demo heights

AdityaAngajala ·06d2209ca8 ·2mo ago ·parent 1268ac0
1 file changed +23−1
readme.html+23−1
@@ -30,7 +30,7 @@   li { margin: 3px 0; }   .demo { margin: 22px 0 30px; }   .demo .meta { color: #8b97a8; font-size: 13.5px; margin: 0 0 10px; }-  .frame { width: 100%; height: 74vh; min-height: 540px; border: 1px solid #1e2633;+  .frame { width: 100%; height: 640px; border: 1px solid #1e2633;            border-radius: 12px; background: #0d1117; display: block; }   .open { margin-top: 9px; font-size: 13.5px; }   .pill { display:inline-block; font-size:11px; letter-spacing:.08em; text-transform:uppercase;@@ -214,5 +214,27 @@ node serve-classic.mjs   # tiling router, http://localhost:8930     <code>src/</code>.   </footer> </div>++<script>+// Tell the wiki's readme-frame how tall we are, so it grows to fit and there is+// no inner scrollbar. The parent accepts { type: "readme-height", height: N }+// and clamps it (120..16000). It checks identity by source, so targetOrigin "*"+// is fine from this sandboxed (origin "null") document.+(function () {+  var last = 0;+  function post() {+    var h = Math.ceil(document.documentElement.scrollHeight);+    if (h === last) return;+    last = h;+    try { parent.postMessage({ type: "readme-height", height: h }, "*"); } catch (e) {}+  }+  window.addEventListener("load", post);+  window.addEventListener("resize", post);+  document.addEventListener("DOMContentLoaded", post);+  if (window.ResizeObserver) { new ResizeObserver(post).observe(document.documentElement); }+  // catch late layout (fonts, iframe chrome) without a live clock+  [100, 400, 1200].forEach(function (t) { setTimeout(post, t); });+})();+</script> </body> </html>