Skip to content

Instantly share code, notes, and snippets.

View MiniKielbyM's full-sized avatar
👌
alright, ima do a code

Michael Kielbasinski MiniKielbyM

👌
alright, ima do a code
View GitHub Profile
function collide(div1ID, div2) {
const domRect1 = document.getElementById(div1ID).getBoundingClientRect();
const domRect2 = div2.getBoundingClientRect();
return!(
domRect1.top > domRect2.bottom ||
domRect1.right < domRect2.left ||
domRect1.bottom < domRect2.top ||
domRect1.left > domRect2.right
)
}
@MiniKielbyM
MiniKielbyM / mouseMovement.js
Created June 14, 2023 15:46
a mouse movement detector
let m = false;
let id = 'example'
const Element = document.getElementById(id)
//add an 'onclick' listner with the MouseMove() function
function MouseMove()
{
if(m==false)
{
m=true
}