Skip to content

aedoardo1990/F1_PolePosition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

F1 - Pole Position

Welcome to F1 - Pole Position! This is a Memory Card Game for fans of Formula 1 and of online games. Uncover the matching pairs of F1 teammates. The fastest you match them and the higher chances you will have to start in pole ahead of everyone and of Super Max - alias Max Verstappen.

In Formula 1 racing and other motorsport races, the pole position is usually the best and "statistically the most advantageous" starting position on the track. The driver starting on pole is the one that qualifies with the fastest lap on the day before the race.

The link to our Live Website can be found here - F1 - Pole Position!.

Responsive Mockup

Index - Table of Contents


User experience

Target audience

The F1 - Pole Position! website targets an audience of people interested in motorsport online games - especially fans of Formula 1 -, card games and in general aims at reaching people interested in sport online games.

User stories

As a site visitor I want to

  • read a quick and clear explanation of the game and start playing immediately.
  • know more information about the Formula 1 pilots and its teams.
  • know who is Super Max.
  • be able to enter my driver/player name, my photo and to have them displayed in the site.
  • access a website that it is easy to navigate and with some interactive features.
  • want to hear the Formula 1 anthem to get adrenaline for the game.
  • a site where I can play with the cards of the pilots of Formula 1.
  • feel the atmosphere of Formula 1 races through a website with captivating design.
  • have a game based on time speed.
  • know my final position at the end of the game.
  • get a congratulation message if I'll finish on podium.
  • get a congratulation message with music if I'll finish first.
  • have the option to play again after the end of the game.
  • keep updated about new features of the site by accessing the social media links.

As a site administrator I want to

  • introduce future features to the website.
  • offer the user with an interactive experience.
  • attract more fans to Formula 1.

Design

Color scheme

The color chosen for the website are red, white and black. These colors are mainly the same of the official website of Formula 1. Purpose of these colors is to recreate the feeling of Formula 1 racing

On the top of them, gold metallic, silver and bronze are used for the pop up messages at the end of the game according to the position of the player. They aim at recalling the colors of the medals used to award in sport competitions.
If the player does not finish on podium, the color of the message will be in brown. That is because in sport the "award" a sportsman gets for 4th place is known as the "wooden medal".

Typography

The Font chosen for the text on all the pages is "Titillium Web". This is the same Font of the mentioned website of Formula 1. This Font aims as well at conveying the atmoshere of Formula 1 racing.

Wireframes

The wireframes for the "F1 - Pole Position" website were created with Figma.

Features

The website includes all the necessary features of a functioning and interactive memory card game website.

Modal to start the game

The modal pops up when the site loads. It allows to enter the player name and to upload a player photo. Photo and player name will be then transferred to the black score area box. When the button "Start the Qualifying" is pressed, the game starts. The player is not obliged to enter a name and upload a photo. The game will run anyway by pressing the button.

The logo and the header

The logo at the top left corner of the website is the official logo of Formula 1. Purpose of the design of the header is to remind the one of the official site of Formula 1.

Game rules

In this section there is a brief description of the game rules. Not much is written about the rules regarding the uncovering of memory cards since this is self-explanatory and it is a game known by almost everyone.

Super Max

When clicking on Super Max the user is redirected to the Wikipedia page of Max Verstappen, the current F1 World Champion. If you are curios to know more about the origin of his nick name, click here.

Formula 1 pilots and teams

For the users that don't know much about Formula 1, they can get all the in-depth information about F1 drivers and its teams by clicking on "Formula 1". They will be redirected to the official page of Formula 1.

The Official F1 Anthem

This audio toggle allows to listen to a part of the official anthem of Formula 1 before playing. This is a function to recreate the feeling of Formula 1 racing for F1 fans. If you want to listen to the full anthem, please click here.

1- Play button

2- Stop button

The score area

In the score area you have information about the player's name, gaming time, final position and there is the photo of Max Verstappen in a Card Format.

When the button "Start the Qualifying" is pressed, 4 things happen at the same time:

  • the timer in the score area box starts
  • the driver photo of Verstappen is replaced with the one of the player
  • the driver name is entered
  • the game begins

When the game ends, the "Position:" line will be updated with the final position of the player. There are 4 positions: 1st, 2nd, 3rd, and Out of Podium.

The design of the score area aims at reminding the design of the official qualifying table of Formula 1. Here below an example.

Back image of the cards

The back image of the cards is the Ferrari of the driver Charles Leclerc. Ferrari is the iconic team of Formula 1 and it is the only team which has participated to all the F1 championships since the first Formula 1 season of 1950.

Game area

This is the main feature of the site. It consists of 12 cards (6 pairs), which appear face down at the start of the game. When clicked, cards turn face up. Matching pairs remain face up. Non-matching cards flip back with face down.

End of Game Message

At the end of the game, the timer will stop and the final position will be entered in the score area. Then a window will pop up and display the final position with the matching color( Gold for 1st, Silver for 2nd, Bronze for 3rd, Brown for Out of Podium/Fourth). Just for the winner who will get the Pole Position, an audio theme will start when the end game window will pop up as below.

Soundtrack for the winner

The soundtrack - "Les Toreadors" of Georges Bizet - is the theme that you can hear at the end of a F1 Grand Prix when the winners ceremony with champagne takes place. Click here to check a F1 Podium ceremony. The Sountrack aims at recreating the atmosphere of F1.

Drive again button

When the end of game window pops up, there is a button that will allow to play again. This happens via reload of the site.

Footer

The footer contains the links to our social media pages to keep updated with all the news concerning our website.

Features left to implement

Circuit option

Option to choose from the Start Modal on which circuit of the F1 World Championship to drive.

Car option

Option to choose from the Start Modal for which team/car of the F1 World Championship to qualify.

Different levels of difficulty

The positioning at the end of the race already represents a different level of difficulty according to the time to complete the game. However, in the future it would be nice to add different levels of difficulty to choose from in the Modal that loads at the start. Levels of difficulty would be divided accordingly: Beginner, Intermediate, Pro.

All the F1 pilots cards

The F1 World Championship has 10 teams and 20 pilots (2 pilots per team). The game includes its most prestigious ones, for a total of 6 teams and 12 pilots. For reasons of space (especially for the mobile version) I preferred to opt for a reduction of the amount of pilots. It would be nice to include all the teams and pilots. This should go together most likely with using Flexbox Grid, in order to optimize the screen space.

F1 Ceremony for the winner

To include a video of the typical podium F1 ceremony based on champagne that would be part of the pop up window for the winner.

Background of the cards

The background of the cards could look like the starting grid of a Formula 1 circuit seen from above. It might look as following.

The background grid is as well the reason why the cards are on two rows as well on big screens. The structures in 2 rows would aim at reminding that the pilots are on the starting grid.

Testing

HTML-W3C-Validator

The result of the W3C Validator is all correct, no errors.

CSS-Validator

No errors after checking the code with W3C Jigsaw CSS Validator. There is just one warning visible in the screenshot below at the bottom. This is due to the imported Google fonts.

JSHint-Validator

When I first tried to validate the JS code, there were many of the following errors.

After writing the comment /jshint esversion: 6/ at the top of the file, almost all warnings disappeared.

According to the final validation (image below) there are 6 unused variables and one warning left. I tried to the delete the mentioned variables from the script.js file but then the website was not working correctly. Therefore, I did not take delete them.

Lighthouse testing

Here below the score resulting from Lighthouse testing for the Website.

Form testing

The modal form has been tested so that the game can be played without having to enter a driver name and upload a driver photo

Browser testing

The Website was tested on Google Chrome, Microsoft Edge, Safari, and Firefox with no issues.

Device testing

The Website was tested on the following devices, OnePlusNord10, iPhone13 mini, MacBook, laptop Acer Swift SF314-43 and created for the following screen sizes: 320px, 576px, 768px, 992px, 1240px, 1440px, 2560px and up.

Mentor, family and friends testing

My mentor, my family and friends checked the site and helped to identify bugs and get a feeling about how the user-experience is perceived by visitors of the site.

Testing User Stories

