<html>
<head>
<title>Analogue Clock via Conic Gradient - RJM Programming - March, 2023</title>
<meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' >
<style>
#atend {
background-image: conic-gradient(rgba(255,0,0,0.5) 0deg, rgba(0,0,255,0.5) 30deg, rgba(0,255,0,0.5) 60deg, rgba(255,192,203,0.5) 90deg, rgba(0,0,139,0.5) 120deg, rgba(144,238,144,0.5) 150deg, rgba(255,165,0,0.5) 180deg, rgba(173,216,230,0.5) 210deg, rgba(2,48,32,0.5) 240deg, rgba(255,0,255,0.5) 270deg, rgba(0,100,100,0.5) 300deg, rgba(128,128,0,0.5) 330deg);
}
</style>
<script type='text/javascript'>
var opacity=location.search.split('opacity=')[1] ? decodeURIComponent(location.search.split('opacity=')[1].split('&')[0]) : "0.5";
var numerator=location.search.split('numerator=')[1] ? decodeURIComponent(location.search.split('numerator=')[1].split('&')[0]) : "0";
var denominator=location.search.split('denominator=')[1] ? decodeURIComponent(location.search.split('denominator=')[1].split('&')[0]) : "0";
var btoas=location.search.split('btis=')[1] ? atob(decodeURIComponent(location.search.split('btis=')[1].split('&')[0])) : "";
var collist=document.head.innerHTML.split('conic-gradient(')[1].split(');')[0].split(', ');
var newlist='', newlistr='', viadb=false, score=0, goes=0;
var eqmode=false;
var numeratortwo=numerator, denominatortwo=denominator;
var signs=['+','-','x','/'], isign=0, issvg=0; //false;
var gprefix='conic';
var fromprefix='border-radius: 612px;', toprefix="margin-top: 0px;";
var pwidth=602, pheight=602, pbr=612, ptop=17.3594, pleft=386.5, thirtytwo=32, ocbit=''; //position: absolute; left: 386.5px; top: 17.3594px; width: 602px; height: 602px; border-radius: 612px;
var worry=false;
var rotdeg=0.0, rotdegr=0.0;
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && btoas.trim() == '' && denominator == '0' && numerator == '0') {
ocbit=' onclick=" viadb=true; ask(); " ';
}
if (eval(eval('' + screen.width) - eval(eval('' + pbr) * 2)) < 0 && (btoas.trim() != '' || denominator != '0' || numerator != '0')) {
thirtytwo=Math.floor(eval(eval('' + thirtytwo) * Math.floor(eval(eval('' + screen.width) / 2.1)) / eval('' + pbr)));
ptop=eval(eval('' + ptop) * Math.floor(eval(eval('' + screen.width) / 2.1)) / eval('' + pbr));
pleft=eval(eval('' + pleft) * Math.floor(eval(eval('' + screen.width) / 2.1)) / eval('' + pbr));
pbr=Math.floor(eval(eval('' + screen.width) / 2.1));
fromprefix='border-radius: ' + pbr + 'px;'
pwidth=eval(-10 + pbr);
pheight=eval(-10 + pbr);
worry=true;
//alert('width,height,br,top,left=' + pwidth + ',' + pheight + ',' + pbr + ',' + ptop + ',' + pleft);
}
if (!String.fromCodePoint) { // thanks to http://xahlee.info/js/js_unicode_code_point.html
// ES6 Unicode Shims 0.1 , © 2012 Steven Levithan , MIT License
String.fromCodePoint = function fromCodePoint () {
var chars = [], point, offset, units, i;
for (i = 0; i < arguments.length; ++i) {
point = arguments[i];
offset = point - 0x10000;
units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point];
chars.push(String.fromCharCode.apply(null, units));
}
return chars.join("");
}
}
function moresigns() {
if (eval('' + signs.length) == 4) {
signs.push('%');
document.getElementById('ssign').innerHTML+='<option title="Modulo operator ... we allow decimal answers" value="%">%</option>';
signs.push('^');
document.getElementById('ssign').innerHTML+='<option title="Power of operator ... we allow decimal answers" value="^">^</option>';
}
}
function stopit(incsv) {
//alert(incsv);
// <stop offset='0%' stop-color='#f00'/><stop offset='100%' stop-color='#0ff'/>
var incsvs=incsv.split('%, ');
var outstops="<stop offset='0%' stop-color='" + incsvs[0].split(' ')[0] + "'/>";
for (var iis=1; iis<incsvs.length; iis++) {
outstops+="<stop offset='" + (incsvs[iis].split(' ')[1].trim() + "%").replace('%%','%') + "' stop-color='" + incsvs[iis].split(' ')[0] + "'/>";
}
//alert(outstops);
//document.getElementById('atend').title=outstops.replace(/255/g, '127');
return outstops.replace(/255/g, '127');
}
function emojiize(instq) {
return instq.replace(/\ \+\ /g, ' ' + String.fromCodePoint(10133) + ' ').replace(/\ \-\ /g, ' ' + String.fromCodePoint(10134) + ' ').replace(/\ \x\ /g, ' ' + String.fromCodePoint(10006) + ' ').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace('/', '' + String.fromCodePoint(10135) + '').replace(' fraction you wanted ', ' fraction (where you can substitute / for ' + String.fromCodePoint(10135) + ' below if you would prefer) you wanted ').replace(' you wanted is (', ' you wanted is ... ' + String.fromCharCode(10) + '(');
}
function degout(inval) {
//rotdeg+=eval('' + ('' + inval).replace('deg',''));
//rotdeg=eval(rotdeg % 360.0);
if (gprefix == 'conic' && issvg == 0) {
return ('' + inval).replace('deg','') + 'deg';
} else {
return '' + Math.round(eval(eval( eval(('' + inval).replace('deg','')) * 100.0) / 360.0)) + '%';
}
}
function eachsec() {
var inew=0, iangdeg=0.0, ii, iii;
if (document.getElementById('atend')) {
document.getElementById('atend').title='Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023 ... ' + ('' + new Date());
if (btoas.indexOf('/') != -1 && denominator == '0') {
numerator=btoas.split('/')[0];
denominator=btoas.split('/')[1];
numeratortwo=numerator;
denominatortwo=denominator;
document.getElementById('atend').style.position='relative';
document.getElementById('atend').style.top='0px';
document.getElementById('atend').style.left='0px';
document.getElementById('atright').style.top='0px';
//document.getElementById('myrtd').innerHTML='';
btoas=' ';
//} else if (btoas == '') {
//document.getElementById('myrtd').innerHTML='';
}
}
if (denominator.length == 1) {
if (opacity != '0.5' || denominator != '0') {
if (denominator != '0') {
rotdeg=eval(Math.floor(eval(360.0 * numerator / denominator)) % 360);
newlist=collist[0].split(' ')[0].replace(',0.5', ',1.0') + ' ' + degout('0deg');
for (ii=1; ii<eval('' + denominator); ii++) {
if (eval('' + ii) < eval('' + numerator)) {
newlist+=', ' + collist[eval(ii % 2)].split(' ')[0].replace(',0.5', ',1.0') + ' ' + degout('' + eval(ii * 360.0 / eval('' + denominator)) + 'deg');
} else {
newlist+=', rgba(250,250,250,1.0) ' + degout('' + eval(ii * 360.0 / eval('' + denominator)) + 'deg');
}
}
for (iii=eval('' + denominator); iii<eval('' + collist.length); iii++) {
if (eval(iii * 360.0 / eval('' + denominator)) < 360) {
newlist+=', rgba(250,250,250,1.0) ' + degout('' + eval(iii * 360.0 / eval('' + denominator)) + 'deg');
}
}
//alert(numeratortwo);
//alert(denominatortwo);
rotdegr=eval(Math.floor(eval(360.0 * numeratortwo / denominatortwo)) % 360);
newlistr=collist[0].split(' ')[0].replace(',0.5', ',1.0') + ' ' + degout('0deg');
for (ii=1; ii<eval('' + denominatortwo); ii++) {
if (eval('' + ii) < eval('' + numeratortwo)) {
newlistr+=', ' + collist[eval(ii % 2)].split(' ')[0].replace(',0.5', ',1.0') + ' ' + degout('' + eval(ii * 360.0 / eval('' + denominatortwo)) + 'deg');
} else {
newlistr+=', rgba(250,250,250,1.0) ' + degout('' + eval(ii * 360.0 / eval('' + denominatortwo)) + 'deg');
}
}
for (iii=eval('' + denominatortwo); iii<eval('' + collist.length); iii++) {
if (eval(iii * 360.0 / eval('' + denominatortwo)) < 360) {
newlistr+=', rgba(250,250,250,1.0) ' + degout('' + eval(iii * 360.0 / eval('' + denominatortwo)) + 'deg');
}
}
//alert('<style>' + ' #atend { background: ' + gprefix + '-gradient(' + newlist + '); } </style>');
if (issvg > 0) {
var mySVG = "<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><linearGradient id='gradient'><stop offset='10%' stop-color='#F00'/><stop offset='90%' stop-color='#fcc'/> </linearGradient><rect fill='url(#gradient)' x='0' y='0' width='100%' height='100%'/></svg>";
if (issvg == 1) {
mySVG="<svg xmlns='http://www.w3.org/2000/svg' width='" + pwidth + "' height='" + pheight + "' viewport='0 0 100 100'><linearGradient id='test'>" + stopit(newlist) + " </linearGradient><circle fill='url(#test)' cx='" + eval(pwidth / 2) + "' cy='" + eval(pheight / 2) + "' r='" + eval(pwidth / 2) + "' stroke='none' stroke-width='12'/></svg>"; //.replace(/\~/g, String.fromCharCode(10));
} else if (issvg == 2) {
rotdeg=0;
mySVG="<svg xmlns='http://www.w3.org/2000/svg' width='" + pwidth + "' height='" + pheight + "' viewport='0 0 100 100'><linearGradient id='test'>" + stopit(newlist) + " </linearGradient><rect fill='url(#test)' width='" + eval(pwidth / 1) + "' height='" + eval(pheight / 1) + "' stroke='none' stroke-width='12'/></svg>"; //.replace(/\~/g, String.fromCharCode(10));
}
document.getElementById('atend').innerHTML=mySVG;
if (issvg == 1) {
mySVG="<svg xmlns='http://www.w3.org/2000/svg' width='" + pwidth + "' height='" + pheight + "' viewport='0 0 100 100'><linearGradient id='testr'>" + stopit(newlistr) + " </linearGradient><circle fill='url(#testr)' cx='" + eval(pwidth / 2) + "' cy='" + eval(pheight / 2) + "' r='" + eval(pwidth / 2) + "' stroke='none' stroke-width='12'/></svg>"; //.replace(/\~/g, String.fromCharCode(10));
} else if (issvg == 2) {
rotdegr=0;
mySVG="<svg xmlns='http://www.w3.org/2000/svg' width='" + pwidth + "' height='" + pheight + "' viewport='0 0 100 100'><linearGradient id='testr'>" + stopit(newlistr) + " </linearGradient><rect fill='url(#testr)' width='" + eval(pwidth / 1) + "' height='" + eval(pheight / 1) + "' stroke='none' stroke-width='12'/></svg>"; //.replace(/\~/g, String.fromCharCode(10));
}
document.getElementById('atright').innerHTML=mySVG;
document.getElementById('dstyle').innerHTML+='<style>' + ' #atend { background-image: none !important; transform: rotate(' + rotdeg + 'deg); } </style>';
document.getElementById('dstyle').innerHTML+='<style>' + ' #atright { background-image: none !important; transform: rotate(' + rotdegr + 'deg); } </style>';
} else {
document.getElementById('atend').innerHTML='';
document.getElementById('atright').innerHTML='';
document.getElementById('dstyle').innerHTML+='<style>' + ' #atend { background-image: ' + gprefix.toLowerCase() + '-gradient(' + newlist + ') !important; } </style>';
document.getElementById('dstyle').innerHTML+='<style>' + ' #atright { background-image: ' + gprefix.toLowerCase() + '-gradient(' + newlistr + ') !important; } </style>';
}
denominator='0' + denominator;
setTimeout(ask, 5000);
} else {
document.getElementById('dstyle').innerHTML='<style>' + document.head.innerHTML.split('<style>')[1].split('</style>')[0].replace(/\,0.5\)/g, ',' + opacity + ')') + '</style>';
}
opacity='0.5';
}
}
}
function lcdextra(varn, vard) {
var retv='', iv=0;
for (iv=Math.min(Math.abs(varn),Math.abs(vard)); iv>=2; iv--) {
if (eval(Math.abs(varn) % iv) == 0 && eval(Math.abs(vard) % iv) == 0) {
varn /= iv;
vard /= iv;
retv+=' = ' + varn + ' / ' + vard + String.fromCharCode(10);
}
}
return retv;
}
function showworking(instr, realans) {
var outstr=instr;
var xnumerator=numerator, xnumeratortwo=numeratortwo, xdenominatortwo=denominatortwo, iv=0, varn=0, vard=eval('' + denominatortwo);
var varw='';
var myrealans=' = ' + realans;
if (document.getElementById('ssign').value == '+') {
if (denominatortwo == denominator.slice(-1)) {
varw+=' = (' + numerator + ' + ' + numeratortwo + ') / ' + denominatortwo + String.fromCharCode(10);
varw+=' = ' + eval(eval('' + numerator) + eval('' + numeratortwo)) + ' / ' + xdenominatortwo + String.fromCharCode(10);
varw+=lcdextra(eval(eval('' + numerator) + eval('' + numeratortwo)), eval('' + xdenominatortwo));
} else {
varw+=' = (' + numerator + ' x ' + denominatortwo + ' + ' + numeratortwo + ' x ' + denominator.slice(-1) + ') / (' + denominator.slice(-1) + ' x ' + denominatortwo + ')' + String.fromCharCode(10);
xnumerator*=denominatortwo;
xnumeratortwo*=eval('' + denominator.slice(-1));
xdenominatortwo*=eval('' + denominator.slice(-1));
varw+=' = (' + xnumerator + ' + ' + xnumeratortwo + ') / ' + xdenominatortwo + String.fromCharCode(10);
varw+=' = ' + eval(eval('' + xnumerator) + eval('' + xnumeratortwo)) + ' / ' + xdenominatortwo + String.fromCharCode(10);
varw+=lcdextra(eval(eval('' + xnumerator) + eval('' + xnumeratortwo)), eval('' + xdenominatortwo));
}
} else if (document.getElementById('ssign').value == '-') {
if (denominatortwo == denominator.slice(-1)) {
varw+=' = (' + numerator + ' - ' + numeratortwo + ') / ' + denominatortwo + String.fromCharCode(10);
varw+=' = ' + eval(numerator - numeratortwo) + ' / ' + xdenominatortwo + String.fromCharCode(10);
varw+=lcdextra(eval(numerator - numeratortwo), eval('' + xdenominatortwo));
} else {
varw+=' = (' + numerator + ' x ' + denominatortwo + ' - ' + numeratortwo + ' x ' + denominator.slice(-1) + ') / (' + denominator.slice(-1) + ' x ' + denominatortwo + ')' + String.fromCharCode(10);
xnumerator*=denominatortwo;
xnumeratortwo*=eval('' + denominator.slice(-1));
xdenominatortwo*=eval('' + denominator.slice(-1));
varw+=' = (' + xnumerator + ' - ' + xnumeratortwo + ') / ' + xdenominatortwo + String.fromCharCode(10);
varw+=' = ' + eval(eval('' + xnumerator) - eval('' + xnumeratortwo)) + ' / ' + xdenominatortwo + String.fromCharCode(10);
varw+=lcdextra(eval(eval('' + xnumerator) - eval('' + xnumeratortwo)), eval('' + xdenominatortwo));
}
} else if (document.getElementById('ssign').value == '/') {
varw+=' = (' + numerator + ' / ' + denominator.slice(-1) + ') x (' + denominatortwo + ' / ' + numeratortwo + ')' + String.fromCharCode(10);
varw+=' = ' + eval(eval('' + numerator) * eval('' + denominatortwo)) + ' / ' + eval(eval('' + denominator.slice(-1)) * eval('' + numeratortwo)) + String.fromCharCode(10);
varw+=lcdextra(eval(eval('' + numerator) * eval('' + denominatortwo)), eval(eval('' + denominator.slice(-1)) * eval('' + numeratortwo)));
} else if (document.getElementById('ssign').value == 'x' || document.getElementById('ssign').value == '*') {
varw+=' = (' + numerator + ' / ' + denominator.slice(-1) + ') x (' + numeratortwo + ' / ' + denominatortwo + ')' + String.fromCharCode(10);
varw+=' = ' + eval(eval('' + numerator) * eval('' + numeratortwo)) + ' / ' + eval(eval('' + denominator.slice(-1)) * eval('' + denominatortwo)) + String.fromCharCode(10);
varw+=lcdextra(eval(eval('' + numerator) * eval('' + numeratortwo)), eval(eval('' + denominator.slice(-1)) * eval('' + denominatortwo)));
} else if (document.getElementById('ssign').value == '%') {
varw+=' = (' + numerator + ' / ' + denominator.slice(-1) + ') % (' + numeratortwo + ' / ' + denominatortwo + ')' + String.fromCharCode(10);
varw+=' = ' + eval('(' + numerator + ' / ' + denominator.slice(-1) + ') % (' + numeratortwo + ' / ' + denominatortwo + ')');
myrealans='';
} else if (document.getElementById('ssign').value == '^') {
varw+=' = (' + numerator + ' / ' + denominator.slice(-1) + ') ^ (' + numeratortwo + ' / ' + denominatortwo + ')' + String.fromCharCode(10);
// alert('' + eval('(' + numerator + ' / ' + denominator.slice(-1) + ')') + ' to the power of ' + eval('(' + numeratortwo + ' / ' + denominatortwo + ')') + ' is ' + Math.pow(eval('(' + numerator + ' / ' + denominator.slice(-1) + ')'), eval('(' + numeratortwo + ' / ' + denominatortwo + ')')));
varw+=' = ' + Math.pow(eval('(' + numerator + ' / ' + denominator.slice(-1) + ')'), eval('(' + numeratortwo + ' / ' + denominatortwo + ')'));
myrealans='';
}
if (('' + myrealans).indexOf('.') == -1 && myrealans != '') { myrealans='' + myrealans + '.0'; }
return emojiize(outstr + String.fromCharCode(10) + varw + myrealans + ' ' + String.fromCharCode(10));
}
function oureval(ineq) {
var ineqs=ineq.split('^');
if (eval('' + ineqs.length) >= 2) {
return Math.pow(eval(ineqs[0].replace('((','(')), eval(eval(ineqs[1].replace('))',')'))));
}
return eval(ineq);
}
function ask() {
//if (!document.getElementById('ssign')) { setTimeout(ask, 1000); return ''; }
var ans='', sufans=' Enter + to solve fractional equations (+-x/) or ++ to solve (+-x/%^). Enter @ to toggle among conic and linear and radial gradient and SVG circle and rectangle display. Enter nothing with OK will reshow "cake".';
rotdeg=0.0;
if (eqmode) { sufans=' Enter - to just solve leftmost fractional question. Enter @ to toggle among conic and linear and radial gradient and SVG circle and rectangle display. Enter nothing with OK will reshow "cake".'; }
if (!viadb) {
while (('' + ans).indexOf('/') == -1 && ('' + ans).replace(/^1$/g, '1.0').replace(/^2$/g, '2.0').replace(/^0$/g, '0.0').indexOf('.') == -1) {
if (eqmode) {
ans=prompt('What fraction of the "cake" is coloured (for ' + document.getElementById('ssign').value + ' equation)? (eg. 2/3)' + sufans, '');
} else {
ans=prompt('What fraction of the "cake" is coloured? (eg. 2/3)' + sufans, '');
}
if (ans == null) { ans=''; location.href=document.URL.split('?')[0].split('#')[0]; return ''; }
if (('' + ans).trim().substring(0,1) == '+') { if (('' + ans).indexOf('++') != -1) { moresigns(); } eqmode=true; sufans=' Enter - to just solve leftmost fractional question. Enter @ to toggle among conic and linear and radial gradient and SVG circle and rectangle display.'; document.getElementById('myrtd').style.display='table-cell'; document.getElementById('mymtd').style.display='table-cell'; isign=eval(0 + Math.floor(Math.random() * signs.length)); document.getElementById('ssign').value=signs[isign]; setTimeout(ask,2000); return ''; }
if (('' + ans).trim() == '-') { eqmode=false; sufans=' Enter + to solve fractional equations. Enter @ to toggle among conic and linear and radial gradient and SVG circle and rectangle display.'; document.getElementById('myrtd').style.display='none'; document.getElementById('mymtd').style.display='none'; setTimeout(ask,2000); return ''; }
if (('' + ans).trim().substring(0,1) == '@') {
while (('' + ans).trim().substring(0,1) == '@') {
if (gprefix == 'conic') {
issvg=0;
gprefix='linear'; fromprefix='border-radius: ' + pbr + 'px;', toprefix="margin-top: 0px;";
} else if (gprefix == 'linear') {
issvg=0;
gprefix='radial'; toprefix='border-radius: ' + pbr + 'px;', fromprefix="margin-top: 0px;";
} else if (gprefix == 'radial') {
gprefix='Conic';
issvg=1;
} else if (gprefix == 'Conic') {
gprefix='CONIC';
issvg=2;
} else {
issvg=0;
gprefix='conic'; toprefix='border-radius: ' + pbr + 'px;', fromprefix="margin-top: 0px;";
}
ans=ans.replace('@','');
}
document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(fromprefix, toprefix).replace(fromprefix, toprefix);
document.getElementById('myrtd').innerHTML=document.getElementById('myrtd').innerHTML.replace(fromprefix, toprefix);
document.getElementById('mytd').innerHTML=document.getElementById('mytd').innerHTML.replace(fromprefix, toprefix);
//alert('out of here with gprefix=' + gprefix + ' and issvg=' + issvg);
opacity='0.9';
denominator=denominator.slice(-1);
if (1 == 2) { setTimeout(ask, 4000); }
return '';
}
if (('' + ans).indexOf('/') == -1 && ('' + ans).replace(/^1$/g, '1.0').replace(/^2$/g, '2.0').replace(/^0$/g, '0.0').indexOf('.') == -1) {
setTimeout(ask, 3000);
return '';
}
}
if (eqmode) {
if (ans.replace(/\ /g,'').replace(/x/g,'*') == ('' + numerator + '/' + denominator.substring(1) + document.getElementById('ssign').value.replace('x','*') + numeratortwo + '/' + denominatortwo).replace(/\ /g,'').replace(/x/g,'*') || Math.abs(eval('(' + numerator + '/' + denominator.substring(1) + ') ' + document.getElementById('ssign').value.replace('x','*') + ' (' + numeratortwo + '/' + denominatortwo + ')') - oureval(('' + ans).replace(/x/g, '*'))) < 0.005) {
score++;
goes++;
alert('Well done! This makes your Fractions Game score to be ' + score + ' of ' + goes);
} else {
goes++;
alert(showworking('Sorry ... the fraction you wanted is ' + '(' + numerator + '/' + denominator.substring(1) + ') ' + document.getElementById('ssign').value.replace('xJUNKx','*') + ' (' + numeratortwo + '/' + denominatortwo + ')', eval('(' + numerator + '/' + denominator.substring(1) + ') ' + document.getElementById('ssign').value.replace('x','*') + ' (' + numeratortwo + '/' + denominatortwo + ')')) + ' leaving your Fractions Game score as ' + score + ' of ' + goes);
}
} else {
if (ans == '' + numerator + '/' + denominator.substring(1) || Math.abs(eval('' + numerator + '/' + denominator.substring(1)) - oureval(('' + ans).replace(/x/g, '*'))) < 0.005) {
score++;
goes++;
alert('Well done! This makes your Fractions Game score to be ' + score + ' of ' + goes);
} else {
goes++;
alert('Sorry ... the fraction you wanted is ' + numerator + '/' + denominator.substring(1) + ' leaving your Fractions Game score as ' + score + ' of ' + goes);
}
}
}
isign=eval(0 + Math.floor(Math.random() * signs.length));
document.getElementById('ssign').value=signs[isign];
numeratortwo='' + eval(1 + Math.floor(Math.random() * 7));
denominatortwo='0';
while (eval('' + denominatortwo) < eval('' + numeratortwo)) {
denominatortwo='' + eval(0 + Math.floor(Math.random() * 9));
}
numerator='' + eval(1 + Math.floor(Math.random() * 7));
denominator='0';
while (eval('' + denominator) < eval('' + numerator)) {
denominator='' + eval(0 + Math.floor(Math.random() * 9));
}
if (viadb) {
if (btoas == '') {
location.href=document.URL.split('?')[0].split('#')[0] + '?btis=' + encodeURIComponent(btoa('' + numerator + '/' + denominator));
} else {
location.href=document.URL.split('?')[0].split('#')[0]; // + '?btis=' + encodeURIComponent(btoa('' + numerator + '/' + denominator));
}
}
viadb=false;
}
function onl() {
var mySVG = "<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><linearGradient id='gradient'><stop offset='10%' stop-color='#F00'/><stop offset='90%' stop-color='#fcc'/> </linearGradient><rect fill='url(#gradient)' x='0' y='0' width='100%' height='100%'/></svg>";
mySVG = "<svg xmlns='http://www.w3.org/2000/svg' width='500' height='500'><linearGradient id='test'><stop offset='0%' stop-color=''#f00'/><stop offset='100%' stop-color='#0ff'/> </linearGradient><circle fill='url(#test)' cx='50' cy='50' r='40' fill='none' stroke-width='6'/></svg>"; //.replace(/\~/g, String.fromCharCode(10));
var mySVG64 = window.btoa(mySVG);
prompt(mySVG64, mySVG64);
//document.getElementById('mydiv').style.backgroundImage = "url('data:image/svg+xml;base64," + mySVG64 + "')";
document.body.innerHTML+='<div style="width:500px; height:500px; display: block; background-image: ' + "url('data:image/svg+xml;base64," + mySVG64 + "');" + '"' + "></div>";
document.getElementById('premydiv').innerHTML=mySVG;
}
setInterval(eachsec, 1000);
</script>
</head>
<body>
<script type='text/javascript'>
document.write('<table id=mytable><tbody id=mytbody><tr id=mytr><td id=mytd>');
if (denominator == '0' && btoas == '') {
if (worry) {
document.write('<div' + ocbit + ' ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atend" style="position: absolute; left: ' + pleft + 'px; top: ' + ptop + 'px; width: ' + pwidth + 'px; height: ' + pheight + 'px; border-radius: ' + pbr + 'px; ">');
} else {
document.write('<div' + ocbit + ' ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atend" style="position: absolute; left: 386.5px; top: 17.3594px; width: 602px; height: 602px; border-radius: 612px; ">');
}
document.write('<iframe scrolling="no" frameborder="0" style="z-index:23;margin-left:127px;margin-top:130px;height:400px;" src="analogue_clock.htm?backcol=transparent&x=7654#xbody"></iframe>');
} else {
if (worry) {
document.write('<div' + ocbit + ' ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atend" style="width: ' + pwidth + 'px; height: ' + pheight + 'px; border-radius: ' + pbr + 'px; ">');
} else {
document.write('<div' + ocbit + ' ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atend" style="width: 602px; height: 602px; border-radius: 612px; ">');
}
}
if (worry) {
document.write('</div></td><td id=mymtd style=display:none;vertical-align:middle;> <select id=ssign style=font-size:' + thirtytwo + 'px;background-color:yellow; readonly disable><option value="+">➕</option><option value="-">➖</option><option value="x">✖</option><option value="/">➗</option></select></td><td id=myrtd style=display:none;> <div ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atright" style="width: ' + pwidth + 'px; height: ' + pheight + 'px; border-radius: ' + pbr + 'px; "></div></td></tr></tbody></table>');
} else {
document.write('</div></td><td id=mymtd style=display:none;vertical-align:middle;> <select id=ssign style=font-size:' + thirtytwo + 'px;background-color:yellow; readonly disable><option value="+">➕</option><option value="-">➖</option><option value="x">✖</option><option value="/">➗</option></select></td><td id=myrtd style=display:none;> <div ondblclick=" viadb=true; ask(); " title="Analogue Clock via Conic Gradient or Double Click for Fractions Game toggle - RJM Programming - March, 2023" id="atright" style="width: 602px; height: 602px; border-radius: 612px; "></div></td></tr></tbody></table>');
}
</script>
<div id=dstyle></div>
</body>
</html>