From e7e46bba79281d8301360feabed34ce46054a986 Mon Sep 17 00:00:00 2001 From: Michael Adamson Date: Fri, 31 Mar 2023 13:36:51 -0400 Subject: [PATCH 1/2] did a console.log --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 13e4739cdd..f1ef02bf50 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ import './less/index.less' // Your code goes here! +console.log("Hello World"); \ No newline at end of file From b7ff7ee1849898eff8dc8e5f7f1a8923a58bf68f Mon Sep 17 00:00:00 2001 From: Michael Adamson Date: Fri, 31 Mar 2023 15:02:07 -0400 Subject: [PATCH 2/2] project is done --- src/index.js | 52 +++++++++++++++++++++++++++++++++++++++++++- src/less/global.less | 8 +++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f1ef02bf50..6290ac1191 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,54 @@ import './less/index.less' // Your code goes here! -console.log("Hello World"); \ No newline at end of file +console.log("Hello World"); + + +// -1 LOAD +window.onload = function(evt){ + console.log(`event ${evt.type} fired! Ready to go`) + + const heading = document.querySelector("h1") + heading.textContent = 'READY TO GO!!' +// -2COPY + window.addEventListener('copy', () => { + navigator.clipboard.readText() + .then(text => { + heading.textContent += text + }) + }) +// -3 click + document.body.addEventListener('click', evt => { + evt.target.classList.toggle('mirror') + }) +// -4 dblclick + document.body.addEventListener('dblclick', evt => { + evt.target.innerHTML = '' + }) +// -5 keydown + window.addEventListener('keydown', evt =>{ + if(evt.key == 6){ + document.body.innerHTML = 'YOU RAN ORDER 66 { + const {clientX, clientY} = evt + //console.log(`mouse is at ${clientX} and at ${clientY}`) + }) + +// -7 mouseenter +// -8 mouseleave + + 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) + }) + } +} \ No newline at end of file diff --git a/src/less/global.less b/src/less/global.less index 56883b027d..65f367ac5a 100644 --- a/src/less/global.less +++ b/src/less/global.less @@ -1,5 +1,13 @@ * { box-sizing: border-box; + + transform: rotateY(0deg); + transition: transform 0.2s ease-in-out; + + &.mirror{ + transform: rotateY(180deg); + transition: transform 0.5s ease-in-out; + } } html {