diff --git a/css/style.css b/css/style.css index c230daf..23971d8 100644 --- a/css/style.css +++ b/css/style.css @@ -10,6 +10,26 @@ padding: 0; } +#buttonDiv{ + padding: 2em; + height: 500px; + border-radius: 10px; + +} +.button { + background-color: #4CAF50; + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; +} + + body { font: 14px/1.4 arial, sans-serif; background-color: #F5F5F5;);} article, aside, figure, footer, header, nav, section { display: block; } @@ -47,7 +67,7 @@ a:hover, a:active { .main-header { width: 100%; height: 150px; - + background-color: #144e64;} .main-header .title { @@ -113,6 +133,3 @@ article p { margin-bottom: 20px;} section {margin: 5%;} h1 {font-weight: bold;} #result {border: 1px #aaa solid; padding:10px; height:30px; background:#eee;} - - - diff --git a/index.html b/index.html index ff498cf..9cbd24f 100644 --- a/index.html +++ b/index.html @@ -19,11 +19,13 @@

Instructions

Use document.getElementById('result').innerHTML = your_output; to write program output to page.

+
+

Translation

- + diff --git a/js/morse.js b/js/morse.js new file mode 100644 index 0000000..45d247b --- /dev/null +++ b/js/morse.js @@ -0,0 +1,56 @@ +function myFunction() { + var person = prompt("Please enter strings consisting of A-Z, 0-9").toLowerCase(); + console.log(person); + var charCodes=new Array(36); + charCodes["a"]=". _"; + charCodes["b"]="_ . . ."; + charCodes["c"]="_ . _ ."; + charCodes["d"]="_ . ."; + charCodes["e"]="."; + charCodes["f"]=". . _ ."; + charCodes["g"]="_ _ ."; + charCodes["h"]=". . . ."; + charCodes["i"]=". ."; + charCodes["j"]=". _ _ _"; + charCodes["k"]="_ . _"; + charCodes["l"]=". _ . ."; + charCodes["m"]="_ _"; + charCodes["n"]="_ ."; + charCodes["o"]="_ _ _"; + charCodes["p"]=". _ _ ."; + charCodes["q"]="_ _ . _"; + charCodes["r"]=". _ ."; + charCodes["s"]=". . ."; + charCodes["t"]="_"; + charCodes["u"]=". . _"; + charCodes["v"]=". . . _"; + charCodes["w"]=". _ _"; + charCodes["x"]="_ . . _"; + charCodes["y"]="_ . _ _"; + charCodes["z"]="_ _ . ."; + charCodes["1"]=". _ _ _ _"; + charCodes["2"]=". . _ _ _"; + charCodes["3"]=". . . _ _"; + charCodes["4"]=". . . . _"; + charCodes["5"]=". . . . ."; + charCodes["6"]="_ . . . ."; + charCodes["7"]="_ _ . . ."; + charCodes["8"]="_ _ _ . ."; + charCodes["9"]="_ _ _ _ ."; + charCodes["0"]="_ _ _ _ _"; + var temp=''; + var chars=person.split(""); + var disMorse=''; + for (a=0; a