Initial commit

This commit is contained in:
Markus Birth 2013-07-11 22:58:46 +02:00
commit 88d43407f9
20 changed files with 38263 additions and 0 deletions

BIN
NotCourierSans-Bold.otf Normal file

Binary file not shown.

BIN
NotCourierSans.otf Normal file

Binary file not shown.

BIN
brushedmetal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

131
index.html Normal file
View File

@ -0,0 +1,131 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
QLOCKTWO
after the original QlockTwo at http://qlocktwo.com/
This page was written by Markus Birth <markus@birth-online.de>
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>QLOCKTWO</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="qlock.core.css" />
<link id="cssskin" rel="stylesheet" type="text/css" href="qlock.black.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="qlock.core.js"></script>
<script type="text/javascript" src="qlock.de.js"></script>
<script type="text/javascript" src="qlock.en.js"></script>
<script type="text/javascript" src="qlock.fr.js"></script>
<script type="text/javascript" src="qlock.es.js"></script>
<script type="text/javascript" src="qlock.jbo.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready( function($) {
qlockTwo.setLanguage( qlockTwo.availLangs[0] );
qlockTwo.drawClock( '#qlocktwo' );
qlockTwo.updateTime();
});
// ]]>
</script>
<style type="text/css">
#hoverme {
color: #222;
}
#hoverme:hover {
color: gray;
}
#hoverme A {
color: inherit;
text-decoration: none;
}
#hoverme:hover A {
color: silver;
}
#hoverme A:hover {
font-weight: bold;
}
#heading {
clear: both;
padding-top: 40px;
text-align: center;
font-family: "NotCourierSans";
font-size: 24pt;
font-weight: bold;
color: black;
text-shadow: gray 0px 0px 5px;
}
#hoverme:hover #heading {
text-shadow: white 0px 0px 5px;
}
#hoverme:hover #heading A {
color: black;
}
#heading A {
color: inherit;
text-decoration: none;
}
#settings {
text-align: center;
}
#footnote {
padding-top: 20px;
clear: both;
text-align: center;
font-size: 8pt;
font-family: serif;
}
ABBR {
cursor: help;
}
</style>
</head>
<body>
<div id="qlocktwo"></div>
<div id="hoverme">
<div id="heading"><a href="http://qlocktwo.com/">QLOCKTWO</a></div>
<div id="settings">
<div id="languagesettings"></div>
<div id="stylesettings">
[<a href="#" onclick="switchSkin('black');">black</a>]
[<a href="#" onclick="switchSkin('red');">red</a>]
[<a href="#" onclick="switchSkin('gray');">gray</a>]
[<a href="#" onclick="switchSkin('purple');">purple</a>]
[<a href="#" onclick="switchSkin('lime');">lime</a>]
[<a href="#" onclick="switchSkin('metal');">metal</a>]
</div>
</div>
<div id="footnote">
Das Design der originalen Wanduhr stammt von der Firma <em>Biegert &amp; Funk GmbH &amp; Co. KG</em> und ist unter der Nummer <a href="https://register.dpma.de/DPMAregister/gsm/trefferliste?AKZ=402009000849.1">402009000849</a> beim <abbr title="Deutsches Patent- und Markenamt">DPMA</abbr> eingetragen.
</div>
</div>
<script type="text/javascript">
function switchSkin( style ) {
var linkobj = $('#cssskin');
var newcss = 'qlock.' + style + '.css';
if ( linkobj.attr('href') != newcss ) linkobj.attr( 'href', newcss );
}
for (var i in qlockTwo.availLangs) {
$('#languagesettings').append('\n[<a href="#" onclick="qlockTwo.setLanguage( qlockTwo.availLangs['+i+'] ); qlockTwo.updateTime( true );" title="'+qlockTwo.availLangs[i].language+'">'+qlockTwo.availLangs[i].langCode+'</a>]');
}
</script>
</body>
</html>

19
jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

12
qlock.black.css Normal file
View File

@ -0,0 +1,12 @@
BODY {
background-color: black;
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #222;
}

