Web Animation is a dependency-free HTML/CSS/JS project: a responsive city scene with CSS keyframe motion (road/background), Lottie vehicles, and a day/night toggle persisted via localStorage
Live Preview:
https://usernayeem.github.io/web-animation/
- Project Description
- Features
- Technology Used
- Installation
- Usage
- Configuration
- Contributing
- Testing
- License
- Contact / Support
Web Animation is a responsive and visually engaging web project that showcases a dynamic city scene using pure HTML, CSS, and JavaScript. The animation features moving vehicles on a scrolling road against a cityscape background, with an interactive toggle for a day and night theme. The project serves as a demonstration of modern front-end techniques, including CSS keyframe animations, responsive design, and JavaScript-based user interaction.
- Modern Responsive Design: Fully responsive layout that adapts to various screen sizes, from mobile devices to desktops.
- CSS Animations: Smooth, continuous animations for vehicles, the road, and the background using CSS Keyframes.
- LottieFiles Integration: Utilizes high-quality, lightweight vector animations for the vehicles.
- Interactive Theme Toggle: A clickable sun/moon icon allows users to switch between a bright day theme and a dark night theme.
- Persistent Theme: The user's selected theme (light or dark) is saved in the browser's
localStoragefor a consistent experience across sessions. - Zero Dependencies: Built with vanilla HTML, CSS, and JavaScript, requiring no external libraries or frameworks to be installed.
- HTML5 – For the structure and content of the web page.
- CSS3 – For styling, layout, responsiveness (media queries), and all keyframe animations.
- Vanilla JavaScript – For handling user interactions, such as the theme-switching functionality.
- LottieFiles – For embedding scalable and lightweight vector animations.
- Git (to clone the repository)
- A modern web browser (Chrome, Edge, Firefox, Safari, etc.)
-
Clone the repository:
git clone https://github.com/usernayeem/web-animation.git
-
Navigate to the project directory:
cd web-animation -
Open the application: Simply open the
index.htmlfile in your web browser to view the animation.
- Viewing the Animation: Open the
index.htmlfile in a supported web browser to see the animation in action. - Switching Themes: Click on the sun (in day mode) or the moon (in night mode) at the top of the screen to toggle between the two visual themes.
- Responsive Viewing: Resize your browser window to see how the layout and animations adapt to different screen sizes.
- No configuration required. This project is self-contained and does not require any API keys or environment variables to run.
- Styling: All styles and animations can be customized by modifying the
style.cssfile.
Contributions are welcome! If you would like to contribute to this project, follow these steps:
-
Fork the Repository:
- Navigate to the repository you want to contribute to.
- Click the Fork button in the upper right corner to create a personal copy of the project in your GitHub account.
-
Clone the Forked Repository:
- Open your forked repository on GitHub.
- Click the "Code" button to get the HTTPS or SSH URL of your forked repository.
- Open your terminal or command prompt.
- Use the
git clonecommand followed by the URL you copied to clone the repository to your local machine:Replacegit clone https://github.com/yourusername/web-animation.git
yourusernamewith your own Github username. - Navigate into the cloned repository directory:
cd web-animation
-
Create a New Branch: Switch to a new branch where you'll make your changes. You can do this using the following command:
git checkout -b my-branch
Replace
my-branchwith a branch name that describes your work. -
Make Your Changes: Make the necessary changes to the codebase. You can add, modify, or delete files as needed.
-
Stage Your Changes: You can use
git add <filename>to stage specific files orgit add .to stage all changes.git add . -
Commit Your Changes: Commit your staged changes with a descriptive message. Follow the imperative style for commit messages (e.g., “Fix bug” instead of “Fixed bug”). For example:
git commit -m "my commit message"Replace
my commit messagewith a meaningful message for your commit. -
Push to Your Branch: Push your changes to the branch you created:
git push -u origin my-branch
Replace
my-branchwith your branch name. -
Submit a Pull Request:
- Navigate to your forked repository on GitHub.
- Click the "Compare & pull request" button.
- Review the changes you're proposing and ensure they are accurate.
- Add a descriptive title and a detailed description of your contribution.
- Click the "Create pull request" button to submit your contribution for review.
- This project does not include an automated test suite. Manual testing can be performed as follows:
- Open
index.htmlin different web browsers (e.g., Chrome, Firefox, Safari) to ensure cross-browser compatibility. - Test the day/night theme toggle to confirm it functions correctly and saves the state to
localStorage. - Check responsiveness by resizing the browser window or using browser developer tools to emulate different device sizes.
- Open
This project is licensed under the MIT License.
- Author: Md Nayeem
- Repository: github.com/usernayeem/web-animation
- Issues: Please use the GitHub Issues page for bug reports or feature requests.