Skip to content

mehdisafari77/Code-Quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code-Quiz

A responsive Javascript Coding Quiz.

Site GIf

RPReplay_Final1632890090_SparkVideo

Technologies Used

  • HTML - for base structure
  • CSS - stying of html
  • Javascript - for logic and functionallity purposes (local storage usage)

Summary

This website's functionality will start after the start button is tapped or clicked. The game will start with a running timer, there are 6 questions to answer, all multiple choices, one is correct. When a correct answer is chosen, the timer contoniues to run as normal, but when wrong answer is chosen, user will notice timer to lose seconds. User will lose wither by finishing questions, or by losing time. After game is over, user ca store their name an score in their local storage. This project uses a lot of DOM manipulation of HTML elements. The website is also built and designed to be mobile responsive.

Javascript Code Snippet

An example of a timer alongside start game function

function gameStart() {

    timeLeft = 100;
    timerElement.innerHTML = timeLeft;

    timer = setInterval(function() {
        timeLeft--;
        timerElement.innerHTML = timeLeft;
        // Run endgame function when timer equals 0
        if (timeLeft <= 0) {
            clearInterval(timer);
            gameEnd() 
        }
    }, 1000);
  
   loop()
  }

Deployed Link

Author Links

LinkedIn GitHub

Acknowledgements

  • W3 Schools

About

A Javascript Coding Quiz.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published