In this project, two divs are generated and styled using CSS to depict an eye. The first div forms an oval, representing the sclera, while the second div, a circular shape, lies within it to signify the eyeball. A third div incorporates two of these elements to construct a pair of eyes, and it is styled to ensure their alignment. Finally, a JavaScript component is employed to track mouse movements, altering the position of both elements representing the eyeballs. This creates the illusion of movement, enhancing the overall visual effect. Enjoy a playful visual experience as the eyes follow your mouse movements.
- Clone the repository.
- Open the
index.html
file in a web browser. - Move your mouse, and watch the eyes follow your cursor.
- Incorporate animated nose and mouth for extra expressions triggered by user clicks or element hovers.
- Implement butterfly animation to make the eyes follow a butterfly flying randomly on the screen, adding an extra layer of interactivity and fun.
MIT License
Copyright (c) 2020 John Williams
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.