goinaction / code

Source Code for Go In Action examples
4.13k stars 2.37k forks source link

Love #151

Open AshhLoveCode opened 10 months ago

AshhLoveCode commented 10 months ago

const wrapper = document.querySelector(".wrapper"); const question = document.querySelector(".question");

const gif document.querySelector(".gif");

const yesBtn = document.querySelector(".yes-btn");

const noBtn = document.querySelector(".no-btn");

yesBtn.addEventListener("click", () => {

question.innerHTML = "Aaaaa, I like you too";

"https://raw.githubusercontent.com/DzarelDeveloper/Img/main/gif.webp"; });

gif.src =

noBtn.addEventListener("mouseover", () => {

const noBtnRect noBtn.getBoundingClientRect();

const maxX = window.innerWidth noBtnRect.width;

const maxY = window.innerHeight noBtnRect.height;

const randomX = Math.floor(Math.random() * maxX);

const randomY = Math.floor(Math.random() * maxY);

noBtn.style.left = randomX + "px"; noBtn.style.top = randomY + "px";

});