forked from inexorabletash/jsbasic
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
187 lines (152 loc) · 6.77 KB
/
index.html
File metadata and controls
187 lines (152 loc) · 6.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<title>Applesoft BASIC in JavaScript</title>
<!-- Meta General -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Applesoft recrea la primera computadora comercializada por Apple, permitiéndote programar y ejecutar aplicaciones en BASIC directamente desde tu navegador.">
<meta name="keywords" content="Applesoft, Apple I, Apple II, Programación en BASIC, Retrocomputación, Emulador Apple, Computadora Apple, Historia de la informática, BASIC Online, Simulador Apple">
<meta name="author" content="Applesoft Team">
<meta name="robots" content="index, follow">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Suppress browser compat button -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="alternate" type="application/atom+xml" href="https://github.com/inexorabletash/jsbasic/commits/master.atom">
<link rel="stylesheet" href="display.css">
<link rel="stylesheet" href="https://sakofchit.github.io/system.css/system.css">
<link rel="stylesheet" href="https://sakofchit.github.io/system.css/docs.css">
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.29/polyfill.min.js"></script>
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.29/keyboard.js"></script>
<!-- CodeMirror syntax highlighting - this is optional -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.61.1/codemirror.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.61.1/codemirror.css">
<script src="cm/basic.js"></script>
<link rel="stylesheet" href="cm/basic.css">
<style>
.CodeMirror { border: solid 1px black; width: 598px; height: 384px; background-color: white; }
.CodeMirror-scroll { height: 100%; }
@import bourbon
textarea {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
border-radius: 150px;
}
</style>
<center>
<div class="standard-dialog">
<div class="window">
<div class="title-bar">
<h1 class="title">Applesoft BASIC in Javascript</h1>
</div>
</div>
</center>
<div style="padding-left: 20px;">
<p>
By <a target=_blank href="https://goliat.neocities.org/site/apple/">AppleSoft</a>
| <a target="_blank" href="https://github.com/inexorabletash/jsbasic/">Source</a>
| <a target="_blank" href="https://github.com/inexorabletash/jsbasic/blob/master/README.md">README</a>
— <a target="_blank" href="reference.html">Applesoft BASIC Quick Reference</a>
<p>Related projects:
<a href="https://inexorabletash.github.io/jslogo/">Logo in Javascript</a>
| <a href="https://sakofchit.github.io/system.css/">system.css</a>
</p></div>
<br style="clear: both;">
<div class="window">
<div class="title-bar">
<button aria-label="Close" class="close"></button>
<h1 class="title">Applesoft</h1>
<button aria-label="Resize" class="resize"></button>
</div>
<div class="separator"></div>
<div class="window-pane">
<div id="frame" class="jsb-frame" style="float: left; margin: 5px;" tabIndex="0">
<div id="screen-wrapper" class="jsb-wrapper">
<div id="lores" class="jsb-lores"></div>
<canvas id="hires" width="560" height="384" class="jsb-hires"></canvas>
<canvas id="hires2" width="560" height="384" class="jsb-hires"></canvas>
<div id="screen" class="jsb-tty"></div>
</div>
</div>
</div>
</div>
<!-- Source -->
<div style="float: left; margin: 5px;">
Enter code:
<button id="btn_run" class="btn" >▶ Run</button>
<button id="btn_stop" disabled class="btn">◼ Stop</button>
<select id="lb_files">
<option disabled selected="selected">Select a sample...</option>
</select>
<script>
fetch('samples/index.txt')
.then(response => {
if (!response.ok)
throw new Error(response.statusText);
return response.text();
})
.then(text => {
const select = document.querySelector('#lb_files');
let group;
text.split(/\r?\n/g).forEach(line => {
line = line.replace(/^\s+|\s+$/, '');
if (!line.length) return;
if (line.startsWith('#')) {
line = line.replace(/^#\s+/, '');
if (line.startsWith('___')) {
select.appendChild(document.createElement('hr'));
} else {
group = Object.assign(document.createElement('optgroup'),
{label: line});
select.appendChild(group);
}
} else {
const match = line.match(/^(\S+)\s+(.*)$/);
group.appendChild(Object.assign(
document.createElement('option'),
{value: match[1], innerText: match[2]}));
}
});
});
</script>
<!-- Source code editor inserted here -->
<div style="padding-left: 40px;">
<div id="editorframe"></div>
<form id="submission" method="post" enctype="text/plain" action="mailto:inexorabletash@gmail.com?subject=Applesoft%20Sample%20Submission" target=_blank>
<textarea name="source" id="source" style="display: none;">
</textarea></div>
<br><br>
<button id="btn_save" title="Save as a file" class="btn">💾 Save</button>
<button id="btn_load" title="Load a file" class="btn"> Load</button>
<button id="btn_share" title="Share by email" class="btn"> Share</button>
<button id="show_paper" title="Echo all output to a "print-out", so you can copy/paste" class="btn"> Show output</button>
<button id="hide_paper" class="btn"> Hide output</button>
</form>
<br style="clear: both;">
<h3 id="links">Links</h3>
<ul>
<li>
Real emulators in JavaScript:
<a target="_blank" href="http://www.scullinsteel.com/apple2/">Apple IIjs</a>,
<a target="_blank" href="http://www.scullinsteel.com/apple//e">Apple //jse</a>,
<a target="_blank" href="http://www.megidish.net/apple2js/index.html">Apple2JS</a>,
and
<a target="_blank" href="https://github.com/nicholasbs/appletoo">many</a>
<a target="_blank" href="http://porkrind.org/a2/">more</a>
<li><a target="_blank" href="http://www.6502asm.com/">6502asm.com</a> - a 6502 assembler/emulator in JavaScript
<li><a target="_blank" href="http://www.quitebasic.com/">Quite BASIC</a> - a similar project aimed at teaching programming
</ul>
<div id="paper-spacer"></div>
<div id="paper"></div>
<div class="standard-dialog center scale-down" style="width:30rem;">
<h1 class="dialog-text">The Macintosh Finder, Version 1.0 (18 Jan 84)</h1>
<p class="dialog-text">© 1984 Apple Computer</p>
</div>
</div>
<script src="basic.js?2012-02-08"></script>
<script src="bell.js"></script>
<script src="tty.js"></script>
<script src="lores.js"></script>
<script src="hires.js"></script>
<script src="dos.js"></script>
<script src="printer.js"></script>
<script src="index.js"></script>