From 6cbbe1b73cf4bac309b424c1ff6d6b1e99fa1750 Mon Sep 17 00:00:00 2001 From: Terri Archer Date: Mon, 31 Oct 2022 11:56:41 -0400 Subject: [PATCH 1/2] completed coursework --- src/index.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/index.js b/src/index.js index 13e4739cd..7a37a525b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,75 @@ import './less/index.less' // Your code goes here! + +//heading +const heading = document.querySelector('.logo-heading'); +heading.addEventListener('click', e => { + if(heading.style.color === 'blue'){ + heading.style.color = 'green' + }else{heading.style.color = 'blue'} +}) + +//welcome +const welcome = document.querySelector('.intro'); +welcome.children[1].addEventListener('mouseover', e => { + welcome.children[1].textContent = 'Welcome To SUPER Fun Bus!' +}) + +welcome.children[0].addEventListener('drag',e => { + welcome.children[0].style.borderRadius = '100%' +}) + + +//let's go! +const letsGo = document.querySelectorAll('.content-section .text-content')[0]; +window.addEventListener('keydown', e => { + if(e.key === 'l'){ + letsGo.children[0].textContent = 'WHEEEE!' + } +}) + + +//adventure +const adventure = document.querySelectorAll('.content-section .text-content')[1]; +document.addEventListener('wheel', e =>{ + adventure.children[1].textContent = 'You adventured too fast!' +}) + +//buttons +const buttons = document.querySelectorAll('.btn'); +buttons.forEach(e => e.addEventListener('dblclick', (event) => { + e.textContent = 'Fun was only a myth' +})) + + +//destination +const destination = document.querySelector('.content-destination'); +destination.addEventListener('dblclick', e => { + destination.style.border = '2px dotted black' +}) + +//document +document.addEventListener('keydown', e => { + if(e.key === 'b'){ + document.body.style.backgroundColor = 'slategrey' + } +}) + + +//DANGER!!! +const danger = document.querySelectorAll('p'); +document.addEventListener('keydown', e => { + if(e.key === 'Escape'){ + danger.forEach(each => each.textContent = '') + } +}) + +document.addEventListener('keydown', e => { + if(e.key === 'Delete'){ + document.body.remove() + } +}) + + + From 53e6fdacefe05fc1809410dba51cb087bc8c3447 Mon Sep 17 00:00:00 2001 From: Terri Archer Date: Mon, 31 Oct 2022 12:08:24 -0400 Subject: [PATCH 2/2] test dont work --- src/index.js | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/index.js b/src/index.js index 7a37a525b..72a9c7c39 100644 --- a/src/index.js +++ b/src/index.js @@ -3,51 +3,51 @@ import './less/index.less' // Your code goes here! //heading -const heading = document.querySelector('.logo-heading'); -heading.addEventListener('click', e => { - if(heading.style.color === 'blue'){ - heading.style.color = 'green' - }else{heading.style.color = 'blue'} -}) +// const heading = document.querySelector('.logo-heading'); +// heading.addEventListener('click', e => { +// if(heading.style.color === 'blue'){ +// heading.style.color = 'green' +// }else{heading.style.color = 'blue'} +// }) //welcome -const welcome = document.querySelector('.intro'); -welcome.children[1].addEventListener('mouseover', e => { - welcome.children[1].textContent = 'Welcome To SUPER Fun Bus!' -}) +// const welcome = document.querySelector('.intro'); +// welcome.children[1].addEventListener('mouseover', e => { +// welcome.children[1].textContent = 'Welcome To SUPER Fun Bus!' +// }) -welcome.children[0].addEventListener('drag',e => { - welcome.children[0].style.borderRadius = '100%' -}) +// welcome.children[0].addEventListener('drag',e => { +// welcome.children[0].style.borderRadius = '100%' +// }) //let's go! -const letsGo = document.querySelectorAll('.content-section .text-content')[0]; -window.addEventListener('keydown', e => { - if(e.key === 'l'){ - letsGo.children[0].textContent = 'WHEEEE!' - } -}) +// const letsGo = document.querySelectorAll('.content-section .text-content')[0]; +// window.addEventListener('keydown', e => { +// if(e.key === 'l'){ +// letsGo.children[0].textContent = 'WHEEEE!' +// } +// }) //adventure -const adventure = document.querySelectorAll('.content-section .text-content')[1]; -document.addEventListener('wheel', e =>{ - adventure.children[1].textContent = 'You adventured too fast!' -}) +// const adventure = document.querySelectorAll('.content-section .text-content')[1]; +// document.addEventListener('wheel', e =>{ +// adventure.children[1].textContent = 'You adventured too fast!' +// }) //buttons -const buttons = document.querySelectorAll('.btn'); -buttons.forEach(e => e.addEventListener('dblclick', (event) => { - e.textContent = 'Fun was only a myth' -})) +// const buttons = document.querySelectorAll('.btn'); +// buttons.forEach(e => e.addEventListener('dblclick', (event) => { +// e.textContent = 'Fun was only a myth' +// })) //destination -const destination = document.querySelector('.content-destination'); -destination.addEventListener('dblclick', e => { - destination.style.border = '2px dotted black' -}) +// const destination = document.querySelector('.content-destination'); +// destination.addEventListener('dblclick', e => { +// destination.style.border = '2px dotted black' +// }) //document document.addEventListener('keydown', e => {