Skip to content

Commit 207baaa

Browse files
committed
mobile: add sandbox+touch-action+viewport listeners to mohr/ifs/astar
1 parent e7a7729 commit 207baaa

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

artifacts/astar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h1 class="artifact-title">A* Pathfinding</h1>
113113
<a class="meta-nav" href="../gallery.html">← Gallery</a>
114114
</div>
115115
</div>
116-
<iframe class="sketch-frame" src="../gallery/astar.html" title="A* Pathfinding" allowfullscreen></iframe>
116+
<iframe class="sketch-frame" src="../gallery/astar.html" title="A* Pathfinding" allowfullscreen sandbox="allow-scripts"></iframe>
117117
</main>
118118

119119
<script>

artifacts/mohr.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h1 class="artifact-title">Mohr</h1>
113113
<a class="meta-nav" href="../gallery.html">← Gallery</a>
114114
</div>
115115
</div>
116-
<iframe class="sketch-frame" src="../gallery/mohr.html" title="Mohr Hypercube" allowfullscreen></iframe>
116+
<iframe class="sketch-frame" src="../gallery/mohr.html" title="Mohr Hypercube" allowfullscreen sandbox="allow-scripts"></iframe>
117117
</main>
118118

119119
<script>

gallery/astar.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style>
1111
*{margin:0;padding:0;box-sizing:border-box}
1212
html,body{width:100%;height:100%;height:100dvh;overflow:hidden;background:#0a0a0f;font-family:'Courier New',monospace;color:#c0c0c0;touch-action:none}
13-
canvas{display:block;position:absolute;top:0;left:0}
13+
canvas{display:block;position:absolute;top:0;left:0;touch-action:none}
1414
@media(max-width:600px){
1515
html.standalone body{display:flex;flex-direction:column;position:relative}
1616
html.standalone canvas{position:relative;top:auto;left:auto;flex:1;min-height:0;width:100%!important;height:auto!important}
@@ -416,6 +416,8 @@
416416
}
417417

418418
window.addEventListener('resize',()=>{init();});
419+
if(window.visualViewport)window.visualViewport.addEventListener('resize',()=>{init();});
420+
window.addEventListener('orientationchange',()=>{setTimeout(init,200);});
419421
// Defer init when inside an iframe to ensure layout has painted before sizing
420422
if(inIframe){
421423
window.addEventListener('load',()=>{setTimeout(()=>init(),100);},{once:true});

0 commit comments

Comments
 (0)