49
qlock.core.css Normal file
View File

@ -0,0 +1,49 @@
BODY {
font-family: sans-serif;
}
#qlocktwo {
margin: 0 auto;
padding: 10px 15px 30px 15px;
width: 13em;
font-family: "NotCourierSans", "DejaVu Sans Mono", "Lucida Console", monospace;
font-weight: normal;
font-size: 30pt;
}
#matrix {
clear: both;
text-align: center;
letter-spacing: 0.5em;
margin-right: -0.5em;
}
#dot1, #dot4 {
float: left;
}
#dot2, #dot3 {
float: right;
}
#dot1, #dot2, #dot3, #dot4 {
font-size: 10pt;
}
@font-face {
font-family: "NotCourierSans";
src: local("NotCourierSans.otf"), url("NotCourierSans.otf") format("opentype");
font-weight: 400;
font-style: regular;
font-variant: normal;
font-stretch: normal;
}
@font-face {
font-family: "NotCourierSans";
src: local("NotCourierSans-Bold.otf"), url("NotCourierSans-Bold.otf") format("opentype");
font-weight: 700;
font-style: regular;
font-variant: normal;
font-stretch: normal;
}

96
qlock.core.js Normal file
View File

@ -0,0 +1,96 @@
// QLOCKTWO JavaScript Core
// after the official QlockTwo at http://qlocktwo.com/
// Script written by Markus Birth <markus@birth-online.de>
var qlockTwo = {
'availLangs': [],
'languageObj': null,
'updateTime': function( once ) {
if ( this.languageObj == null ) return false;
var now = new Date();
var sentence = this.languageObj.makeSentence( now );
var m4 = now.getMinutes() % 5;
this.highlight( sentence );
this.paintDots( m4 );
this.setTitle( sentence, m4 );
if ( !once ) setTimeout( 'qlockTwo.updateTime();', (61-now.getSeconds())*1000 );
return true;
},
'setTitle': function( text, m4 ) {
// convert case
var properText = text.toLowerCase().replace(/[^\s]+/g, function(s) { return s.charAt(0).toUpperCase() + s.substr(1); });
switch ( m4 ) {
case 0: properText += ' ○'; break;
case 1: properText += ' ◔'; break;
case 2: properText += ' ◑'; break;
case 3: properText += ' ◕'; break;
case 4: properText += ' ●'; break;
default: break;
}
document.title = properText;
$('title').text( properText );
},
/**
* @param {String} sentence
*/
'highlight': function( sentence ) {
var xLINES = this.languageObj.lines;
var words = sentence.split(' ');
var seekline = 0;
var seekcol = 0;
for (var i=0; i<xLINES.length; i++) {
$('#line'+i).html( xLINES[i] );
}
for (var i in words) {
var word = words[i];
for (var j=seekline; j<xLINES.length; j++) {
scol = seekcol;
if ( j != seekline ) scol = 0;
var k = xLINES[j].indexOf( word, scol );
if ( k >= 0 ) {
var html = $('#line'+j).html();
// TODO: For words with different possible locations (es:"Y" or fr:"ET") find place nearest to another word
html = html.replace( word, '<span class="on">'+word+'</span>');
$('#line'+j).html(html);
seekline = j;
seekcol = k+word.length+1;
break;
}
}
}
},
'paintDots': function( num ) {
for (var i=1; i<=4; i++) {
if (i <= num) {
$('#dot'+i).html('<span class="on">●</span>');
} else {
$('#dot'+i).html('●');
}
}
},
'drawClock': function( parentDiv ) {
$( parentDiv ).html( '' );
$( parentDiv ).append( '<div id="dot1"></div><div id="dot2"></div><div id="matrix"></div><div id="dot4"></div><div id="dot3"></div></div>').addClass('off');
for (var i in this.languageObj.lines) {
$( parentDiv + ' #matrix' ).append( '<div id="line'+i+'">' + this.languageObj.lines[i] + '</div>');
}
},
'setLanguage': function( langObj ) {
this.languageObj = langObj;
}
};

