frame-helper.html (457B)
1 <!doctype html> 2 3 <style> 4 div { 5 width: 100px; 6 height: 100px; 7 background: green; 8 } 9 html { height: 50%; } 10 ::view-transition-group(*) { animation-duration: 500s } 11 </style> 12 13 <div></div> 14 15 <script> 16 function run() { 17 document.startViewTransition(() => { 18 requestAnimationFrame(() => requestAnimationFrame(() => { 19 window.parent.postMessage({}, "*"); 20 })); 21 }); 22 } 23 onload = () => requestAnimationFrame(() => requestAnimationFrame(run)); 24 </script>