User:Lieven Van Speybroeck/Other/Speelplaats: Difference between revisions
(Created page with "[http://www.wesleywolkman.com/speelplaats/speeltijd.html Twelve Days A Week Clock]") |
No edit summary |
||
Line 1: | Line 1: | ||
[http://www.wesleywolkman.com/speelplaats/speeltijd.html | =Speeltijd: A 12/7 Time System= | ||
This clock was developed as an alternative timesystem for the Speelplaats project at Werkplaats Typografie, Arnhem. Speeltime runs 12/7 faster than global time, resulting in weeks with 12 days. Check out the Speelplaats time [http://www.wesleywolkman.com/speelplaats/speeltijd.html here] | |||
===code (javascript)=== | |||
<source lang="javascript"> | |||
<script language="javascript"> | |||
len=40; | |||
tid = 0; | |||
num=0; | |||
speeltijd=((1000/12)*7) | |||
clockA = new Array(); | |||
timeA = new Array(); | |||
formatA = new Array(); | |||
dd = new Date(); | |||
var d,x; | |||
days = new Array("Firstday","Secondday","Thirdday","Fourthday","Fifthday","Sixthday","Seventhday","Eighthday","Ninthday","Tenthday","Eleventhday","Twelfthday"); | |||
function doDate(x) | |||
{ | |||
for (i=0;i<num;i++) { | |||
dt = new Date(); | |||
if (timeA[i] != 0) { | |||
v1 = Math.round(( dt - timeA[i] )/speeltijd) ; | |||
if (formatA[i] ==1) { | |||
sec = v1%60; | |||
v1 = Math.floor(v1/60); | |||
min = v1 %60 ; | |||
v1 = Math.floor(v1/60); | |||
hour = v1 %24 ; | |||
day = Math.floor(v1/24)%12; | |||
if (sec < 10 ) sec = "0"+sec; | |||
if (min < 10 ) min = "0"+min; | |||
if (hour < 10 ) hour = "0"+hour; | |||
document.speelclock.speeldag.value = days[day]; | |||
document.speelclock.speeltijd.value = hour+" : "+min+" : "+sec; | |||
} | |||
} | |||
} | |||
tid=window.setTimeout("doDate()",speeltijd); | |||
} | |||
function start(d,x,format) { | |||
clockA[num] = x | |||
if (d == "now") | |||
timeA[num] = new Date(); | |||
else | |||
timeA[num] = new Date(d); | |||
formatA[num] = format; | |||
//window.alert(timeA[num]+":"+d); | |||
if (num == 0) | |||
tid=window.setTimeout("doDate()",speeltijd); | |||
num++; | |||
} | |||
function CountupLong(t,format,len) | |||
{ | |||
start(t,document.forms["form"+num],format); | |||
} | |||
function Countup(t) | |||
{ | |||
CountupLong(t,1,100); | |||
} | |||
</script> | |||
</source> |
Revision as of 14:35, 20 February 2011
Speeltijd: A 12/7 Time System
This clock was developed as an alternative timesystem for the Speelplaats project at Werkplaats Typografie, Arnhem. Speeltime runs 12/7 faster than global time, resulting in weeks with 12 days. Check out the Speelplaats time here
code (javascript)
<script language="javascript">
len=40;
tid = 0;
num=0;
speeltijd=((1000/12)*7)
clockA = new Array();
timeA = new Array();
formatA = new Array();
dd = new Date();
var d,x;
days = new Array("Firstday","Secondday","Thirdday","Fourthday","Fifthday","Sixthday","Seventhday","Eighthday","Ninthday","Tenthday","Eleventhday","Twelfthday");
function doDate(x)
{
for (i=0;i<num;i++) {
dt = new Date();
if (timeA[i] != 0) {
v1 = Math.round(( dt - timeA[i] )/speeltijd) ;
if (formatA[i] ==1) {
sec = v1%60;
v1 = Math.floor(v1/60);
min = v1 %60 ;
v1 = Math.floor(v1/60);
hour = v1 %24 ;
day = Math.floor(v1/24)%12;
if (sec < 10 ) sec = "0"+sec;
if (min < 10 ) min = "0"+min;
if (hour < 10 ) hour = "0"+hour;
document.speelclock.speeldag.value = days[day];
document.speelclock.speeltijd.value = hour+" : "+min+" : "+sec;
}
}
}
tid=window.setTimeout("doDate()",speeltijd);
}
function start(d,x,format) {
clockA[num] = x
if (d == "now")
timeA[num] = new Date();
else
timeA[num] = new Date(d);
formatA[num] = format;
//window.alert(timeA[num]+":"+d);
if (num == 0)
tid=window.setTimeout("doDate()",speeltijd);
num++;
}
function CountupLong(t,format,len)
{
start(t,document.forms["form"+num],format);
}
function Countup(t)
{
CountupLong(t,1,100);
}
</script>