81
qlock.de.js Normal file
View File

@ -0,0 +1,81 @@
// QLOCKTWO German Localization
// after the official QlockTwo at http://qlocktwo.com/
// Script written by Markus Birth <markus@birth-online.de>
var qlockLangGerman = {
'langCode': 'de',
'language': 'German',
'lines': [
"ESKISTAFÜNF",
"ZEHNBYGVORG",
"NACHVIERTEL",
"HALBVORNACH",
"EINSLMEZWEI",
"DREIAUJVIER",
"FÜNFTOSECHS",
"SIEBENLACHT",
"NEUNZEHNELF",
"ZWÖLFUNKUHR"
],
'pre': 'ES IST ',
'first': [
"",
"FÜNF NACH ",
"ZEHN NACH ",
"VIERTEL NACH ",
"ZEHN VOR HALB ",
"FÜNF VOR HALB ",
"HALB ",
"FÜNF NACH HALB ",
"ZEHN NACH HALB ",
"VIERTEL VOR ",
"ZEHN VOR ",
"FÜNF VOR "
],
'second': [
"ZWÖLF",
"EINS",
"ZWEI",
"DREI",
"VIER",
"FÜNF",
"SECHS",
"SIEBEN",
"ACHT",
"NEUN",
"ZEHN",
"ELF"
],
'fullhour': ' UHR', // volle Stunde (!! EINS => EIN !!)
/**
* @param {Date} time
* @type String
*/
'makeSentence': function( time ) {
var h = time.getHours();
var m = time.getMinutes();
var h12 = h%12;
var m5 = Math.floor( m/5 );
if (m5 >= 4) {
h12 += 1;
if (h12 > 11) h12=0;
}
var sentence = this.pre + this.first[m5] + this.second[h12];
if (m5 == 0) {
sentence += this.fullhour;
sentence = sentence.replace( /EINS/i, 'EIN' );
}
return sentence;
}
};
qlockTwo.availLangs.push( qlockLangGerman );

80
qlock.en.js Normal file
View File

@ -0,0 +1,80 @@
// QLOCKTWO English Localization
// after the official QlockTwo at http://qlocktwo.com/
// Script written by Markus Birth <markus@birth-online.de>
var qlockLangEnglish = {
'langCode': 'en',
'language': 'English',
'lines': [
"ITLISASTIME",
"ACQUARTERDC",
"TWENTYFIVEX",
"HALFBTENFTO",
"PASTERUNINE",
"ONESIXTHREE",
"FOURFIVETWO",
"EIGHTELEVEN",
"SEVENTWELVE",
"TENSEƠCLOCK"
],
'pre': 'IT IS ',
'first': [
"",
"FIVE PAST ",
"TEN PAST ",
"A QUARTER PAST ",
"TWENTY PAST ",
"TWENTYFIVE PAST ",
"HALF PAST ",
"TWENTYFIVE TO ",
"TWENTY TO ",
"A QUARTER TO ",
"TEN TO ",
"FIVE TO "
],
'second': [
"TWELVE",
"ONE",
"TWO",
"THREE",
"FOUR",
"FIVE",
"SIX",
"SEVEN",
"EIGHT",
"NINE",
"TEN",
"ELEVEN"
],
'fullhour': ' ƠCLOCK', // volle Stunde (!! EINS => EIN !!)
/**
* @param {Date} time
* @type String
*/
'makeSentence': function( time ) {
var h = time.getHours();
var m = time.getMinutes();
var h12 = h%12;
var m5 = Math.floor( m/5 );
if (m5 >= 7) {
h12 += 1;
if (h12 > 11) h12=0;
}
var sentence = this.pre + this.first[m5] + this.second[h12];
if (m5 == 0) {
sentence += this.fullhour;
}
return sentence;
}
}
qlockTwo.availLangs.push( qlockLangEnglish );

78
qlock.es.js Normal file
View File

