Adding ansilove.js
- admittedly this should probably be tracked via a link but ... not really sure how to do that and the last time I did it, I had massive issues with updating on other machines.
This commit is contained in:
parent
b014ad9dc9
commit
413a4dad3e
8 changed files with 2774 additions and 0 deletions
48
ansilove.js/example/index.html
Normal file
48
ansilove.js/example/index.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<title>ansilove.js</title>
|
||||
<script src="../ansilove.js" type="text/javascript" charset="utf-8"></script>
|
||||
<style type="text/css" media="screen">
|
||||
body {
|
||||
background: black;
|
||||
}
|
||||
.center {
|
||||
margin: 0 auto;
|
||||
background-color: black;
|
||||
padding: 16px;
|
||||
}
|
||||
#header {
|
||||
width: 720px;
|
||||
height: 464px;
|
||||
}
|
||||
#example {
|
||||
width: 720px;
|
||||
height: 384px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header" class="center"></div>
|
||||
|
||||
<div id="example" class="center"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var controller, retina;
|
||||
|
||||
retina = window.devicePixelRatio > 1;
|
||||
|
||||
AnsiLove.render("cl!-al02.ans", function (canvas, sauce) {
|
||||
document.getElementById("header").appendChild(canvas);
|
||||
}, {"bits": "9", "2x": (retina ? 1 : 0)});
|
||||
|
||||
controller = AnsiLove.animate("example_usage.ans", function (canvas, sauce) {
|
||||
document.getElementById("example").appendChild(canvas);
|
||||
controller.play(2800);
|
||||
}, {"bits": "9", "2x": (retina ? 1 : 0)});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue