Welcome to the Visa Race - a fun project in which participants compete to be the first to receive approval from the consul and receive a VISA! This project is a simple web application built with HTML, CSS/SCSS, and vanilla JavaScript.
The project was built using object-oriented programming paradigm, also my favorite MVC (Model, View, Controller) pattern, promises, canvas and request animation frame.
The goal is to simulate a race in which the consulate checks the details of the participants step by step. Depending on their data, consulate decides whether to issue a visa to the participant or not.
Users can manually enter their details,
such as full name, balance, age, documents, and English level,
or generate random values for these fields.
Participants can also be added to the race randomly.
5 Participants can participate in competitions on the same time.
Initialize the race by displaying circles with participants names using canvas.
Start the race to simulate the visa application process
with animated circles filling up based on different criteria.
All data verified by the consul are thoroughly checked
(the criteria for successful validation are described below)
At the end of the race, the winner's name is displayed.
The logic for generating random data for each participant
is based on the chances of generating successful and unsuccessful results
to advance to the next stage of the race
The participant's full name will be randomly generated based on the internal name database.
Successful balance for passing the visa race of $2000 and above.
a successful balance will be generated in 60% of cases.
Successful age of participant could be from 18 to 60.
a successful age will be generated in 70% of cases.
To successfully obtain a visa, the participant must have all 3 documents. passport, insurance and photo.
Chance of generating all three documents is 80%
Also, to successfully check with the consul you need to have a level of English starting from B1
Chance of generating successful English Level is 30%
Fill or Generate Details:
Enter participant details manually or use the "Generate" buttons to generate random values.
Add Participants:
Click on "Add participant" or use "Generate all" to add participants before starting and initializing the race.
Initiate Race:
Click on "Init" to initialize the race and display participant names in circles via canvas graphic.
Start the Race:
Click on "Race" to start the race animation and see the progress of each participant. Cheer for the favorite participant!
Contains the structure of the web page, including form inputs, buttons and also race display.
Handles user interactions, initializes the race, and controls the overall flow of the application.
Provides styling for the web page.
Defines the Circle class used for rendering animated circles on the canvas.
Generates random values for participant details.
Implement the MVC pattern to manage user data and interactions.
Implement the MVC pattern to manage the race simulation.
This project is posted on github pages. You can use it directly from there or
git clone https://github.com/AntonKotorovych/visa-race-pet.git
Open the index.html file in a web browser. Interact with the form, add participants, and enjoy the race simulation!
Feel free to explore and modify the code to enhance or customize the project according to your preferences. Happy racing!