A stylized Dog Breed Quiz App, written in React & NextJS. Built for a deeper understanding of React, NextJS and CSS Modules. For having fun, and for the love of dogs!
The Quiz Page houses numerous rendering logic and helper functions for the Quiz itself.
The Utils folder houses a custom Randomizer function to provide a random sequence of questions to each user of the quiz
export function getRandomQuestion(usedQuestions) {
let max = Questions.length - 1;
let min = 0;
let randomNum = Math.floor(Math.random() * (max - min + 1) + min);
while (usedQuestions.includes(randomNum)) {
randomNum = Math.floor(Math.random() * (max - min + 1) + min);
}
return [randomNum, Questions[randomNum]];
}
This site is hosted on Whoofer and the live version can be visited there.
For a local version, once you have cloned the repo, run npm i to install all dependencies. And then npm run dev to fire up a local NextJS server instance.
- Ameera Ali - UI/UX Design
- Matt Banh - Code Reviews