This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
You have been given the following mock-up design:
Your task is to implement the slider component of the design. It has the following requirements:
- The cards should slide across the screen infinitely.
- When the user hovers over the cards the cards should slow down to an eventual stop and then resume sliding when the user stops hovering.
- If a specific card is hovered an interesting and dynamic hover effect should be applied.
- Clicking on one of the cards should open a modal with a larger version of the card fixed to the center of the screen.
- There is no design for the look of this modal so you will have to be creative here.
- Bonus points for if you are able to animate the card from its small version to the full version seamlessly.
- The component should be fully responsive.
- The list of items should come from an API. Make user of Next.js route handlers to create a mock route: https://nextjs.org/docs/app/building-your-application/routing/route-handlers
- The mock route should return a list of the cards.
- Simulate a long running request by setting a timeout.
- Create a second route that always returns an error after a few seconds.
- Call the first route from the client and populate the cards with the data from the API.
- Call the second (broken) route and demonstrate how your component will gracefully handle the error.
- Careful consideration should be given to any additional dependencies.
- The slider component should take in list of items to display as props.
- Strict typescript types should be in place.
- Make sure to handle loading and error states correctly.