index.html (1208B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 5 <title>ansilove.js</title> 6 <script src="../ansilove.js" type="text/javascript" charset="utf-8"></script> 7 <style type="text/css" media="screen"> 8 body { 9 background: black; 10 } 11 .center { 12 margin: 0 auto; 13 background-color: black; 14 padding: 16px; 15 } 16 #header { 17 width: 720px; 18 height: 464px; 19 } 20 #example { 21 width: 720px; 22 height: 384px; 23 overflow: hidden; 24 } 25 </style> 26 </head> 27 <body> 28 <div id="header" class="center"></div> 29 30 <div id="example" class="center"></div> 31 32 <script type="text/javascript"> 33 var controller, retina; 34 35 retina = window.devicePixelRatio > 1; 36 37 AnsiLove.render("cl!-al02.ans", function (canvas, sauce) { 38 document.getElementById("header").appendChild(canvas); 39 }, {"bits": "9", "2x": (retina ? 1 : 0)}); 40 41 controller = AnsiLove.animate("example_usage.ans", function (canvas, sauce) { 42 document.getElementById("example").appendChild(canvas); 43 controller.play(2800); 44 }, {"bits": "9", "2x": (retina ? 1 : 0)}); 45 </script> 46 47 </body> 48 </html>