Mercurial > web
comparison tomoko.html @ 6:ac2f9715807c
first version
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 30 May 2021 18:07:38 -0400 |
parents | |
children | e22a954c2714 |
comparison
equal
deleted
inserted
replaced
3:f13aa00c92f0 | 6:ac2f9715807c |
---|---|
1 <!DOCTYPE html> | |
2 <head> | |
3 <style> | |
4 body{ | |
5 margin:0; | |
6 background-image: url("tomoko.gif"); | |
7 background-position: center top; | |
8 background-size: 100% auto; | |
9 text-align: center; | |
10 } | |
11 </style> | |
12 <script> | |
13 window['libopenmpt'] = {}; | |
14 libopenmpt.locateFile = function (filename) { | |
15 return filename; | |
16 }; | |
17 libopenmpt.onRuntimeInitialized = function () { | |
18 if (document.referrer) { | |
19 init(); | |
20 path = "https://api.modarchive.org/downloads.php?moduleid=37049#christms.xm"; | |
21 if (player != undefined) { | |
22 player.load(path, afterLoad.bind(this, path)); | |
23 } | |
24 } | |
25 else { | |
26 document.getElementById('button').style.visibility = "visible"; | |
27 } | |
28 var player; | |
29 function init() { | |
30 if (player == undefined) { | |
31 player = new ChiptuneJsPlayer(new ChiptuneJsConfig(-1)); | |
32 } | |
33 else { | |
34 player.stop(); | |
35 player = undefined; | |
36 } | |
37 }; | |
38 function afterLoad(path, buffer) { | |
39 player.play(buffer); | |
40 }; | |
41 document.getElementById('button').onclick = function() { | |
42 init(); | |
43 path = "https://api.modarchive.org/downloads.php?moduleid=37049#christms.xm"; | |
44 if (player != undefined) { | |
45 player.load(path, afterLoad.bind(this, path)); | |
46 } | |
47 document.getElementById('button').style.visibility = "hidden"; | |
48 }; | |
49 } | |
50 </script> | |
51 <script src="libopenmpt.js"></script> | |
52 <script src="chiptune2.js"></script> | |
53 </head> | |
54 <body id="body"> | |
55 <br> | |
56 <input id="button" type="submit" name="button" value="epicness" style="visibility: hidden;"> | |
57 </body> |