I've added a subtle animation to the logo in our Navbar component using Tailwind CSS.
-
Tailwind Configuration I extended our Tailwind configuration in
tailwind.config.tsto include custom animation properties:theme: { extend: { animation: { move: 'move 5s linear infinite', }, keyframes: { move: { '0%': { transform: 'translateX(0)' }, '50%': { transform: 'translateX(10px)' }, '100%': { transform: 'translateX(0)' }, }, }, }, },
-
Application in Navbar Component In
app/Components/Navbar.tsx, I applied the animation to the logo container:<div className='xs: h-1 w-2/5 animate-move'> <Link href="#Landing"> <Image width={80} height={10} alt='' src="/RentalImages/logo.png" style={{ width: 'auto', height: 'auto' }}></Image> </Link> </div>
The
animate-moveclass applies our custom animation. -
CSS Fallback I also added a CSS fallback in
app/Components/Navbar.cssfor browsers that might not support Tailwind's animations:.animate-logo { animation: move 5s linear infinite; } @keyframes move { 0% { transform: translateX(0); } 50% { transform: translateX(10px); } 100% { transform: translateX(0); } }
The logo now smoothly moves 10 pixels to the right and back to its original position in a continuous 5-second cycle. This subtle movement adds a dynamic element to our navbar without being distracting.
- Enhances visual interest
- Draws attention to the brand logo
- Demonstrates modern, interactive design principles
This animation is lightweight and doesn't affect performance, making it a simple yet effective way to improve our user interface.
3 FireBase
- you can actually use firebase as the database go and read the documentation But I have built a simple backend service just to store your data in the folder You can just take a look at it.
I've created a simple backend service to store your data. This backend is located in the backend folder of your project. It's important to note that this backend service is not yet complete and is intended as a starting point for data storage.
To access the backend service:
- Open your terminal or command prompt.
- Navigate to your project's root directory.
- Enter the backend folder by running:
cd backend
To start the backend server:
- Ensure you're in the
backendfolder. - Install the necessary dependencies (if you haven't already):
npm install - Start the server by running:
node index.js
The server should start and you'll see a message: "The app is listening...."
The backend currently includes:
- An Express server set up to listen on port 3001.
- A POST route at
/v1/hotelthat accepts form data. - Basic validation to check if all required fields are present.
This backend is a work in progress. You may want to:
- Implement actual database integration (e.g., with MongoDB or PostgreSQL).
- Add more robust error handling and input validation.
- Implement additional routes for CRUD operations.
- Set up environment variables for sensitive information.
Remember to refer to the index.js file in the backend folder for the current implementation details and to make any necessary modifications as you develop your application further.