@ -0,0 +1,78 @@
// QLOCKTWO Spanish Localization
// after the official QlockTwo at http://qlocktwo.com/
// Script written by Markus Birth <markus@birth-online.de>
var qlockLangSpanish = {
'langCode': 'es',
'language': 'Spanish',
'lines': [
"ESONELASUNA",
"DOSITRESORE",
"CUATROCINCO",
"SEISASIETEN",
"OCHONUEVEYO",
"LADIEZSONCE",
"DOCELYMENOS",
"OVEINTEDIEZ",
"VEINTICINCO",
"MEDIACUARTO"
],
'pre': 'SON LAS ',
'first': [
"DOCE",
"UNA", // (!! SON LAS => ES LA !!)
"DOS",
"TRES",
"CUATRO",
"CINCO",
"SEIS",
"SIETE",
"OCHO",
"NUEVE",
"DIEZ",
"ONCE"
],
'second': [
"",
"Y CINCO",
"Y DIEZ",
"Y CUARTO",
"Y VEINTE",
"Y VEINTICINCO",
"Y MEDIA",
"MENOS VEINTICINCO",
"MENOS VEINTE",
"MENOS CUARTO",
"MENOS DIEZ",
"MENOS CINCO"
],
/**
* @param {Date} time
* @type String
*/
'makeSentence': function( time ) {
var h = time.getHours();
var m = time.getMinutes();
var h12 = h%12;
var m5 = Math.floor( m/5 );
if (m5 >= 7) {
h12 += 1;
if (h12 > 11) h12=0;
}
var sentence = this.pre + this.first[h12] + ' ' + this.second[m5];
if (h12 == 1) {
sentence = sentence.replace( /SON LAS/i, 'ES LA' );
}
return sentence;
}
}
qlockTwo.availLangs.push( qlockLangSpanish );

80
qlock.fr.js Normal file
View File

@ -0,0 +1,80 @@
// QLOCKTWO French Localization
// after the official QlockTwo at http://qlocktwo.com/
// Script written by Markus Birth <markus@birth-online.de>
var qlockLangFrench = {
'langCode': 'fr',
'language': 'French',
'lines': [
"ILNESTOUNER",
"DEUXNUTROIS",
"QUATREDOUZE",
"CINQSIXSEPT",
"HUITNEUFDIX",
"ONZERHEURES",
"MOINSOLEDIX",
"ETRQUARTRED",
"VINGT-CINQU",
"ETSDEMIEPAN"
],
'pre': 'IL EST ',
'first': [
"DOUZE",
"UNE", // (!! HEURES => HEURE !!)
"DEUX",
"TROIS",
"QUATRE",
"CINQ",
"SIX",
"SEPT",
"HUIT",
"NEUF",
"DIX",
"ONZE"
],
'hours': ' HEURES ',
'second': [
"",
"CINQ",
"DIX",
"ET QUART",
"VINGT",
"VINGT-CINQ",
"ET DEMIE",
"MOINS VINGT-CINQ",
"MOINS VINGT",
"MOINS LE QUART",
"MOINS DIX",
"MOINS CINQ"
],
/**
* @param {Date} time
* @type String
*/
'makeSentence': function( time ) {
var h = time.getHours();
var m = time.getMinutes();
var h12 = h%12;
var m5 = Math.floor( m/5 );
if (m5 >= 7) {
h12 += 1;
if (h12 > 11) h12=0;
}
var sentence = this.pre + this.first[h12] + this.hours + this.second[m5];
if (h12 == 1) {
sentence = sentence.replace( /HEURES/i, 'HEURE' );
}
return sentence;
}
}
qlockTwo.availLangs.push( qlockLangFrench );

16
qlock.gray.css Normal file
View File

@ -0,0 +1,16 @@
BODY {
background-color: black;
}
#qlocktwo {
background-color: #cec7bd;
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #a49e96;
}

186
qlock.jbo.js Normal file
View File

