mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
56 lines
1.2 KiB
HTML
56 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>PICO-8 Player</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background: #000;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
#canvas {
|
|
image-rendering: pixelated;
|
|
image-rendering: crisp-edges;
|
|
background: #000;
|
|
}
|
|
#p8_container {
|
|
position: relative;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="p8_container">
|
|
<canvas id="canvas"></canvas>
|
|
</div>
|
|
<script type="text/javascript">
|
|
// Cart will be injected here
|
|
window.PICO8_CART_DATA = null;
|
|
</script>
|
|
<script src="pico8_player.js"></script>
|
|
<script>
|
|
Module = {
|
|
arguments: ['-run'],
|
|
canvas: document.getElementById('canvas'),
|
|
preRun: [],
|
|
postRun: []
|
|
};
|
|
|
|
// Wait for cart data to be set
|
|
if (window.PICO8_CART_DATA) {
|
|
// Create virtual file system entry
|
|
Module.preRun.push(function() {
|
|
FS.createDataFile('/', 'cart.p8', window.PICO8_CART_DATA, true, true, true);
|
|
});
|
|
Module.arguments.push('/cart.p8');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|