From 94d280ef5011dafdab65f817f30047bf12f80017 Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:02:56 -1000 Subject: [PATCH 1/7] Exercise 2 --- index.html | 2 +- js/app.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index e74fb3e..b75d0a6 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@

HTTP: Hipsters That Train Programmers

Tacocat, The Orginal Palindrome King

-

Stares at human while pushing stuff off a table the dog smells bad, for stand in front of the computer screen stare at ceiling. Ears back wide eyed intently stare at the same spot stare out the window poop in litter box, scratch the walls, for meow to be let in. Knock dish off table head butt cant eat out of my own dish.

+

Stares at human while pushing stuff off a table the dog smells bad, for stand in front of the computer screen stare at ceiling. Ears back wide eyed intently stare at the same spot stare out the window poop in litter box, scratch the walls, for meow to be let in. Knock dish off table head butt cant eat out of my own dish.

diff --git a/js/app.js b/js/app.js index ef302b1..0f98fb9 100644 --- a/js/app.js +++ b/js/app.js @@ -6,6 +6,10 @@ The function will add the following content inside the paragraph with the id of var bacon = "Shoulder turducken brisket, kevin swine andouille tri-tip salami tail ham sausage pork loin. Ribeye short loin rump kielbasa pork. Capicola short loin turducken corned beef tongue, chuck leberkas salami frankfurter. Kielbasa fatback pancetta, ground round meatball turducken jowl ribeye alcatra sirloin bacon corned beef beef ribs short loin. Pork belly spare ribs biltong corned beef meatball short ribs tongue alcatra swine drumstick. Biltong shankle kevin, cupim sirloin bresaola brisket. Tail pork belly biltong ball tip tri-tip, pig jerky cow pastrami prosciutto ;ground round bacon capicola tongue meatball."; +function moreContent() { + more.innerHTML = bacon; +} + //2. HTTP /*Create a function named `lessContent` that will initiate the `Show Less` link after clicking on it. @@ -13,6 +17,10 @@ var bacon = "Shoulder turducken brisket, kevin swine andouille tri-tip salami ta The function will hide the contents in the pargraph with the id of `less` after clicking on the `Show Less` link.*/ +function lessContent() { + less.innerHTML = ""; +} + //3. Tacocat, The Original Palindrome King /*Create a function named `zoom` that will increase the font size of the paragraph with the id of `biggie` after hovering your mouse over it. Increae the font size to 150%*/ From f0c74300c0212b3ddd6ebb56501782007ac9a27d Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:18:07 -1000 Subject: [PATCH 2/7] Exercise 4 --- index.html | 2 +- js/app.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b75d0a6..e74fb3e 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@

HTTP: Hipsters That Train Programmers

Tacocat, The Orginal Palindrome King

-

Stares at human while pushing stuff off a table the dog smells bad, for stand in front of the computer screen stare at ceiling. Ears back wide eyed intently stare at the same spot stare out the window poop in litter box, scratch the walls, for meow to be let in. Knock dish off table head butt cant eat out of my own dish.

+

Stares at human while pushing stuff off a table the dog smells bad, for stand in front of the computer screen stare at ceiling. Ears back wide eyed intently stare at the same spot stare out the window poop in litter box, scratch the walls, for meow to be let in. Knock dish off table head butt cant eat out of my own dish.

diff --git a/js/app.js b/js/app.js index 0f98fb9..52874f1 100644 --- a/js/app.js +++ b/js/app.js @@ -25,13 +25,26 @@ function lessContent() { //3. Tacocat, The Original Palindrome King /*Create a function named `zoom` that will increase the font size of the paragraph with the id of `biggie` after hovering your mouse over it. Increae the font size to 150%*/ - +function zoom() { + biggie.style.fontSize = "150%"; +} //4. McDonalds /*Create a variable name menu and assign it an array of three of your favorite items at McDonald's. Next, create a function named valueMenu that will display your favorite items in the paragraph the the id of `menu` after clicking on the showMenu paragraph.*/ +var menuList = ["Burger", "Fries", "Shake"]; + +function valueMenu() { + var menuText = ""; + for (var i = 0; i < menuList.length; i++) { + menuText += menuList[i] + ", "; + } + menuText = menuText.slice(0, menuText.length - 2); + menuText += "."; + menu.innerHTML = menuText; +} //5. Gin. From 4e111adbae4bcf69774d4227214fc33cef7d627a Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:20:02 -1000 Subject: [PATCH 3/7] Exercise 5 --- js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/app.js b/js/app.js index 52874f1..7eefe33 100644 --- a/js/app.js +++ b/js/app.js @@ -57,6 +57,12 @@ function valueMenu() { } */ +function redFace() { + var pElement = document.getElementById("drink"); + pElement.style.color = "red"; + pElement.style.fontSize = "20px"; +} + //6. Peanut Butter Cup Oreos From 9085b9a3961a9f8d145aa83c6916c3741aeda0f5 Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:21:11 -1000 Subject: [PATCH 4/7] Exercise 6 --- js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 7eefe33..72b5b93 100644 --- a/js/app.js +++ b/js/app.js @@ -68,7 +68,9 @@ function redFace() { //6. Peanut Butter Cup Oreos /*Create a function `showPrice` that will add the price of `$5.55` inside the paragraph with the id `price` after hovering your mouse over the paragraph.*/ - +function showPrice() { + price.innerHTML = "$5.55"; +} //7. Mr. Buttons /*Add an Event Listener to the button that will display `myQuote` inside the paragraph with the id of `displayQuote` after the button is clicked.*/ From d6b0d0a2a77ecdf258dbf1df07c666681747c647 Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:22:51 -1000 Subject: [PATCH 5/7] Exercise 7 --- js/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/app.js b/js/app.js index 72b5b93..626abfb 100644 --- a/js/app.js +++ b/js/app.js @@ -75,8 +75,13 @@ function showPrice() { //7. Mr. Buttons /*Add an Event Listener to the button that will display `myQuote` inside the paragraph with the id of `displayQuote` after the button is clicked.*/ +Benjamin.addEventListener("click", showQuote); + var myQuote = "Our lives are defined by opportunities; even the ones we miss."; +function showQuote() { + displayQuote.innerHTML = myQuote; +} //8. Say It again, Randomly From 383699ae550144f04c87859b0a2b563afccdd1a7 Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:27:54 -1000 Subject: [PATCH 6/7] Exercise 8 --- js/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/app.js b/js/app.js index 626abfb..2a30d1c 100644 --- a/js/app.js +++ b/js/app.js @@ -89,7 +89,12 @@ function showQuote() { var quotes = ["It's a funny thing about comin' home. Looks the same, smells the same, feels the same. You'll realize what's changed is you.", "Momma? Momma? Some days, I feel different than the day before.", "Some people, were born to sit by a river. Some get struck by lightning. Some have an ear for music. Some are artists. Some swim. Some know buttons. Some know Shakespeare. Some are mothers. And some people, dance.", "For what it's worth, it's never too late to be whoever you want to be."]; +random.addEventListener("click", randomQuote); +function randomQuote() { + var randomIndex = Math.floor(Math.random() * quotes.length); + displayQuotes.innerHTML = quotes[randomIndex]; +} //9. Unlock the Secret to Financial Freedom From 0d3626d10908a3d5f3f8db6ea18bb4f607d10c3d Mon Sep 17 00:00:00 2001 From: Souzooka Date: Mon, 23 Jan 2017 21:30:31 -1000 Subject: [PATCH 7/7] Exercise 9 --- js/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/app.js b/js/app.js index 2a30d1c..d564dd5 100644 --- a/js/app.js +++ b/js/app.js @@ -100,3 +100,14 @@ function randomQuote() { //9. Unlock the Secret to Financial Freedom /*Create an event listener that will show and hide the message when clickig on the button. */ + +showHide.addEventListener("click", display); + +function display() { + if (showmoney.style.display === "none") { + showmoney.style.display = "initial"; + } + else { + showmoney.style.display = "none"; + } +} \ No newline at end of file