CubeScribe Wiki
Render Rubiks Cube OLL and PLL Algorithm Diagrams with HTML5 & JS
Brought to you by:
fvanhoof
The formatAlgorithm is a function that adds the HTML markup to the various
parts of the algorithm to emphasize primes and double moves. This function
also requires each of the styles marked in the HTML as classes
and are defined in the CSS as class selectors.
formatAlgorithm(algorithm)
algorithm
A string containing the algorithm. Make sure single quotes are
escaped.
.prime { color:red; }
In the JavaScript call the formatAlgorithm function to get a string containing CSS formatted HTML.
document.getElementById("ePermAlg").innerHTML=pageCube.formatAlgorithm("R2UR\'y(U\'R\'U)3 Y\'RU\'R2");