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

updated #1457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

updated #1457

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
85 changes: 85 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
import './less/index.less'

// Your code goes here!
const noRefresh = document.querySelector('.nav');
noRefresh.addEventListener('click', function(event){
console.log(`I was clicked hehe`);
event.preventDefault();
});

const blog = document.querySelectorAll('.nav a');
blog[2].addEventListener('click', function(e){
alert('My blog is empty do not go there!!! or else!!!!')
e.stopPropagation()
});

//2mouseover
const footer = document.querySelector('footer');
footer.addEventListener('mouseover', function(e){
console.log(`bang bang`);
e.stopPropagation();
});

//3wheel
const foot = document.querySelector('footer');
foot.addEventListener('wheel', function(e){
console.log(`I was scrolled over :) ${e}`);
e.stopPropagation();
});

//4auxclick
const anchors = document.querySelectorAll(".nav a");
anchors.forEach(function(e){
e.addEventListener('auxclick', function() {
e.style.color = 'pink';
console.log('I turn all the links pink AND that rhymed')
});
})

//5drag
const beepBeep = document.querySelector('.headerImg');
beepBeep.addEventListener('drag', function() {
console.log("can you please stop dragging me?")
})
//6keydown
window.addEventListener('keydown', function() {
alert("NO BUTTON PUSHING ON THIS PAGE!!!!")
})
//7copy
window.addEventListener('copy', function() {
alert("NO TOUCHY, NO COPY")
})
//8 mousemove
const btnsOmg = document.querySelectorAll('.btn');
btnsOmg[0].addEventListener('mousemove', function(){
btnsOmg[0].textContent = "O"
});
btnsOmg[1].addEventListener('mousemove', function(){
btnsOmg[1].textContent = "M"

});
btnsOmg[2].addEventListener('mousemove', function(){
btnsOmg[2].textContent = "G"

});
//9contextmenu
btnsOmg.forEach(function(e){
e.addEventListener('contextmenu', function(){
e.style.backgroundColor = 'lightBlue';
})
});
//10 mouseleave
const destination = document.querySelectorAll(".destination");
destination.forEach(function(e){
e.addEventListener('mouseleave', function() {
e.style.backgroundColor = 'pink';
e.style.color = 'gray';
});
})



//stretch
const para = document.querySelectorAll("p");
TweenMax.to(para, 0.2, {scale:5, ease:Bounce.easeOut})
TweenMax.to(para, 0.2, {scale:1, delay:0.5})