From 58f30dec7491d43e8f7bd1ca22e1fe11c5d4e8e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 May 2019 20:33:35 -0900 Subject: [PATCH 1/8] solved #1 --- js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 9920c68..ce378d1 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,10 @@ // 1. The Greatest Thing Since Sliced Bread // Find the onclick event in the h3 element and create a function that will italicize the contents and change the font color to cornflowerblue in the div id of 'bread'. - +function italics(){ + bread.style.color = 'cornflowerblue'; + bread.style.fontStyle = 'italic'; +} // 2. The Birth of the Internet // Find the onmouseover event in the h3 element and create a function that will replace the current contents in the div id of 'webby' to the following: From 86a3290110be8a335b46e9721858dd3e9c9ffe2a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 May 2019 20:35:26 -0900 Subject: [PATCH 2/8] solved #2 --- js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index ce378d1..4e8f56b 100644 --- a/js/app.js +++ b/js/app.js @@ -13,7 +13,9 @@ function italics(){ var webContents = 'The Internet got its start in the United States more than 50 years ago as a government weapon in the Cold War. In the 1980s, research at CERN in Switzerland by British computer scientist Tim Berners-Lee resulted in the World Wide Web, linking hypertext documents into an information system, accessible from any node on the network.'; - +function changeContent(){ + webby.innerHTML = webContents; +} // 3. The Boxer Rebellion // Find the onclick event in div id of 'fightDaPower' and create a function that will convert the Chinese text in the same div element into English (the English content is provided below). From 1fb70ca07c6f0652573c775682aeabcffe644f55 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 May 2019 20:45:45 -0900 Subject: [PATCH 3/8] solved #3 --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index 4e8f56b..d5bbfe9 100644 --- a/js/app.js +++ b/js/app.js @@ -20,6 +20,10 @@ function changeContent(){ // 3. The Boxer Rebellion // Find the onclick event in div id of 'fightDaPower' and create a function that will convert the Chinese text in the same div element into English (the English content is provided below). +function translation(){ + fightDaPower.innerHTML = revolution; +} + var revolution = 'Boxer Uprising or Yihetuan Movement was an anti-imperialist uprising which took place in China towards the end of the Qing dynasty between 1899 and 1901. It was initiated by the Militia United in Righteousness, known in English as the "Boxers," and was motivated by proto-nationalist sentiments and opposition to foreign imperialism and associated Christian missionary activity.'; From 22c8919be8954519ea2ddbf532214ad4a3ba46e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 May 2019 20:53:41 -0900 Subject: [PATCH 4/8] solved #4 --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index d5bbfe9..514de8a 100644 --- a/js/app.js +++ b/js/app.js @@ -31,7 +31,11 @@ var revolution = 'Boxer Uprising or Yihetuan Movement was an anti-imperialist up // 4. The Great Depression // Add an event listener to the h3 element id of 'hardTimes' and create a function to display the contents in the div element of 'depress'. +hardTimes.addEventListener('click', showInfo) +function showInfo(){ + depress.style.display = 'block'; +} // 5. Apollo 11 // Add an event listener to the h3 element id of 'blastOff' and create a function to show and hide the contents in the div element of 'moonWalk' after clicking on Apollo 11. From 76843bd4b5783a9212f91f76c02b28261f826fcd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 May 2019 20:56:26 -0900 Subject: [PATCH 5/8] solved #5 --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index 514de8a..f042f45 100644 --- a/js/app.js +++ b/js/app.js @@ -40,7 +40,11 @@ function showInfo(){ // 5. Apollo 11 // Add an event listener to the h3 element id of 'blastOff' and create a function to show and hide the contents in the div element of 'moonWalk' after clicking on Apollo 11. +blastOff.addEventListener('click', showApollo) +function showApollo(){ + moonWalk.style.display = 'block'; +} // 6. The American Civil War // Add an event listener to the div element id of 'freedom' and create a function to remove all instances of 'corn' in the content. From 2c7ebeff9eeeee27db73c5437e75b919193faafc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 May 2019 17:44:05 -0900 Subject: [PATCH 6/8] solved the corn problem --- js/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/app.js b/js/app.js index f042f45..71b3130 100644 --- a/js/app.js +++ b/js/app.js @@ -49,6 +49,13 @@ function showApollo(){ // 6. The American Civil War // Add an event listener to the div element id of 'freedom' and create a function to remove all instances of 'corn' in the content. +freedom.addEventListener('click', delCorn) + +var text = 'The Civil corn War corn in the United States corn began in 1861, after decades of simmering corn tensions between northern corn and southern states over corn slavery, states’ rights and westward corn expansion.' + +function delCorn(){ + freedom.innerHTML = freedom.innerHTML.replace('corn', ''); +} // 7. The Renaissance // Add an event listener to the div element id of 'rebirth' and create a function to remove all the lowercase and uppercase z's in the content. From 556346f6d7b1abb6924c00b3ff9fba35bc7c1bc5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 May 2019 17:52:46 -0900 Subject: [PATCH 7/8] solved #7 --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index 71b3130..775c069 100644 --- a/js/app.js +++ b/js/app.js @@ -60,7 +60,11 @@ function delCorn(){ // 7. The Renaissance // Add an event listener to the div element id of 'rebirth' and create a function to remove all the lowercase and uppercase z's in the content. +rebirth.addEventListener('click', delZ) +function delZ(){ + rebirth.innerHTML = 'The Renaissance is a period in European history, covering the span between the 14th and 17th centuries and marking the transition from the middle ages to modernity.' +} // 8. the Gutenberg Printing Press // Add an event listener to the h3 element id of 'showBooks' and create a function to display a random book title from the classics array in the div element of 'mustRead'. From 57923c21a1238a14745e843d7735236b1ac85a45 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 May 2019 18:09:07 -0900 Subject: [PATCH 8/8] solved da gutenberg question --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index 775c069..4d12a4e 100644 --- a/js/app.js +++ b/js/app.js @@ -71,7 +71,11 @@ function delZ(){ var classics = ["Charlotte's Web", "War and Peace", "The Secret", "How to Win Friends and Influence People", "Good to Great", "The Lean Startup", "The Odyssey", "Essentialism"]; +showBooks.addEventListener('click', randomBook) +function randomBook(){ + showBooks.innerHTML = classics[Math.floor((Math.random() * classics.length) + 0)]; +} // 9. World War II // Add an event listener to the image element and create a function that will toggle between images when hovering (mouseover) on the image.