Expectation (As a user, I want to...) Result (As a user, I...)
read a quick and clear explanation of the game and start playing immediately. can read a simple and precise introduction about the game and play straight away.
know more information about the Formula 1 pilots and its teams. can get a complete overview of the F1 pilots and teams by clicking on the link to the F1 Website.
know who is Super Max. can get more information about Super Max by clicking on the link redirecting to his Wikipedia page.
be able to enter my driver/player name, my photo and to have them displayed in the site. can enter my driver/player name and photo and feel ready to drive!
access a website that it is easy to navigate and with some interactive features. navigate easily the site and find some nice interactive features such as the sountracks and the flipping cards.
want to hear the Formula 1 anthem to get adrenaline for the game. can't stop to hear the F1 anthem, since it makes me feel the adrenaline of F1 racing. I can play and pause the audio.
a site where I can play with the cards of the pilots of Formula 1. can play with the cards of the most pregious teams of F1.
feel the atmosphere of Formula 1 races through a website with captivating design. recognize the logo, the pilots and soundtracks of F1, I can feel the atmosphere of a Grand Prix.
have a game based on time speed. see a timer with my gaming time. It is not so easy to get the Pole Position but I love the challenge.
know my final position at the end of the game. see the final position at the end of the game.
get a congratulation message if I'll finish on podium. get a different message at the end of the game according to my position.
get a congratulation message with music if I'll finish first. get a congratulation message and hear the famous music of F1 podium ceremony when I finish first.
have the option to play again after the end of the game. can restart the game by clicking the button "Drive again!"
keep updated about new features of the site by accessing the social media links. can check on the social media pages whenever there are new features for the game.

Fixed bugs

Pilots images not loading on Edge Browser

The images of the pilots on the front of the cards were not loading just on Microsoft Edge. They were in format ".avi". I converted them to ".jpg" and this solved the issue. By checking the website via the Lighthouse testing, the size of the images of the pilots were too big and heavy for the onload of the site, therefore I resized and compressed the images, and converted them in the end to the format WEBP.

Sample Image in Score Area

The sample image in the Score Area with Max Verstappen and the helmet was often not displaying when the website was loading.

This issue was likely causing a Score of Best Practices section of the Lighthouse testing of 86. I added a dot in the file src (src="/assets/images/verstappen-start.webp" -> src="./assets/images/verstappen-start.webp" ) and then the Lighthouse testing was fully green.

Unfixed bugs

Flexbox on large screens

The cards are organized in 2 rows, vertical on screens of 320px and 576px, horizontal from 768px and up. The horizontal position works well on big screens, but when zooming the flexbox might switch to 3 lines. This might be resolved in the future by using Flexbox Grid.

Footer on Firefox

On the firefox browser, the footer does not align to the bottom.

Technologies used

Languages

  • HTML
  • CSS
  • JavaScript

Programs used

  • Chrome Dev Tools - for testing responsivness, development of the website and lighthouse testing
  • Google Fonts - to import fonts to the website
  • Font Awesome - for social media icons in footer and for the icon of the dropdown menu
  • Figma - to create the wireframes
  • W3C - for HTML & CSS Validation.
  • JShint - for JavaScript Validation.
  • iloveimg - to compress and resize the photos
  • convertio - to convert images to the webp format

Deployment

The project was deployed using GitHub pages. The steps to deploy using GitHub pages are:

  1. Go to the repository on GitHub.com
  2. Select 'Settings' near the top of the page.
  3. Select 'Pages' from the menu bar on the left of the page.
  4. Under 'Source' select the 'Branch' dropdown menu and select the main branch.
  5. Once selected, click the 'Save'.
  6. Deployment should be confirmed by a message on a green background saying "Your site is published at" followed by the web address.

The link of the deployed site can be found here - F1 - Pole Position!

Credits

Media

  • Formula 1 Official - photos of the pilots and the F1 logo at the top left corner of the website
  • Pinterest - photo of the Ferrari on the back of the cards and photo of Max Verstappen in the Score area
  • Red Ringtones - soundtrack of the winner "Les toreadors" of Georges Bizet
  • Zedge - F1 Anthem

Code used

Acknowledgements

My mentor Antonio for his great support and the practical advices.

My wife for her great interest and passion for my work.

My father for the passion he instilled in me to watch F1 since I was a child.

Kay of Code Institute and the Slack Community.