From 62eccca5fa13b2952c8e8ebafc6ed678589ec361 Mon Sep 17 00:00:00 2001 From: brandonPerry-Co Date: Sun, 17 Jan 2021 23:21:06 -0600 Subject: [PATCH 1/2] First push --- index.html | 13 +++++++------ main.js | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 8f536de8..d1025987 100644 --- a/index.html +++ b/index.html @@ -2,14 +2,15 @@ - + Pig latin App -

Hello World!

-
-
- -
+
+

Pig Latin

+ + + +
diff --git a/main.js b/main.js index 1c92f304..9f926bdf 100644 --- a/main.js +++ b/main.js @@ -14,9 +14,27 @@ const rl = readline.createInterface({ const pigLatin = (word) => { // Your code here + let vowels = "aeiou".split(""); + + + for(let i = 0; i < word.length; i +=1) { + let letter = word[i]; + if (vowels.indexOf(letter) != -1 && i === 0) + { + return word + "way"; +} + if (vowels.indexOf(letter) != -1) { + return word.slice(i) + word.slice(0, i) + "ay"; + } +} + return word + "ay"; } +let result = Piglatin("pimple"); +console.log(result); + + // the first function called in the program to get an input from the user // to run the function use the command: node main.js // to close it ctrl + C From 22fb9c9403bf6d0f4a68133e706a1975d745cfd0 Mon Sep 17 00:00:00 2001 From: brandonPerry-Co Date: Mon, 25 Jan 2021 16:12:45 -0600 Subject: [PATCH 2/2] Piglatin GUI --- index.html | 1 + main.html | 0 main.js | 2 +- styles.css | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 main.html create mode 100644 styles.css diff --git a/index.html b/index.html index d1025987..9dc72874 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ Pig latin App + diff --git a/main.html b/main.html new file mode 100644 index 00000000..e69de29b diff --git a/main.js b/main.js index 9f926bdf..977d67af 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ 'use strict'; - +const word = document.querySelector("text") // brings in the assert module for unit testing const assert = require('assert'); // brings in the readline module to access the command line diff --git a/styles.css b/styles.css new file mode 100644 index 00000000..c9672b0b --- /dev/null +++ b/styles.css @@ -0,0 +1,55 @@ +*{ + padding: 0; + margin: 0; + box-sizing: border-box; +} + +body{ + position: relative; + background-color: blue; + justify-content: center; + align-items: center; + margin: auto; +} + +.section{ + height: 400px; + font-size: 30px; + position: relative; + margin: auto; + justify-content: center; + align-items: center; +} + +.section h1 { + position: absolute; + margin: 0; + top: 30%; + left: 54%; + transform: translate(-50%, -50%); + height: 40px; +} +.section input{ + position: absolute; + margin: 0; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + height: 30px; + font-size: 15px; +} + +.section .input-btn{ + position: absolute; + margin: 0; + top: 50%; + left: 63%; + transform: translate(-50%, -50%); + height: 35px; + width: 8%; + font-size: 15px; +} + +.input-btn:hover{ + background-color: red; +} \ No newline at end of file