diff --git a/README.md b/README.md index 66fc8a772a..0d920b333e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ## Project Description + Fun Bus wants you to make their site more interactive. They are relying on you to provide 10 unique events to enhance their site. Explore the many events available to you by using the [MDN events reference](https://developer.mozilla.org/en-US/docs/Web/Events). ## Git Setup diff --git a/src/index.js b/src/index.js index 13e4739cdd..6602145ef3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,47 @@ import './less/index.less' -// Your code goes here! +window.onload = function (evt) { + console.log(`event ${evt.type} fired! Lets do this!!`) + const heading = document.querySelector('h1') + heading.textContent = 'HEEYYY YOu GuYs' + + window.addEventListener('copy', () => { + navigator.clipboard.readText() + .then(text => { + heading.textContent += text + }) + + }) + document.body.addEventListener('click', evt => { + evt.target.classList.toggle('mirror') + }) + + document.body.addEventListener('dblclick', evt => { + evt.target.innerHTML = '' + }) + + window.addEventListener('keydown', evt => { + if (evt.key == 6){ + document.body.innerHTML = '