Giter Site home page Giter Site logo

booligoosh / rubiks-time Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 2.83 MB

A clean, modern Rubik's cube timer

Home Page: https://booligoosh.github.io/rubiks-time/

HTML 10.58% CSS 5.21% JavaScript 84.21%
html html5 html-css css css3 javascript rubiks-cube rubik-cube rubix rubiks-cube-timer timer timers

rubiks-time's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rubiks-time's Issues

Starting and stopping broken

When pressing space, I get the following errors logged into the console:

ReferenceError: event is not defined script.js:167:1
spaceDown https://booligoosh.github.io/rubiks-time/script.js:167:1
onkeydown https://booligoosh.github.io/rubiks-time/:1:1

ReferenceError: event is not defined script.js:189:1
spaceUp https://booligoosh.github.io/rubiks-time/script.js:189:1
onkeyup https://booligoosh.github.io/rubiks-time/:1:1

This happens on Firefox 52.0 (64bit) with Ubuntu 16.10.

Remove extra lines when too less solves are done

If no average of 5/12 can be done because of too less solve, the <hr>s are still there and look bad. I would suggest do display only 1 <hr> at the bottom.

This is how your code looks in the browser with 0 solves:

<div id="screen6" style="display: block;">
    <!-- Some more unimportant code -->
      <hr>
      <h2 id="average">Average - NaN:NaN.NaN</h2>
      <hr>
      <h2 id="currentaverageof5"></h2>
      <hr>
      <h2 id="bestaverageof5"></h2>
      <hr>
      <h2 id="currentaverageof12"></h2>
      <hr>
      <h2 id="bestaverageof12"></h2>
    </div>

and these are the visible elements:

<div id="screen6" style="display: block;">
    <!-- ... -->
      <hr>
      <h2 id="average">Average - NaN:NaN.NaN</h2>
      <hr>
      <hr>
      <hr>
      <hr>
    </div>

Average is NaN with 0 solves

To reproduce, clear all solves.
Click on "Stats", then click on "More Stats".
It shows you "Average - NaN:NaN.NaN".

While this is understandable for any JavaScript programmer, any other person will think, that the timer is broken.

Possible solutions are displaying "DNF", "00:00.00" or "can not calculate". You can do this in averageOfArray (line 260 in script.js) by checking like if(array.length<1)return"DNF".

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.