This repo is a web application that simulates horse racing and was created according to the task given in the Protein Vuejs Bootcamp.
- Vue3
- Pinia
- Sass
- Vitest
- Vite
- Real-time race of horses running in 8 different lanes on a straight route.
- After pressing the start button, the countdown is shown and then the horses start from the starting point to the race.
- During the race; the horse speeds within a certain range (eg: min 20 km/h, max 40 km/h) are changes randomly.
- During the race; depending on the design, the leaderboard is located anywhere on the screen.
- Depends on the position of the horses the changing rankings are displayed in this table instantly.
- Race can be started at any time by start button.
- The race that has started, cannot end before the last horse crosses the finish line.
- The last horse, after crossing the finish line the race is over, results are shown in a list with lane numbers.
- At the bottom of the list of results is a restart button and when is clicked the button, the app is returns where ready to start of race.
UI should contain as a minimum.
- Start Button
- Countdown
- Leaderboard
- Starting Point
- Lanes
- Horses
- Finish Point
- Results
- Restart Button
In addition to the assigned tasks, the following features have been added
Three layered background was used that moves against the direction the horses are running from the start of the race to the end of the race. Also, in order to be close to reality, after the race starts, the starting line shifts to the left and disappears. Likewise, when any horse completes 70% of the race at the finish line, the finish line slides from the invisible area towards the screen and stops.
The user selects a horse before the race starts and view the ranking of the selected horse on the leaderboard during the race and at the end of the race and the user can change selected horse at the end of the race or start to new race with the same horse by clicking restart button.
- Clone this repo on GitHub
cd
to Project Directory and runnpm install
Hot-reloads for development
npm run dev
Builds and minifies for production
npm run build
Serves recently built app
npm run preview
Run the tests
npm test