resize to viewport

This commit is contained in:
Thomas Lindner 2022-04-02 18:22:04 +02:00
parent cceb5afae8
commit 5bed8aa933
3 changed files with 14 additions and 23 deletions

5
.gitignore vendored
View file

@ -1,3 +1,4 @@
*.xdc
.nes
.DS_Store
*.nes
*.swp
.DS_Store

View file

@ -1,29 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>NES Emulator</title>
<script type="text/javascript" src="jsnes.js"></script>
<script type="text/javascript" src="nes-embed.js"></script>
<script>window.onload = function(){nes_load_url("nes-canvas", "mario.nes");}</script>
</head>
<body>
<div style="margin: auto; width: 75%;">
<canvas id="nes-canvas" width="256" height="240" style="width: 100%"/>
</div>
<p>DPad: Arrow keys<br/>Start: Return, Select: Tab<br/>A Button: A, B Button: S</p>
</body>
</html>
<!-- <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Super Mario Bros. (World)</title>
<script src="webxdc.js"></script>
<script src="jsnes.min.js"></script>
<script src="nes-embed.js"></script>
</head>
<body>
<body style="margin: 0;">
<!--
<input id="input" type="text"/>
<a href="" onclick="sendMsg(); return false;">Send</a>
<p id="output"></p>
@ -39,6 +24,11 @@
window.webxdc.setUpdateListener(receiveUpdate, 0);
</script>
-->
<canvas id="nes-canvas" width="256" height="240" style="width: 100vw; height: 100vh; margin: 0; object-fit: contain;"/>
<p>DPad: Arrow keys<br/>Start: Return, Select: Tab<br/>A Button: A, B Button: S</p>
<script>
nes_load_url("nes-canvas", "Super Mario Bros. (World).nes");
</script>
</body>
</html>
-->

View file