Yet another JavaScript timer

Works great in Vista Firefox.

Great timer! Perhaps you could add in OH too?
Well yeah, you could just use the 3x3x3 timer and copy and paste the stats to notepad or something and change "Statistics for 3x3x3 Cube" to "Statistics for 3x3x3 OH" or something like that. I doubt there's any other puzzle you'd wanna OH anyway, so I don't think there's a point in creating a new category for that *shrugs*

Besides, there are other important stuff on my to-do list that I still haven't started working on, I'll probably be doing 3x3x3 OH after getting all the critical stuff done, no loss doing that anyway :)
 
Edit: Unfortunately, I've only tested this in Firefox in Linux Ubuntu because that's the only thing I have, so I'm gonna need lotsa feedback from other guys using other OSes and other browsers, yup.

Have you had a look at VirtualBox for running XP in Ubuntu? http://www.virtualbox.org
Unlike VMware, it seems to run pretty flawlessly on my system. I use it for testing sites with IE, using Cube Explorer etc.

Also, any chance you could add standard deviation as a percentage of average? :)
 
Have you had a look at VirtualBox for running XP in Ubuntu? http://www.virtualbox.org
Unlike VMware, it seems to run pretty flawlessly on my system. I use it for testing sites with IE, using Cube Explorer etc.

Also, any chance you could add standard deviation as a percentage of average? :)
Use WINE. especially for CubeExplorer.
 
Updated: (Finally!)
  • ~10% decrease in file size, not much, but worth mentioning :p (Further update: Now ~21% decrease from the original file size! :D)
  • Pyraminx scrambler added. All scramblers now comply with 2008 WCA regulations. I'll try to add the optimal scramblers as soon as I have more free time, like I had today :) Please tell me if there are any problems with any of the scramblers. Of course, credit goes to Jaap Scherphuis, Syoji Takamatsu and Clément Gallet for the original code, I just condensed their work into single-lined codes.
  • 0.00 is now impossible :)
  • "Page scrolls downwards and hides the timer when I hit spacebar!" Problem fixed, scrollbars are added when stats/time log gets too long. Please tell me if the problem still persists on your computer.
  • Session mean, session average, current average of 5 and current average of 12 now have progress indicators. A (-x.xx) indicates an improvement from the last solve; a (+x.xx) indicates a "deprovement."
  • New statistic next to standard deviation indicates standard deviation as a % of session mean.
  • Page title changed temporarily until I come up with a nice name for my timer. All suggestions welcome :)

To-do:
  • Optimal random position scramblers for 2x2x2 and pyraminx.
  • CCT-like table of ALL individual solves and rolling averages of 5 and 12.
  • Rolling mean of 3.
  • Maybe add an OH section if there's enough demand.

Any other suggestions for additional features?
 
Last edited:
Guide to customizing look and feel of the timer:

1. Open the file in Notepad (or any other text editor.)
2. At the top of the page, you should see this:
Code:
function youdecide() {
  dcsp = "."; // decimal separator
  pause = 1000; // in milliseconds
  RoA = 5; // length of rolling average A
  RoB = 12; // length of rolling average B
  RoM = 3; // length of rolling mean
  bgC = "#000000"; // background color
  fbgC = "#ffffff"; // flashing background color
  mtC = "#ffffff"; // main timer color
  bldC = "#888888"; // blindfolded timer color
  textC = "#888888"; // main text color
  bTC = "#00ff00"; // best time color
  wTC = "#ff0000"; // worst time color
  llC = "#222222"; // lowlight color
  hlC = "#ffffff"; // highlight color
  staC = "#555555"; // stats title color
  importantstuff();
}
3. Everything here is tweakable to your liking. Most of the stuff is pretty self-explanatory.
4. dcsp must either be "." or ",". The quotes are necessary.
5. pause is that "idle" interval after you stop the timer (IMPORTANT: Read my first post.) I wouldn't recommend anything less than 500 (half a second), because you run the risk of starting the timer again immediately after you stop it. Toy with it to see what's a good number for you.
6. Yes, the length of rolling averages are customizable! You don't have to leave it as 5 or 12, you can have the program calculate rolling averages of 7 and 19 if you like, like Harry Potter currency conversion :rolleyes:
7. Ignore the rolling mean of 3 for now, I haven't added that function yet :p
8. The rest of the stuff should be pretty self-explanatory, they're just colors. You can try English words if you like, most of the time, they should work as you expect them to, but you have to quote them, for example, bgC = orange won't work, but bgC = "orange" will.
9. Don't touch the importantstuff() command if you don't know what you're doing!
10. Once you've done all your changes, save the file and open it in your browser, the settings should have been changed.

