Morse Beep
A simple text to Morse Code player for the modern web
index.html
<div id="output">Letters will show up as their sequence starts to play</div>
<button id="talk">Enter Pharse</button>
<script src="./compiled.js"></script>
example.js
compiled via browserify into compiled.js
var morse = require("morse-beep");
var code = morse();
var output = document.getElementById("output");
var talk = document.getElementById("talk");
code.on("start-letter", function(l){
l = l == " " ? " " : l;
output.innerHTML += l;
});
var beeping = false;
var next = function(){
var say = prompt("what to say?", "hello world");
if(say!==null){
code(say, function(){
output.innerHTML += "
";
});
}
}
talk.onclick = next;