Move javascript to docs folder

This commit is contained in:
William Entriken 2017-11-11 20:16:54 -05:00
parent 26fd9d5fa3
commit b1c473c837
9 changed files with 377 additions and 176 deletions

View File

@ -1,64 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>System Bus Radio</title>
<meta name="description" content="System Bus Radio JS Port: Play AM radio waves from a computer without an AM radio using only your web browser.">
<link rel="stylesheet" href="main.css">
<script src="./airgap.js"></script>
</head>
<body>
<div class="header">
System Bus Radio
</div>
<div class="content">
</br>
<input type="button" value="Play Song" onclick="start()">
<input type="button" value="Stop Song" onclick="end()"></br></br>
<textarea id="logs" style="width:70%;min-height:100px">Tested with Chrome at 1560Khz</textarea>
<p style="font-size:14px">Feel free to edit the code below or copy and paste any <em>valid</em> code.<br>Column one is time in <i>milliseconds</i>, and column two is <i>frequency</i>.<br>If you are opening this file locally (file://) Chrome will give you errors. Try using <code>php -S localhost:8000</code> or similar for a quick web server.</p>
<textarea id="tones" style="width:70%;min-height:200px">
400 2673
400 2349
400 2093
400 2349
400 2673
400 0
400 2673
400 0
790 2673
400 2349
400 2349
400 0
790 2349
400 2673
400 3136
400 0
790 3136
400 2673
400 2349
400 2093
400 2349
400 2673
400 0
400 2673
400 0
400 2673
400 0
400 2673
400 2349
400 0
400 2349
400 2673
400 2349
790 2093</textarea>
<div style="font-size:14px">Ported by <a href="https://github.com/quanyang">Yeo Quan Yang</a> & maintained by <a href="https://github.com/rocketinventor">Elliot Gerchak</a>.
<br>
Original machine code by <a href="https://github.com/fulldecent">William Entriken</a>.</div><br/>
<div style="font-size:14px">Project site at <a href="https://github.com/fulldecent/system-bus-radio">https://github.com/fulldecent/system-bus-radio</a></div><br/>
<div style="font-size:14px">List of computers that work and what frequency to try at <a href="https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv">https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv</a></div>
</div>
</body>
</html>

View File

@ -1,103 +0,0 @@
body {
background-color: #3498db;
font-family: Futura, Helvetica, "Century Gothic";
text-shadow: 1px 1px 0px black;
margin: 0px;
padding: 0px;
}
.header {
color: white;
font-size: 50px;
padding-top: 20px;
text-align: center;
}
.content {
text-align: center;
margin: auto;
width: 80%;
font-size: 12px;
color: white;
}
a.button,
input.button {
cursor: pointer;
font-family: Futura, Century Gothic;
background: #44c650;
border: 0px;
padding: 5px 80px;
font-weight: bold;
text-transform: uppercase;
color: white;
font-size: 15px;
text-shadow: 1px 1px 0px #222;
box-shadow: 3px 3px 0px #006633;
-webkit-transition: background-color 0.15s ease-in-out;
-moz-transition: background-color 0.15s ease-in-out;
-o-transition: background-color 0.15s ease-in-out;
transition: background-color 0.15s ease-in-out;
}
a.button {
display: inline-block;
text-decoration: none;
padding: 6px 12px 6px 12px;
}
input.button {
padding: 5px 20px;
}
a.button:active,
input.button:active {
position: relative;
top: 1px;
}
a.button:hover,
input.button:hover {
background: #00b200;
color: white;
text-shadow: 1px 1px 0px #222;
position: relative;
cursor: pointer;
cursor: hand;
}
input[type="text"],
textarea {
margin-left: 0px;
background-color: #F7f7f7;
border: 1px solid black;
padding: 5px;
color: #444;
-webkit-transition: border-color 0.2s ease-in-out;
-moz-transition: border-color 0.2s ease-in-out;
-o-transition: border-color 0.2s ease-in-out;
transition: border-color 0.2s ease-in-out;
}
input[type="text"]:hover,
textarea:hover {
box-shadow: 0px 0px 9px black;
}
input,
textarea,
button {
outline: none;
resize: none;
}
a {
color: white;
font-weight: bold;
background-color: rgba(242, 242, 242, 0.2);
text-decoration: none;
}
a:hover {
background-color: rgba(255, 255, 255, 0.38);
}

1
docs/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/_site

2
docs/Gemfile Normal file
View File

@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins

220
docs/Gemfile.lock Normal file
View File

@ -0,0 +1,220 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.9)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
concurrent-ruby (1.0.5)
ethon (0.11.0)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.13.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.18)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (168)
activesupport (= 4.2.9)
github-pages-health-check (= 1.3.5)
jekyll (= 3.6.2)
jekyll-avatar (= 0.5.0)
jekyll-coffeescript (= 1.0.2)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.9.2)
jekyll-gist (= 1.4.1)
jekyll-github-metadata (= 2.9.3)
jekyll-mentions (= 1.2.0)
jekyll-optional-front-matter (= 0.2.0)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.1.0)
jekyll-redirect-from (= 0.12.1)
jekyll-relative-links (= 0.5.1)
jekyll-sass-converter (= 1.5.0)
jekyll-seo-tag (= 2.3.0)
jekyll-sitemap (= 1.1.1)
jekyll-swiss (= 0.4.0)
jekyll-theme-architect (= 0.1.0)
jekyll-theme-cayman (= 0.1.0)
jekyll-theme-dinky (= 0.1.0)
jekyll-theme-hacker (= 0.1.0)
jekyll-theme-leap-day (= 0.1.0)
jekyll-theme-merlot (= 0.1.0)
jekyll-theme-midnight (= 0.1.0)
jekyll-theme-minimal (= 0.1.0)
jekyll-theme-modernist (= 0.1.0)
jekyll-theme-primer (= 0.5.2)
jekyll-theme-slate (= 0.1.0)
jekyll-theme-tactile (= 0.1.0)
jekyll-theme-time-machine (= 0.1.0)
jekyll-titles-from-headings (= 0.4.0)
jemoji (= 0.8.1)
kramdown (= 1.14.0)
liquid (= 4.0.0)
listen (= 3.0.6)
mercenary (~> 0.3)
minima (= 2.1.1)
rouge (= 2.2.1)
terminal-table (~> 1.4)
github-pages-health-check (1.3.5)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 2.0)
typhoeus (~> 0.7)
html-pipeline (2.7.1)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
jekyll (3.6.2)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 3)
safe_yaml (~> 1.0)
jekyll-avatar (0.5.0)
jekyll (~> 3.0)
jekyll-coffeescript (1.0.2)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.9.2)
jekyll (~> 3.3)
jekyll-gist (1.4.1)
octokit (~> 4.2)
jekyll-github-metadata (2.9.3)
jekyll (~> 3.1)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.2.0)
activesupport (~> 4.0)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-optional-front-matter (0.2.0)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.1.0)
jekyll (~> 3.0)
jekyll-redirect-from (0.12.1)
jekyll (~> 3.3)
jekyll-relative-links (0.5.1)
jekyll (~> 3.3)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-seo-tag (2.3.0)
jekyll (~> 3.3)
jekyll-sitemap (1.1.1)
jekyll (~> 3.3)
jekyll-swiss (0.4.0)
jekyll-theme-architect (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.5.2)
jekyll (~> 3.5)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.2)
jekyll-theme-slate (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.4.0)
jekyll (~> 3.3)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jemoji (0.8.1)
activesupport (~> 4.0, >= 4.2.9)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
kramdown (1.14.0)
liquid (4.0.0)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.3.0)
minima (2.1.1)
jekyll (~> 3.3)
minitest (5.10.3)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
octokit (4.7.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (2.2.1)
safe_yaml (1.0.4)
sass (3.5.3)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.4)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
PLATFORMS
ruby
DEPENDENCIES
github-pages
BUNDLED WITH
1.15.0