Can someone artistic also come up with alternative color templates and post them up here for others to copy and paste it? I think that'd be nice :)

Feel free to ask if I was unclear or if you have other questions.
 
Last edited:
Great job blah, lovin all the new features! :cool:
Also, +1 for adding the SD as %

I've had a wee fiddle with the style and uploaded a black on white version here: http://cube.crider.co.uk/blah_timer.html

I had to fiddle with the css a bit too, so I separated out all the custom content to make updates easier. The additional files are:

I hope you don't mind it being posted online. If you do, jus let me know and I'll have it removed.

Finally, a few more feature requests:
(1) Could the times be saved in a cookie so that if the page is refreshed or closed they aren't lost?
(2) Could you implement a multi-stage timer to record sections of your solve?
(3) 15sec WCA inspection - V important for ZZ'ers :o

Ta :)
 
Last edited:
Pretty :) With a few minor flaws: The hovering average of 5 and 12 have the same color, and the cellpadding needs to be tweaked to make it prettier (because you added solid borders.)

Here's a suggestion, you can actually go through the code and make the CSS background-color change for hovering averages (instead of the CSS color.) Shouldn't be too hard. That was actually my original design, but I thought the highlight/lowlight thing was cooler :p

Do anything you want with it if you're just modifying it for personal use. Though I'd like to see the results of your modification to see if there's anything I like and would want to implement in the original version :)

And CHANGE THE TITLE. Blah Timer sounds really stupid :p Any ideas?

Edit: I forgot about the feature requests :p

Let's see, unless you can help me with (1), I have absolutely no idea how to work with cookies. Remember I've only had 1 week of experience with JavaScript when I wrote this, and I haven't learned anything new since :o And besides, wouldn't the cookie be like, HUGE?

I'll see what I can do about (2), but I'm quite certain it won't happen in the near future because (a) I'm not sure if it's within my ability to implement something like that, and (b) I'm not sure if it's possible to fuse such a feature into my timer at this stage of development.

(3), yeah I'll add that to my to-do list, but it might take a while. Might have to wait till the next Labor Day before I'm free enough to do this again :o
 
Last edited:
How about IMPACT? Recursive acronym for IMPACT: My Pretty Awesome Cube Timer :p Too corny.
 
Pretty :) With a few minor flaws: The hovering average of 5 and 12 have the same color, and the cellpadding needs to be tweaked to make it prettier (because you added solid borders.)
Weird, both seem to be working for me (see attached screenshot). What OS/browser you using? I'm Ubuntu/firefox.
EDIT: Oh yeah, see what you mean by the avg of 5/12, will fix if I get the time..

Do anything you want with it if you're just modifying it for personal use. Though I'd like to see the results of your modification to see if there's anything I like and would want to implement in the original version :)
I changed it so that all style elements are defined in the stylesheet (no need for the seperate JS file. I've added some code to allow quick/easy switching between styles.
@see http://cube.crider.co.uk/timer.html

And CHANGE THE TITLE. Blah Timer sounds really stupid :p Any ideas?
LOL, changed :p


Let's see, unless you can help me with (1), I have absolutely no idea how to work with cookies. Remember I've only had 1 week of experience with JavaScript when I wrote this, and I haven't learned anything new since :o And besides, wouldn't the cookie be like, HUGE?
I've used a cookie for the style switcher code, so that should give you a good idea of how they're used. I don't think the times would be too much for a cookie to handle. A browser will store 20 cookies per domain (4k per cookie), so that should be more than sufficient. The hardest part will probably be parsing a stored cookie string and generating the stats on the initial page load. It prob shouldn't be too difficult tho ;)

I'll see what I can do about (2), but I'm quite certain it won't happen in the near future because (a) I'm not sure if it's within my ability to implement something like that, and (b) I'm not sure if it's possible to fuse such a feature into my timer at this stage of development.

(3), yeah I'll add that to my to-do list, but it might take a while. Might have to wait till the next Labor Day before I'm free enough to do this again :o
The multi-stage times could be implemented in a similar way to the BLD timer, however it would be quite basic. A good implementation would allow selection of the number of stages, would summarise the stats for each stage, and the whole solve. I realise that these features require a lot more code hacking, so no worries ... its still quite a nice tool as-is :)
 

Attachments

  • timer_screenshot.png
    timer_screenshot.png
    72.1 KB · Views: 16
Last edited:
blah, I think you should fix the calculation of standard deviation. I input these test times in your timer and CCT

9.87, 9.74, 9.74, 3.38, 21.61

SD from your timer: 5.92
SD from CCT: 0.06

My guess is that you didn't set the calculation to exclude best and worst times?
 
Back
Top