<!doctype html>
<html>
<head>
<title>Generic Swinger - RJM Programming - September, 2016 - Thanks to http://marylandlearninglinks.org/wp-content/themes/learning-links/img/compass-needle.png via calls like http://www.rjmprogramming.com.au/HTMLCSS/generic_swinger.html?image=http%3A%2F%2Fwww.rjmprogramming.com.au%2FHTMLCSS%2Flead.png&blurb=You%20are%20getting%20mindful%20...&pendulum=y</title>
<style>
.hourhand { width: 350px; height: 350px; }
.minutehand { width: 350px; height: 350px; }
.secondhand { width: 350px; height: 350px; }
#compass_needle { width: 350px; height: 175px; overflow:hidden; border: 0px solid red; }
#compass_needles { width: 350px; height: 175px; overflow:hidden; border: 0px solid pink; }
#compass_needlem { width: 350px; height: 175px; overflow:hidden; border: 0px solid blue; }
</style>
<script type='text/javascript'>
var imageis=location.search.split('image=')[1] ? decodeURIComponent(location.search.split('image=')[1]).split('&')[0] : 'http://marylandlearninglinks.org/wp-content/themes/learning-links/img/compass-needle.png';
var blurb=location.search.split('blurb=')[1] ? decodeURIComponent(location.search.split('blurb=')[1]).split('&')[0] : '';
var pendulum=location.search.split('pendulum=')[1] ? decodeURIComponent(location.search.split('pendulum=')[1]).split('&')[0] : '';
var two=location.search.split('two=')[1] ? decodeURIComponent(location.search.split('two=')[1]).split('&')[0] : 2;
var defwidth=350.0;
var brg=60;
var brgm=40;
var brgs=20;
var nowbw;
var nowbh;
var tzo=-999;
var tzname='youllneverfindthis';
var mappings=[];
var toggle=0;
function pendulum_mapping() {
var i;
for (i=45; i<=135; i++) {
mappings[i]=eval(270 - eval(i));
}
for (i=225; i<=315; i++) {
mappings[i]=eval(450 - eval(i));
}
for (i=315; i<=360; i++) { //305 to 135 306 to 136
mappings[i]=eval(eval(i) - 180);
}
for (i=0; i<=45; i++) {
mappings[i]=eval(180 + eval(i));
}
}
function map(inb) {
var i;
if (mappings.length == 0) {
for (i=0; i<=360; i++) {
mappings[i]=eval(i);
}
if (pendulum != '') pendulum_mapping();
}
if (mappings.length == 0) {
return Math.round(eval(inb));
}
return mappings[Math.round(eval(inb))];
}
function definewh() {
nowbw = defwidth; //350
nowbh = eval(defwidth / 2.0); //175;
}
function getgmt() {
var tbits,lastone=0.0;
var nutcDate, zone=0; //document.getElementById('mysel').value;
var ndt = new Date();
if (zone == 'Local') {
nutcDate = ndt.toLocaleDateString() + ' ' + ndt.toLocaleTimeString();
} else if (zone == 'GMT') {
nutcDate = ndt.toUTCString();
} else {
ndt.setHours(ndt.getHours() - eval(tzo) + eval(zone));
nutcDate = ndt.toLocaleDateString() + ' ' + ndt.toLocaleTimeString().replace(tzname,'');
}
if (tzo == -999) {
tbits=ndt.toLocaleTimeString().split(' ');
tzo = eval(-1.0 * ndt.getTimezoneOffset() / 60.0);
tzname=tbits[eval(-1 + tbits.length)];
//document.getElementById('mysel').innerHTML+="<option value='" + tzo + "'>" + tzname + '</option>';
//for (var tz=-12.0; tz<=12.0; tz+=0.5) {
// document.getElementById('mysel').innerHTML+="<option value='" + tz + "'" + (">+" + tz).replace('+-','-') + ' hours</option>';
//}
}
var bits=nutcDate.split(':'), ibits=0, prebits, plus=0.0;
var ghands=["", "m", "s"];
var xhands=[30.0, 6.0, 6.0];
for (var j=eval(-1 + bits.length); j>=0; j--) {
prebits=bits[j].split(' ');
if (ibits == 0) {
eval("brg" + ghands[j] + "=" + eval(prebits[0] * xhands[j]));
//alert("brg" + ghands[j] + "=" + eval(prebits[0] * xhands[j]));
plus=eval(prebits[0] / 60.0);
//document.title=plus;
} else {
eval("brg" + ghands[j] + "=" + eval(eval(plus) + eval(prebits[eval(-1 + prebits.length)] * xhands[j])));
lastone=eval(prebits[eval(-1 + prebits.length)]);
//alert("brg" + ghands[j] + "=" + eval(prebits[eval(-1 + prebits.length)] * xhands[j]));
//plus /= 60.0;
plus = eval(eval(prebits[eval(-1 + prebits.length)] / 60.0) + eval(plus / 60.0));
//document.title+=' ... ' + plus;
}
ibits=1;
}
if (blurb != '') {
document.getElementById('hstuff').style.display='none';
if (eval(toggle % 4) != 0) {
nutcDate='';
} else {
nutcDate=' ' + blurb.replace(' mindful ',' <a target=_blank title="Mindfulness blog postings" href="http://www.rjmprogramming.com.au/ITblog/tag/mindfulness">mindful</a> ');
}
toggle++;
}
document.getElementById('huh').innerHTML=nutcDate;
}
function onl() {
var tx="50%";
var ty="100%";
var stx=1.0, sty=1.0;
var hands=["", "m", "s"];
var shands=[0.9, 1.0, 0.95];
var ourbrg=0.0;
getgmt();
for (var ii=0; ii<two; ii++) {
document.getElementById('compass_needle' + hands[ii]).style.display='none';
}
for (var i=two; i<hands.length; i++) {
ourbrg=eval("brg" + hands[i]);
stx=shands[i];
sty=shands[i];
try { document.getElementById('compass_needle' + hands[i]).style.webkitTransformOrigin = tx + " " + ty + " 0"; } catch(e10) { } //
try { document.getElementById('compass_needle' + hands[i]).style.MozTransformOrigin = tx + " " + ty + " 0"; } catch(e1000) { }
try { document.getElementById('compass_needle' + hands[i]).style.msTransformOrigin = tx + " " + ty + " 0"; } catch(e100) { }
try { document.getElementById('compass_needle' + hands[i]).style.OTransformOrigin = tx + " " + ty + " 0"; } catch(e10000) { }
try { document.getElementById('compass_needle' + hands[i]).style.transformOrigin = tx + " " + ty + " 0"; } catch(e1) { }
try { document.getElementById('compass_needle' + hands[i]).style.webkitTransform = (" rotate(" + map(ourbrg) + "deg)"); } catch(e10) { } //translate(" + tx + "," + ty + "); "); } catch(e10) { } //
try { document.getElementById('compass_needle' + hands[i]).style.MozTransform = (" rotate(" + map(ourbrg) + "deg)"); } catch(e10) { } //translate(" + tx + "," + ty + "); "); } catch(e1000) { }
try { document.getElementById('compass_needle' + hands[i]).style.msTransform = (" rotate(" + map(ourbrg) + "deg)"); } catch(e10) { } //translate(" + tx + "," + ty + "); "); } catch(e100) { }
try { document.getElementById('compass_needle' + hands[i]).style.OTransform = (" rotate(" + map(ourbrg) + "deg)"); } catch(e10) { } //translate(" + tx + "," + ty + "); "); } catch(e10000) { }
try { document.getElementById('compass_needle' + hands[i]).style.transform = (" rotate(" + map(ourbrg) + "deg)"); } catch(e10) { } //translate(" + tx + "," + ty + "); "); } catch(e1) { }
try { document.getElementById('compass_needle' + hands[i]).style.webkitTransform += (" scale(" + stx + "," + sty + ")"); } catch(e10) { }
try { document.getElementById('compass_needle' + hands[i]).style.MozTransform += (" scale(" + stx + "," + sty + ")"); } catch(e10) { }
try { document.getElementById('compass_needle' + hands[i]).style.msTransform += (" scale(" + stx + "," + sty + ")"); } catch(e10) { }
try { document.getElementById('compass_needle' + hands[i]).style.OTransform += (" scale(" + stx + "," + sty + ")"); } catch(e10) { }
try { document.getElementById('compass_needle' + hands[i]).style.transform += (" scale(" + stx + "," + sty + ")"); } catch(e10) { }
//if (i == 1) document.title=document.getElementById('compass_needle' + hands[i]).style.MozTransform;
}
setTimeout(onl,1000);
}
</script>
</head>
<body id='xbody' onload="onl();" style='background-color: lightblue;'>
<script type='text/javascript'>
document.write("<div id='compass_needle' style='position:absolute; z-index: 6; top:0; left: 0;'><img style='position: relative; opacity:0.75; z-index: 6;' onload='definewh();' class='hourhand' id='compassneedle' src='" + imageis + "' title='Thanks to http://marylandlearninglinks.org/wp-content/themes/learning-links/img/compass-needle.png'></img></div><div id='compass_needlem' style='position:absolute; z-index: 6; top:0; left: 0;'><img style='position: relative; opacity:0.75; z-index: 6;' onload='definewh();' class='minutehand' id='compassneedlem' src='" + imageis + "' title='Thanks to http://marylandlearninglinks.org/wp-content/themes/learning-links/img/compass-needle.png'></img></div><div id='compass_needles' style='position:absolute; z-index: 6; top:0; left: 0;'><img style='position: relative; opacity:0.75; z-index: 6;' onload='definewh();' class='secondhand' id='compassneedles' src='" + imageis + "' title='Thanks to http://marylandlearninglinks.org/wp-content/themes/learning-links/img/compass-needle.png'></img></div><p id='huh'></p><div id='hstuff'><h1 style='width=100%; text-align: center;'>Our Generic Swinger</h1><h3 style='width=100%; text-align: center;'>RJM Programming - September, 2016</h3></div>");
</script>
</body>
</html>