Git Product home page Git Product logo

viditvarshney / reaction-timer.github.io Goto Github PK

View Code? Open in Web Editor NEW
11.0 8.0 9.0 79 KB

This is the game based on javascript which notes your reaction time , you have to very attentive towards it ...... So check and play .

Home Page: https://viditvarshney.github.io/Reaction-Timer.github.io/

License: GNU General Public License v3.0

HTML 51.15% JavaScript 43.52% CSS 5.33%
html html5 css reaction-timer reaction latest-game-using-javascript javascript-game javascript javascriptprojects

reaction-timer.github.io's Introduction

Join the chat at https://gitter.im/Reaction-Timer/Lobby tweet button dev-Branch License Stargazers awesome

Reaction-Timer-

This is the game based on javascript which notes your reaction time , you have to very attentive towards it ...... So check and play . Live at Click-Me


Welcome to the "Reaction-Timer"

This is the game which will make you attentive with the game . It is very interesting when you bored ...


You have to click the shapes as fast as you can , your time of response wil be automatically noted and displayed on the left hand side


Here are the screenshots of the Game !...

reaction Screenshot 1

reaction1 Screenshot 2

You are most welcome to modify and give the suggestions .. If You find any mistake or error then make a pull request or inform to me ..


Programming Languages Used Here Are :

  • Javascript
  • HTML & CSS

🙌

Connect

GitHub @viditvarshney (follow) To stay up to date on free & open-source software

Twitter @_imvv_ (follow) To get interesting tweets about tech.

YouTube BuzzFedRed (subscribe) To gaming videos,tech videos, advices, motivation

Medium: @imvv (read) In-depth & long form technical articles

LinkedIn @Vidit Varshney (connect) On the LinkedIn profile y'all


reaction-timer.github.io's People

Contributors

jsboyrahul avatar viditvarshney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reaction-timer.github.io's Issues

Update Readme

Update the readme with the current version i.e., dev branch
currently, readme has outdated screenshots

Record Best Time

This is the Javascript

` var start = new Date().getTime();

        function getRandomColor() {
            
            var x = Math.floor(Math.random()* 256);
            var y = Math.floor(Math.random()* 256);
            var z = Math.floor(Math.random()* 256);
            
            var randomColorMaker = "rgb(" + x + "," + y + "," + z + ")";
        
            document.getElementById("shape").style.backgroundColor = randomColorMaker;
        }
        
        function makeShapeAppear() {
            
            var top = Math.random()* 400;
            
            var left =Math.random()* 1150;
            
            var width = (Math.random()* 400) + 100;
            
            if(Math.random() > 0.5) {
                
                document.getElementById("shape").style.borderRadius = "50%";
            } else {
                
                document.getElementById("shape").style.borderRadius = "0";
            }
            
            document.getElementById("shape").style.top = top + "px";
            document.getElementById("shape").style.left = left + "px";
            document.getElementById("shape").style.width = width + "px";
            document.getElementById("shape").style.height = width + "px";
            
            document.getElementById("shape").style.backgroundColor = getRandomColor();
            
            document.getElementById("shape").style.display ="block";
            start = new Date().getTime();
        }
        
        function Timeout() {
            
            setTimeout(makeShapeAppear, Math.random()* 2000);
            
        }
        Timeout();
        
    
        document.getElementById("shape").onclick = function() {
            
            document.getElementById("shape").style.display = "none";
            
            var end = new Date().getTime();
            
            var timeTaken = (end - start) / 1000 + " sec";
            
            document.getElementById("timeTaken").innerHTML = timeTaken;
            
                var bestTime = 0; 
            
                if (timeTaken < bestTime) {
                    
                    bestTime = timeTaken;
                    document.getElementById("best").innerHTML = bestTime + " sec";
                } else {
                    
                    document.getElementById("best").innerHTML = timeTaken + " sec";
                }
            
            
            Timeout();
        }`

This is the HTML code

`

<title>Reaction Time Game</title>

    <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
    
    <h1>Test Your Reactions!</h1>
    <h2>Click On The Boxes And Circles As Quickly As You Can! </h2>
    <h3>Your best time and the current time is displayed before</h3>
    
    <p class="bold">Your Time: <span id="timeTaken"></span></p>
    
    <p class="bold">Your Best Time: <span id="best"></span></p>
    
    <div id="shape"></div>
    
    <script type="text/javascript" src="script.js"></script>
    
</body>
`
  • Record the best time of the User and display it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.