Skip to content

nerdylua/interactive-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive JavaScript

This repository features a fun interactive JavaScript project where the "No" button on a webpage moves randomly when hovered over. This playful behavior is achieved by using the Math.random() function to reposition the element each time the cursor moves over it.

Features

  • Interactive Element: The "No" button moves to a random location on the page when hovered over.
  • JavaScript Fun: Uses JavaScript for real-time DOM manipulation with the Math.random() function to change the button's position.

Installation

  1. Clone the repository:
    git clone https://github.com/nerdylelouch/interactive-javascript.git
  2. Open the index.html file in your browser to see the effect.

Usage

Simply move your cursor to the "No" button and watch it evade the mouse by jumping to a new random position.

Customization

You can modify the behavior by adjusting the CSS styles or the JavaScript logic in script.js to suit your needs.

License

This project is open-source and available under the MIT License.

Cheeky Use Case

You can definitely use this as a fun way to apologise to your significant other, crush, or anyone you’ve got some explaining to do with. Just have the button "move away" as you try to get them to say "Yes"! It's a playful way to lighten the mood and add a bit of humor to your day.