From 493202f8d73b0315e02a667316a06202de2d91ca Mon Sep 17 00:00:00 2001 From: Ralph Caraveo III Date: Sun, 14 Jun 2015 21:50:12 -0700 Subject: [PATCH] Introduced better scale factor code and stuff. --- html5/index.htm | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/html5/index.htm b/html5/index.htm index 1b8936a..42d948f 100644 --- a/html5/index.htm +++ b/html5/index.htm @@ -1,9 +1,5 @@ - - - - CD+Graphics Magic :: HTML5 CD+G Player @@ -42,14 +38,17 @@ function toggle_2x_mode() var cnvs = document.getElementById("cdg_canvas"); var audi = document.getElementById("cdg_audio"); - audi.style.width = (zoom_mode) ? 648 + "px" : 324 + "px"; + // Works, you can change this number to 2 or 3 or whatever fits beyatch! + var scale_factor = 2; - brdr.style.width = (zoom_mode) ? 648 + "px" : 324 + "px"; - brdr.style.height = (zoom_mode) ? 432 + "px" : 216 + "px"; + audi.style.width = (zoom_mode) ? (324 * scale_factor) + "px" : 324 + "px"; - cnvs.style.width = (zoom_mode) ? 576 + "px" : 288 + "px"; - cnvs.style.height = (zoom_mode) ? 384 + "px" : 192 + "px"; - cnvs.style.padding= (zoom_mode) ? 24 + "px" : 12 + "px"; + brdr.style.width = (zoom_mode) ? (324 * scale_factor) + "px" : 324 + "px"; + brdr.style.height = (zoom_mode) ? (216 * scale_factor) + "px" : 216 + "px"; + + cnvs.style.width = (zoom_mode) ? (288 * scale_factor) + "px" : 288 + "px"; + cnvs.style.height = (zoom_mode) ? (192 * scale_factor) + "px" : 192 + "px"; + cnvs.style.padding= (zoom_mode) ? (12 * scale_factor) + "px" : 12 + "px"; }; @@ -72,8 +71,6 @@ function toggle_2x_mode()
- Full and Split Page Cut/Fade modes are planned features still in development. -
All other modes are demonstrated exactly as implemented in Experimental 001b.


-

This JavaScript based player should work in most HTML5 compatible browsers supporting both the <canvas> and <audio> (note: "Sample Project" 01-04 are silent) tags, including many mobile and embedded devices. -
Double-click "screen area" to toggle 2x zoom mode (which may consume large amounts of CPU time on certain hardware/software configurations). -

It is, like the main application, licensed under the terms of the GNU GPL v2 (or later). -
(However, please do not hotlink the script from this site... COPY IT TO YOUR WEB SERVER!) -

Sync and timing accuracy, unfortunately, varies with that of the underlying browser implementation. -
Perfectly smooth scrolling is not implemented in this version for performance reasons, although block based scrolls work correctly. -

- "Flickr" by Jonathan Coulton used under Creative Commons Attribution-NonCommercial 3.0 Unported license. -

- "Heart on Redial" by Loveshadow used under Creative Commons Attribution 3.0 Unported license. -
- Loveshadow - Heart on Redial Complete Music and Images Credits and Licenses Table
- +