View File

@ -1,7 +1,9 @@
var player; // Define "player" var to make my code linter happy var player; // Define "player" var to make my code linter happy
function start() { // Start Web Worker & send song data to player function start() { // Start Web Worker & send song data to player
var logs = document.getElementById('logs'); // Define log element var logs = document.getElementById('progress'); // Define log element
window.logs = logs; // Make variable Global
window.logs.value = "";
// Create Web Worker if it doesn't already exist // Create Web Worker if it doesn't already exist
if (window.Worker && typeof(player) == "undefined") { if (window.Worker && typeof(player) == "undefined") {
@ -9,21 +11,17 @@ function start() { // Start Web Worker & send song data to player
window.player = player; // Make variable Global window.player = player; // Make variable Global
player.onmessage = function(event) { player.onmessage = function(event) {
var data = event.data; var data = event.data;
window.logs.value += data; console.log(data)
window.logs.value += "x\n";
}; };
// Send song data to player // Send song data to player
var song = document.getElementById("tones").innerHTML; var song = document.getElementById("tune").innerHTML;
player.postMessage(song); player.postMessage(song);
} }
} }
function end() { // Stops the Web Worker function end() { // Stops the Web Worker
window.logs.value = "";
player.terminate(); player.terminate();
} }
function pause(time) {
window.logs.value += "\nPaused / " + time*.001 + " seconds";
var dt = new Date();
while ((new Date()) - dt <= time) { /* Do nothing */ }
}

