Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added project #1469

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 45 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -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 = '<h1>LOOK WHAT YOU MADE ME DO!!!!!</h1>'
}
})

document.body.addEventListener('mousemove', evt => {
const { clientX, clientY } = evt
// console.log(`mouse is at ${clientX}, ${clientY}`)
})
const destinations = document.querySelectorAll('.destination')
for (let destination of destinations){
destination.addEventListener('mouseenter', () => {
destination.style.fontWeight = 'bold'
})
destination.addEventListener('mouseleave', () => {
setTimeout(() => {
destination.style.fontWeight = 'initial'
}, 500)
})
}


}

6 changes: 6 additions & 0 deletions src/less/global.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
* {
box-sizing: border-box;
transform: rotateX(0deg);
transition: transform .45s ease-in-out;
}
&.mirror {
transform: rotateX(180deg);
transition: transform .75s ease-in-out;
}

html {
font-size: 62.5%;
Expand Down