devusman commited on
Commit
37a4001
·
verified ·
1 Parent(s): 9896581

Update views/index.ejs

Browse files
Files changed (1) hide show
  1. views/index.ejs +31 -0
views/index.ejs CHANGED
@@ -392,6 +392,37 @@
392
  });
393
  });
394
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  </script>
396
 
397
  </body>
 
392
  });
393
  });
394
  });
395
+ function sendHeight() {
396
+ if (window.parent) {
397
+ const height = document.body.scrollHeight;
398
+ window.parent.postMessage(
399
+ {
400
+ height: height,
401
+ },
402
+ "*"
403
+ );
404
+ }
405
+ }
406
+ // --- Logic for Embedding and Dynamic Resizing ---
407
+ document.addEventListener("DOMContentLoaded", () => {
408
+ // Initial animations on page load
409
+ document.querySelectorAll(".animate__animated").forEach((el, i) => {
410
+ el.style.animationDelay = `${i * 0.1}s`;
411
+ });
412
+
413
+ // Send initial height to parent window
414
+ sendHeight();
415
+
416
+ // Use a MutationObserver to watch for any changes in the page content
417
+ // and send the new height to the parent window.
418
+ const observer = new MutationObserver(() => sendHeight());
419
+ observer.observe(document.body, {
420
+ childList: true,
421
+ subtree: true,
422
+ attributes: true,
423
+ characterData: true,
424
+ });
425
+ });
426
  </script>
427
 
428
  </body>