An engaging web-based quiz game that tests user's general knowledge through image-based questions.
Each question comes with a timer, hint option, and dynamic feedback after completion.
Try the Interactive Quiz (Hosted on Vercel)
Note:
To open the quiz in a new tab, use:
- Ctrl + Click (Windows/Linux)
- Cmd + Click (Mac)
- Or Middle-click the link
- 10 Image-Based Questions (Shuffle every playthrough)
- Timer for each question (20 seconds default)
- Hints (Displayed on button click, styled for readability)
- Randomized options per question
- Answer Review Screen:
- Green gradient for correct answers
- Soft red highlight for incorrect selections
- Selected options highlighted (even if wrong)
- Unanswered questions tagged clearly
- Restart Quiz option
- Smooth Animations (Fade-in transitions)
- Responsive Design (Works on desktop, tablet, and mobile)
- Custom Background and Poppins, sans-serif font for a calm UI
- Click Start Quiz to begin.
- For each question:
- Choose your answer before the timer runs out.
- Click Show Hint if needed.
- Submit your answer or let the timer auto-move to the next.
- After all questions, review your answers.
- Click Restart Quiz to try again.
- HTML
- CSS (Flexbox, Media Queries, Gradients)
- JavaScript (Vanilla JS, no frameworks)
Interactive-Quiz/
│
├── index.html # Main UI structure (Start screen, Quiz, Result, Footer)
├── script.js # Core logic (Quiz flow, Timer, Hints, Review screen)
├── style/
│ └── style.css # Styling (Theme, Animations, Responsiveness)
├── assets/
│ ├── *.png, *.jpg # All quiz images & background
└── README.md # Project documentation (this file)
setupQuiz(): Initializes the quiz, resets state, shuffles questions.displayQuestion(): Handles rendering each question, options, image, and hint.finishQuiz(): Displays the results, shows feedback with proper highlights.- Helper Functions:
shuffleArray()- Randomizes array elements.createElement()- Simplifies DOM creation.updateTimerDisplay()- Updates timer UI.
- Gradient background (
background1.pngused with overlay) - Custom button styles: Submit, Hint, Restart
- Answer feedback colors: correct, wrong, unanswered
- Responsive design: Tablet & Mobile support via media queries
- Start Screen → Quiz Area → Result Section
- Footer with GitHub and LinkedIn links (for Sahari Krithik)
- Clone or download this repository.
- Open
index.htmlin any modern browser. - Enjoy the quiz!
- Add your own questions in
script.jsinside thequizQuestionsarray. - Replace images in the
assets/folder. - Change timer settings by modifying
questionTimeLeft(default: 20s).
This project is open source and free to use for educational or personal purposes.