64
docs/index.html Normal file
View File

@ -0,0 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="System Bus Radio JS Port: Play AM radio waves from a computer without an AM radio using only your web browser.">
<title>System Bus Radio</title>
<link rel="stylesheet" href="main.css"></style>
<script src="airgap.js"></script>
</head>
<body style="text-align:center">
<header>
<h1>System Bus Radio</h1>
</header>
<p><em>Tested on MacBook Air / Chrome with AM tuner at 1560 Hz. <a href="https://github.com/fulldecent/system-bus-radio/blob/master/TEST-DATA.tsv">See field reports</a> for other equipment and frequencies.</em></p>
<p>
<button id="play" onclick="start()">Play tune</button>
<button id="stop" onclick="end()">Stop tune</button>
</p>
<section style="display:flex;width:60%;margin:auto">
<textarea style="width:2rem" id="progress" readonly></textarea>
<textarea style="flex:1;height:50rem" id="tune">
400 2673
400 2349
400 2093
400 2349
400 2673
400 0
400 2673
400 0
790 2673
400 2349
400 2349
400 0
790 2349
400 2673
400 3136
400 0
790 3136
400 2673
400 2349
400 2093
400 2349
400 2673
400 0
400 2673
400 0
400 2673
400 0
400 2673
400 2349
400 0
400 2349
400 2673
400 2349
790 2093</textarea>
</section>
<p>Edit the above to make any music you like. <a href="https://github.com/fulldecent/system-bus-radio/issues/28">Tune file format</a> is time (ms) and frequency (Hz).</p>
<p>Chrome has errors if you open this file locally (<code>file://</code>). Try using <code>php -S localhost:8000</code> or similar for a quick web server.</p>
<p>Ported by <a href="https://github.com/quanyang">Yeo Quan Yang</a> & maintained by <a href="https://github.com/rocketinventor">Elliot Gerchak</a>.</p>
<p>Original machine code by <a href="https://github.com/fulldecent">William Entriken</a>.</p>
<p><strong>Project site at <a href="https://github.com/fulldecent/system-bus-radio">https://github.com/fulldecent/system-bus-radio</a></strong></p>
</body>
</html>

83
docs/main.css Normal file
View File

@ -0,0 +1,83 @@
/* Main style */
body {
background-color: #3498db;
color: white;
font-family: Futura, Helvetica, "Century Gothic";
text-shadow: 1px 1px 0px black;
}
p {
font-size: 1.2rem;
}
a {
color: white;
}
a:hover {
color: red;
}
h1 {
font-size: 3rem;
font-weight: normal;
text-align: center;
}
textarea {
font-size: 1.25rem;
font-family: courier;
}
/* BUTTON FROM https://github.com/eisenfox/css3-button-hovers */
button {
background: purple;
text-align: center;
display: inline-block;
position: relative;
text-decoration: none;
color: #fff;
text-transform: capitalize;
font-size: 18px;
padding: 20px 0px;
width: 150px;
border-radius: 6px;
overflow: hidden;
-webkit-transition: all 0.2s linear 0s;
transition: all 0.2s linear 0s;
}
button#play:before {
content: "\25BA";
}
button#stop:before {
content: "\25FC";
}
button:before {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
position: absolute;
top: 0;
left: 0px;
height: 100%;
width: 30px;
background-color: rgba(255, 255, 255, 0.3);
border-radius: 0 50% 50% 0;
-webkit-transform: scale(0, 1);
transform: scale(0, 1);
-webkit-transform-origin: left center;
transform-origin: left center;
-webkit-transition: all 0.2s linear 0s;
transition: all 0.2s linear 0s;
}
button:hover {
text-indent: 30px;
}
button:hover:before {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
text-indent: 0;
}