From 05488d52f7e4a5a926582fb7e609864763eec4f0 Mon Sep 17 00:00:00 2001 From: Gage Clancy Date: Tue, 8 Mar 2022 16:46:57 -0600 Subject: [PATCH 1/4] added 3/10 effects --- src/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/index.js b/src/index.js index 13e4739cdd..a71b5b1151 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,21 @@ import './less/index.less' // Your code goes here! +const header = document.querySelector('.main-navigation'); +function headerColor() { + header.style.backgroundColor='green'; +} +function headerColorRestore() { + header.style.backgroundColor='white'; +} +header.addEventListener('mouseover', headerColor); +header.addEventListener('mouseout', headerColorRestore); +function tellWhatKeyPressed(evt) { + if (evt.key === ' ') { + console.log("You pressed the spacebar!"); + } else { + console.log(`You pressed the ${evt.key} key!`); + } + +} +document.addEventListener('keydown', tellWhatKeyPressed); \ No newline at end of file From 35aa48eced1f5c1caaceb5782a1df60a37628d9c Mon Sep 17 00:00:00 2001 From: Gage Clancy Date: Tue, 8 Mar 2022 17:26:38 -0600 Subject: [PATCH 2/4] got 5/10 working --- src/index.js | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index a71b5b1151..03c0a0560b 100644 --- a/src/index.js +++ b/src/index.js @@ -4,18 +4,38 @@ import './less/index.less' const header = document.querySelector('.main-navigation'); function headerColor() { header.style.backgroundColor='green'; + header.style.color='black'; } function headerColorRestore() { header.style.backgroundColor='white'; + header.style.color='black'; } -header.addEventListener('mouseover', headerColor); -header.addEventListener('mouseout', headerColorRestore); +header.addEventListener('mouseover', headerColor); // 1 +header.addEventListener('mouseout', headerColorRestore);// 2 function tellWhatKeyPressed(evt) { - if (evt.key === ' ') { + if (evt.key === ' ') { console.log("You pressed the spacebar!"); } else { console.log(`You pressed the ${evt.key} key!`); } } -document.addEventListener('keydown', tellWhatKeyPressed); \ No newline at end of file +document.addEventListener('keydown', tellWhatKeyPressed);//3 + +const wholeDoc=document.querySelector('*'); + +function darkModeOn(evt) { + wholeDoc.style.backgroundColor='black'; + wholeDoc.style.color='white'; + console.log('Activated dark mode!'); +} +function darkModeOff(evt) { + wholeDoc.style.backgroundColor='white'; + wholeDoc.style.color='black'; + console.log('Turned off dark mode!'); +} + +document.addEventListener('dblclick', darkModeOn); //4 +document.addEventListener('click', darkModeOff); //5 +const intro = document.querySelector('.intro'); +console.log(intro); From ea74c60cd65860bbfdbff6c4ee17b7098c45d1fd Mon Sep 17 00:00:00 2001 From: Gage Clancy Date: Tue, 8 Mar 2022 18:01:38 -0600 Subject: [PATCH 3/4] got 7/10 --- src/index.html | 1 + src/index.js | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index 3fe4e1214f..8c8aef48c8 100644 --- a/src/index.html +++ b/src/index.html @@ -87,6 +87,7 @@

Island Getaway

Copyright Fun Bus 2021

+

Sign Up for our mailing list!

diff --git a/src/index.js b/src/index.js index 03c0a0560b..69b2740814 100644 --- a/src/index.js +++ b/src/index.js @@ -23,6 +23,7 @@ function tellWhatKeyPressed(evt) { document.addEventListener('keydown', tellWhatKeyPressed);//3 const wholeDoc=document.querySelector('*'); +const button=document.querySelectorAll('.btn'); function darkModeOn(evt) { wholeDoc.style.backgroundColor='black'; @@ -34,8 +35,20 @@ function darkModeOff(evt) { wholeDoc.style.color='black'; console.log('Turned off dark mode!'); } +const introPic=document.querySelector('.intro') +introPic.addEventListener('dblclick', darkModeOn); //4 +introPic.addEventListener('click', darkModeOff); //5 -document.addEventListener('dblclick', darkModeOn); //4 -document.addEventListener('click', darkModeOff); //5 -const intro = document.querySelector('.intro'); -console.log(intro); +function loader() { + console.log('You made it, cool.'); +} + +window.addEventListener('load', loader) //6 + +const inputFocus=document.querySelector(".user-input"); + +function buttonFocus (evt) { + inputFocus.style.backgroundColor='green'; +} + +inputFocus.addEventListener('focus', buttonFocus);// 7 \ No newline at end of file From d747be92b2605afd5e38cd0558ba57e999efff98 Mon Sep 17 00:00:00 2001 From: Gage Clancy Date: Tue, 8 Mar 2022 18:39:57 -0600 Subject: [PATCH 4/4] finished --- src/index.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 69b2740814..1c34dbcf08 100644 --- a/src/index.js +++ b/src/index.js @@ -51,4 +51,22 @@ function buttonFocus (evt) { inputFocus.style.backgroundColor='green'; } -inputFocus.addEventListener('focus', buttonFocus);// 7 \ No newline at end of file +inputFocus.addEventListener('focus', buttonFocus);// 7 + +function wheelTest(evt) { + console.log('SPIN THE WHEEEEELLLLLLLL!!!!!'); +} + +document.addEventListener('wheel', wheelTest); // 8 + +function scrollTest(evt) { + console.log('WAHHH YOU LEFT ME BEHIND HOW COULD YOU'); +} + +document.addEventListener('scroll', scrollTest); // 9 + +const navLink=document.querySelector('.nav-link'); +function rickRoll(evt) { + navLink.href="https://www.youtube.com/watch?v=iik25wqIuFo"; +} +navLink.addEventListener('click', rickRoll); //10 \ No newline at end of file