@ -0,0 +1,186 @@
// QLOCKTWO Lojban Localization
// Script written by Markus Birth <markus@birth-online.de>
var qlockLangLojban = {
'langCode': 'jbo',
'language': 'Lojban',
/*
Format:
ma tcika ti = What's the time?
li papa (11:00)
li papa pi'e mu (11:05)
li pano pi'e mumu (10:55) = li papa pi'e ni'u mu (11-5)
[li papa pimu (11:30)] = li papa pi'e cino
numbers:
0 no
1 pa
2 re
3 ci
4 vo
5 mu
6 xa
7 ze
8 bi
9 so
10 (dau) pano
11 (fei) papa
12 (gai) pare
13 paci
14 pavo
15 pamu
16 paxa
17 paze
18 pabi
19 paso
20 reno
21 repa
22 rere
23 reci
HOURS
no 00
pa 01
re 02
ci 03
vo 04
mu 05
xa 06
ze 07
bi 08
so 09
pano 10
papa 11
pare 12
paci 13
pavo 14
pamu 15
paxa 16
paze 17
pabi 18
paso 19
reno 20
repa 21
rere 22
reci 23
LI-PAREPACI 1
PAPANO-PAVO 2
PAMU-RERENO 3
PAXA--PAZE- 4
PABI--PASO- 5
RECI----PIE 6
PANO-PAMUMU 7
RENO-REMUNO 8
CINO-CIMU-- 9
VONO-VOMU-- 10
MINUTES
- 0
mu 5
pano 10
pamu 15
reno 20
remu 25
cino 30
cimu 35
vono 40
vomu 45
muno 50
mumu 55
OR (with ni'u)
-
mu
pano
pamu
reno
remu
cino
*/
'lines': [
"LIXPAREPACI",
"PAPANOPAVOF",
"RERENOTPAMU",
"PAXAWYPAZEB",
"SPABIJCPASO",
"RECIHDURPIἘ",
"PANOTPAMUMU",
"REMUNOSRENO",
"CINOBCIMUYW",
"VOMUZXVONOL"
],
'pre': 'LI ',
'first': [
'NO',
'PA',
'RE',
'CI',
'VO',
'MU',
'XA',
'ZE',
'BI',
'SO',
'PANO',
'PAPA',
'PARE',
'PACI',
'PAVO',
'PAMU',
'PAXA',
'PAZE',
'PABI',
'PASO',
'RENO',
'REPA',
'RERE',
'RECI'
],
'middle': ' PIἘ ',
'second': [
'',
'MU',
'PANO',
'PAMU',
'RENO',
'REMU',
'CINO',
'CIMU',
'VONO',
'VOMU',
'MUNO',
'MUMU'
],
/**
* @param {Date} time
* @type String
*/
'makeSentence': function( time ) {
var h = time.getHours();
var m = time.getMinutes();
var m5 = Math.floor( m/5 );
var sentence = this.pre + this.first[h];
if (m5 != 0) {
sentence += this.middle + this.second[m5];
}
return sentence;
}
}
qlockTwo.availLangs.push( qlockLangLojban );

16
qlock.lime.css Normal file
View File

@ -0,0 +1,16 @@
BODY {
background-color: black;
}
#qlocktwo {
background-color: #a8af0a;
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #858b07;
}

17
qlock.metal.css Normal file
View File

@ -0,0 +1,17 @@
BODY {
background-color: black;
}
#qlocktwo {
background-color: silver;
background-image: url(brushedmetal.png);
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #999;
}

16
qlock.purple.css Normal file
View File

@ -0,0 +1,16 @@
BODY {
background-color: black;
}
#qlocktwo {
background-color: #543288;
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #42276c;
}

16
qlock.red.css Normal file
View File

@ -0,0 +1,16 @@
BODY {
background-color: black;
}
#qlocktwo {
background-color: #e00918;
}
.on {
color: white;
text-shadow: white 0px 0px 6px;
}
.off {
color: #b20713;
}

BIN
qlocktwo_flash_v4.swf Normal file

Binary file not shown.

37370
qlocktwo_flash_v4.xml Normal file

File diff suppressed because one or more lines are too long