I have recreated a JavaScript version here
https://iwant2study.org/ospsg/index.php/656