Commit f5649550 authored by ivan zlax's avatar ivan zlax
Browse files

add erisian time

parent 4777a7ae
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,4 +4,4 @@ https://wheeloftheyear.soundragon.su
under DWTWL 2.55 license: https://soundragon.su/license/license.html
Image by DougInAMug: https://gitlab.com/DougInAMug/octosol
\ No newline at end of file
Original Octosol image by DougInAMug: https://gitlab.com/DougInAMug/octosol
\ No newline at end of file
/**
* anthrstlsht.css (another style sheet) v0.8
* DWTWL 2.55 license: https://soundragon.su/license/license.html
*/
......@@ -8,11 +7,16 @@ html {
}
body {
background: #2e3235;
margin: 0;
font-family: Ubuntu, sans-serif;
color: #222;
color: #8a8e99;
}
a:link {color: #93b375;}
a:visited {color: #abc495;}
a:hover {color: #9fbc85;}
.container {
margin: auto;
}
......@@ -41,9 +45,9 @@ h4 {
h5 {
font-size: 0.7rem;
-moz-text-shadow:0 0 10px #fff;
-webkit-text-shadow:0 0 10px #fff;
text-shadow:0 0 10px #fff;
-moz-text-shadow:0 0 10px #fff775;
-webkit-text-shadow:0 0 10px #fff885;
text-shadow:0 0 10px #fff775;
}
h6 {
......@@ -55,7 +59,7 @@ h6 {
hr {
border-width: 0;
border-top: 1px solid #bbb;
border-top: 1px solid #bbb775;
}
p {
......@@ -73,14 +77,14 @@ html input[type="button"],
input[type="reset"],
input[type="submit"] {
padding: 0 20px;
color: #555;
color: #888885;
text-align: center;
font-family: Ubuntu, sans-serif;
font-weight: 800;
line-height: 28px;
background-color: transparent;
border-radius: 6px;
border: 1px solid #bbb;
border: 1px solid #777775;
cursor: pointer;
}
......@@ -94,8 +98,8 @@ button:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus {
color: #333;
border-color: #999;
color: #999775;
border-color: #999885;
outline: 0;
}
......@@ -115,7 +119,7 @@ textarea,
select {
height: 28px;
padding: 3px 5px;
border: 1px solid #bbb;
border: 1px solid #bbb775;
border-radius: 6px;
box-shadow: none;
}
......@@ -129,20 +133,10 @@ input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
border: 1px solid #888;
border: 1px solid #888885;
outline: 0;
}
code {
font-family: monospace, monospace;
padding: .2rem .2rem;
font-size: 80%;
background: #eee;
white-space: pre;
border: 1px solid #ccc;
border-radius: 6px;
}
ul {
list-style: circle;
}
......@@ -162,19 +156,25 @@ fieldset {
}
th.even, td.even {
background: #fff8dc;
background: #253335;
}
tr.currentyear {
background: #aff8dc;
tr.odd {
background: #232731;
}
tr.even {
background: #ffe4b5;
background: #383c45;
}
tr.currentyear {
background: #454a55;
font-weight: bold;
}
table, th, td {
border: 2px solid black;
border-color: grey;
border-color: #666665;
text-align: center;
color: #a6aab5;
}
\ No newline at end of file
/*
* https://gitlab.com/zlax/dtime-js
*
* REAL-TIME CLOCK (c) 2009 por Tiago Madeira (http://tiagomadeira.com/)
* Idealizado por Santaum (http://santaum.org/)
*
* All Hail Eris!
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function az(x) {
if (x < 10)
return "0"+x;
return x;
}
function ly(Y) {
return (Y % 4 == 0 && !(Y % 100 == 0 && Y % 400 != 0));
}
function dy(D, M, Y) {
var dm = Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if (ly(Y)) {
dm[1] = 29;
}
var d = D;
for (var i = 0; i < M-1; i++) {
d+= dm[i]
}
return d;
}
function dtime(gregorianDate,resultar="default") {
// Easter Island Winter Time Zone offset (-5*60*60*1000)
var date = new Date(gregorianDate.getTime()-18000000);
var D = date.getUTCDate();
var M = date.getUTCMonth()+1;
var Y = date.getUTCFullYear();
var d = dy(D, M, Y);
var sttiby = 0;
if (ly(Y)) {
if (d == 60) {
sttiby = 1;
} else if (d > 60) {
d--;
}
}
M = Math.floor(d/73);
D = d % 73;
if (D == 0) {
M--;
D = 73;
}
var seasonnum = M+1;
switch (M) {
case 0:
M = "Chaos";
break;
case 1:
M = "Discord";
break;
case 2:
M = "Confusion";
break;
case 3:
M = "Bureaucracy";
break;
case 4:
M = "Aftermath";
break;
default:
M = "fnord";
}
Y+= 1166;
if (sttiby) {
var ddatestr = "St. Tib's Day, "+Y+" YOLD";
} else {
var ddatestr = M+" "+az(D)+", "+Y+" YOLD";
}
var h = date.getUTCHours();
var m = date.getUTCMinutes();
var s = date.getUTCSeconds();
var ms = date.getUTCMilliseconds();
var e = h*3600000+m*60000+s*1000+ms;
var ds = Math.round(e/864);
h = Math.floor(ds/10000);
ds%= 10000;
m = Math.floor(ds/100);
ds%= 100;
s = ds;
switch (resultar) {
case "shortsec":
return [ddatestr, h+":"+az(m), ":"+az(s)];
break;
case "ddatetime":
return [Y, seasonnum, D, h, m, s];
break;
case "yold":
return [Y];
break;
case "timeofyold":
var dtimestr = seasonnum+"."+az(D)+" "+h+":"+az(m);
return [dtimestr];
break;
default:
var dtimestr = h+":"+az(m)+":"+az(s);
return [ddatestr, dtimestr];
break;
}
}
......@@ -152,10 +152,12 @@
<link rel="icon" href="favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="anthrstlsht.css">
<script type="text/javascript" src="dtime.js"></script>
<title>solar wheel of the year</title>
</head>
<body>
<br><p align="center"><input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable(-11, 'UTC-11');" value="UTC-11"/>
<br><p align="center"><input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable('UTC', 'erisian');" value="Erisian time"/></p>
<p align="center">Christian time:<br><input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable(-11, 'UTC-11');" value="UTC-11"/>
<input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable(-10, 'UTC-10');" value="UTC-10"/>
<input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable(-9, 'UTC-9');" value="UTC-9"/>
<input type="button" onclick="document.getElementById('soltable').innerHTML = makeTable(-8, 'UTC-8');" value="UTC-8"/>
......@@ -193,67 +195,78 @@ var AutumnalEquinox2021 = new Date('Wed Sep 22 2021 19:21:03 GMT+0000');
var SouthernSolstice2021 = new Date('Tue Dec 21 2021 15:59:16 GMT+0000');
var VernalEquinox2022 = new Date('Sun Mar 20 2022 15:33:23 GMT+0000');
function formatedDate(datein) {
var dateout = "" + ("0" + ( datein.getUTCDate())).slice(-2) + "." + ("0" + ( datein.getUTCMonth() + 1)).slice(-2) + " " + ("0" + datein.getUTCHours()).slice(-2) + ":" + ("0" + datein.getUTCMinutes()).slice(-2);
function formatedDate(datein, timeoutput) {
if (timeoutput == 'erisian') var dateout = dtime(datein, 'timeofyold');
else var dateout = "" + ("0" + ( datein.getUTCDate())).slice(-2) + "." + ("0" + ( datein.getUTCMonth() + 1)).slice(-2) + " " + ("0" + datein.getUTCHours()).slice(-2) + ":" + ("0" + datein.getUTCMinutes()).slice(-2);
return dateout;
}
function tableRow(vernalequinox) {
function tableRow(vernalequinox, timeoutput) {
var stringout = "<td>";
if (vernalequinox.getYear() == VernalEquinox2021.getYear()) stringout += "<b>";
stringout += vernalequinox.getFullYear();
if (vernalequinox.getYear() == VernalEquinox2021.getYear()) stringout += "</b>";
if (vernalequinox.getYear() == VernalEquinox2021.getYear()) stringout += "<b>";
if (timeoutput == 'erisian') stringout += dtime(vernalequinox, 'yold');
else stringout += vernalequinox.getFullYear();
if (vernalequinox.getYear() == VernalEquinox2021.getYear()) stringout += "</b>";
var Imbolc = new Date(vernalequinox.getTime() - ((VernalEquinox2022.getTime() - SouthernSolstice2021.getTime()) / 2));
stringout += '<td class = "even">' + formatedDate(Imbolc) + "</td>";
stringout += "</td><td>" + formatedDate(vernalequinox) + "</td>";
stringout += '<td class = "even">' + formatedDate(Imbolc, timeoutput) + "</td>";
stringout += '</td><td>' + formatedDate(vernalequinox, timeoutput) + "</td>";
var Beltane = new Date(vernalequinox.getTime() + ((NorthernSolstice2021.getTime() - VernalEquinox2021.getTime()) / 2));
stringout += '<td class = "even">' + formatedDate(Beltane) + "</td>";
stringout += '<td class = "even">' + formatedDate(Beltane, timeoutput) + "</td>";
var Midsummer = new Date(vernalequinox.getTime() + (NorthernSolstice2021.getTime() - VernalEquinox2021.getTime()));
stringout += "<td>" + formatedDate(Midsummer) + "</td>";
stringout += '<td>' + formatedDate(Midsummer, timeoutput) + "</td>";
var Lughnasadh = new Date(vernalequinox.getTime() + ((NorthernSolstice2021.getTime() - VernalEquinox2021.getTime()) + (AutumnalEquinox2021.getTime() - NorthernSolstice2021.getTime()) / 2));
stringout += '<td class = "even">' + formatedDate(Lughnasadh) + "</td>";
stringout += '<td class = "even">' + formatedDate(Lughnasadh, timeoutput) + "</td>";
var Mabon = new Date(vernalequinox.getTime() + (AutumnalEquinox2021.getTime() - VernalEquinox2021.getTime()));
stringout += "<td>" + formatedDate(Mabon) + "</td>";
stringout += '<td>' + formatedDate(Mabon, timeoutput) + "</td>";
var Samhain = new Date(vernalequinox.getTime() + ((AutumnalEquinox2021.getTime() - VernalEquinox2021.getTime()) + (SouthernSolstice2021.getTime() - AutumnalEquinox2021.getTime()) / 2));
stringout += '<td class = "even">' + formatedDate(Samhain) + "</td>";
stringout += '<td class = "even">' + formatedDate(Samhain, timeoutput) + "</td>";
var Yule = new Date(vernalequinox.getTime() + (SouthernSolstice2021.getTime() - VernalEquinox2021.getTime()));
stringout += "<td>" + formatedDate(Yule) + "</td>";
stringout += '<td>' + formatedDate(Yule, timeoutput) + "</td>";
return stringout;
}
function makeTable(UTC, UTCstr) {
function makeTable(UTC, timeoutput) {
var fulltable = "<table><caption>";
now = new Date();
fulltable += 'Approximate astronomical <a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year">Wheel of the Year</a> - ' + '<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time"><b>' + UTCstr + "</b></a><br>";
fulltable += 'Model: 2021 <a href="https://en.wikipedia.org/wiki/Tropical_year">Tropical year</a> - ' + ( ( VernalEquinox2022 - VernalEquinox2021 ) / 1000 / 60 / 60 / 24 ) + " days (view source for details)</caption>";
fulltable += '<tr><th>Gregorian Year</th><th><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Imbolc">Imbolc</a></th><th><a';
fulltable += 'Approximate astronomical <a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year">Wheel of the Year</a> - ';
if (timeoutput == 'erisian') fulltable += '<a href="https://discordia.fandom.com/wiki/Erisian_Time">Erisian time</a></br>';
else fulltable += '<b>' + timeoutput + '</b> (<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">Coordinated Universal Time</a>)<br>';
fulltable += '<a href="https://en.wikipedia.org/wiki/Tropical_year">Tropical year</a> - ' + ( ( VernalEquinox2022 - VernalEquinox2021 ) / 1000 / 60 / 60 / 24 ) + " days (view source for details)</caption>";
fulltable += '<tr><th>';
if (timeoutput == 'erisian') fulltable += 'YOLD';
else fulltable += 'Gregorian Year';
fulltable += '</th><th><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Imbolc">Imbolc</a></th><th><a';
fulltable += ' href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Vernal_Equinox_.28Ostara.29">Ostara</a></th><th>';
fulltable += '<a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Beltane">Beltane</a></th><th><a href="https://en.wikipedia.org/wiki/';
fulltable += 'Wheel_of_the_Year#Midsummer_.28Litha.29">Midsummer</a></th><th><a href="https://en.wikipedia.org/wiki/';
fulltable += 'Wheel_of_the_Year#Lammas.2FLughnasadh">Lughnasadh</a></th><th><a href="https://en.wikipedia.org/wiki/';
fulltable += 'Wheel_of_the_Year#Midsummer_.28Litha.29">Kupala</a></th><th><a href="https://en.wikipedia.org/wiki/';
fulltable += 'Wheel_of_the_Year#Lammas.2FLughnasadh">Lunasa</a></th><th><a href="https://en.wikipedia.org/wiki/';
fulltable += 'Wheel_of_the_Year#Autumnal_equinox_.28Mabon.29">Mabon</a></th><th><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Samhain">';
fulltable += 'Samhain</a></th><th><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year#Midwinter_.28Yule.29">Yule</a></th></tr>';
if (timeoutput == 'erisian') UTC = 0;
for (var i = 1; i <= 17; i++) {
var current = new Date ( VernalEquinox2021.getTime() + ( UTC * 60 * 60 * 1000 ) - ( ( VernalEquinox2022.getTime() - VernalEquinox2021.getTime() ) * (7 - i) ) );
if (current.getYear() == now.getYear()) fulltable += '<tr class = "currentyear">';
else if (i % 2 == 0 ) fulltable += '<tr class = "even">';
else fulltable += '<tr>'
fulltable += tableRow(current) + "</tr>";
else fulltable += '<tr class = "odd">'
fulltable += tableRow(current, timeoutput) + "</tr>";
}
fulltable += "</table>";
return fulltable;
}
var defaultTable = makeTable(0, "UTC-0");
// var currentdate = new Date();
// var utcoffmin = -(currentdate.getTimezoneOffset()/60);
var defaultTable = makeTable(0, "erisian");
document.getElementById("soltable").innerHTML = defaultTable;
</script>
<br><p align="center"><a href="https://gitlab.com/zlax/solarwheeloftheyear">source code</a></p>
<br><p align="center"><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year"><img src="0.1.0_octosol.png" alt="Octosol by DougInAMug"></a></p>
<br><p align="center"><a href="https://en.wikipedia.org/wiki/Wheel_of_the_Year"><img src="0.5.0_octosol.png" alt="Octosol by DougInAMug"></a></p>
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment