lotte time

This commit is contained in:
tess 2023-09-11 15:06:30 +02:00
parent 120b93c8df
commit 10a57e198e
2 changed files with 95 additions and 46 deletions

View File

@ -2,13 +2,14 @@
<html lang="en">
<head>
<link rel="stylesheet" href="/assets/stylesheet.css" />
<link rel="stylesheet" href="https://lotte.kittycat.homes/assets/stylesheet.css" />
<title>lotte time</title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" type="image/png" href="/assets/favicon.png" />
</head>
<body onload="current_date()">
<body
onload="current_date(); insert_date(Date.parse(normal_date_input.value), 'ld-year', 'ld-month', 'ld-day', 'ld-hour', 'ld-minute', 'ld-second', 'ld-month_name')">
<h1 class="title">lotte time</h1>
@ -18,49 +19,73 @@
<p style="font-style:italic;color:#e63e62;">month of <span id="month_name"></span></p>
</div>
<h2 class="title box-title">~ convert normal time to lotte time</h2>
<div class="box">
<form>
<label for="nd">date and time:</label>
<input type="datetime-local" id="nd" name="normal-date" />
</form>
<p style="font-size:150%; font-weight:bold; color:#e63e62"><span id="ld-hour">00</span>:<span
id="ld-minute">00</span>:<span id="ld-second">00</span> <span id="ld-day">1</span>/<span
id="ld-month">1</span>/<span id="ld-year">0000</span></p>
<p style="font-style:italic;color:#e63e62;">month of <span id="ld-month_name">Not a Month</span></p>
</div>
<h2 class="title box-title">~ convert lotte time to normal time</h2>
<div class="box">
<form id="ld">
<input type="number" id="input-hour" size=5 min=0 max=23 />:<input type="number" id="input-minute" size=5 min=0
max=23 />:<input type="number" id="input-second" size=5 min=0 max=23 /> <input type="number" id="input-day"
size=5 min=1 max=24 />/<input type="number" id="input-month" size=5 min=1 max=24 />/<input type="number"
id="input-year" size=8 />
</form>
<p style="font-size:150%; font-weight:bold; color:#e63e62" id="normal-date"></p>
</div>
<h2 class="title box-title">~ whats lotte time?!</h2>
<div class="box box-top">
<p>lotte time is a time system i invented for fun!</p>
<p>in it, every unit of time is divided into 24; 24 seconds in a minute in an hour in a day in a month in a year!
</p>
<p>that means that one year in normal time is equivalent to a little under <span class="zelda">4 years</span> in
lotte time.</p>
<p>one day in normal time is equivalent to <span class="zelda">6.25 days</span> in lotte time!</p>
<p>that makes it so that one day in normal time is equivalent to <span class="zelda">6.25 days</span> in lotte time,
and a year is a little less than <span class="zelda">four years!</span>! that's a lotte time!</p>
</div>
<div class="box">
<p>the year 0 in lotte time is on October 14, 2000 in normal time. (which just happens to be my birthday)</p>
<p>i'm 90 years old in lotte time as of writing this, and 22 years old in normal time.</p>
</div>
<h2 class="title box-title">~ the months</h2>
<div class="box">
<p>there are 24 months in one year, and each one has a name:</p>
<ol>
<li>lotte</li>
<li>two</li>
<li>mute</li>
<li>E</li>
<li>👻</li>
<li>epic</li>
<li>lazy</li>
<li>cass</li>
<li>spetember</li>
<li>love</li>
<li>tiger</li>
<li>vengeance</li>
<li>ivy</li>
<li>pride month</li>
<li>destruction</li>
<li>destruction pt 2 (for kitties only)</li>
<li>zoe</li>
<li>communism</li>
<li>pali</li>
<li>creachers :3</li>
<li>math</li>
<li>waffle</li>
<li>giving</li>
<li>burglary</li>
</ol>
</div>
<h3 class="title box-title">~ the months</h2>
<div class="box">
<p>there are 24 months in one year, and each one has a name:</p>
<ol>
<li>lotte</li>
<li>two</li>
<li>mute</li>
<li>E</li>
<li>👻</li>
<li>epic</li>
<li>lazy</li>
<li>communism</li>
<li>spetember</li>
<li>love</li>
<li>tiger</li>
<li>vengeance</li>
<li>ivy</li>
<li>pride month</li>
<li>cass</li>
<li>destruction</li>
<li>zoe</li>
<li>destruction pt 2 (for kitties only)</li>
<li>pali</li>
<li>creachers :3</li>
<li>math</li>
<li>waffle</li>
<li>giving</li>
<li>burglary</li>
</ol>
</div>
</body>

View File

@ -1,20 +1,44 @@
const YEAR_ZERO = 971474400;
const MONTHS = ["lotte", "two", "mute", "E", "👻", "epic", "lazy", "cass", "spetember", "love", "tiger", "vengeance", "ivy", "pride month", "destruction", "destruction pt 2 (for kitties only)", "zoe", "communism", "pali", "creachers :3", "math", "waffle", "giving", "burglary"]
const MONTHS = ["lotte", "two", "mute", "E", "👻", "epic", "lazy", "communism", "spetember", "love", "tiger", "vengeance", "ivy", "pride month", "cass", "destruction", "zoe", "destruction pt 2 (for kitties only)", "pali", "creachers :3", "math", "waffle", "giving", "burglary"]
const normal_date_input = document.getElementById("nd");
const lotte_date_input = document.getElementById("ld")
function current_date() {
var lotte_timestamp = Math.floor(new Date().getTime()/1000.0) - YEAR_ZERO;
insert_text("year", Math.floor(lotte_timestamp / 24 ** 5), 4);
insert_text("month", unit(lotte_timestamp / 24 ** 4) + 1, 2);
insert_text("day", unit(lotte_timestamp / 24 ** 3) + 1, 2);
insert_text("hour", unit(lotte_timestamp / 24 ** 2), 2);
insert_text("minute", unit(lotte_timestamp / 24), 2);
insert_text("second", unit(lotte_timestamp), 2);
insert_text("month_name", MONTHS[unit(lotte_timestamp / 24 ** 4)], 0)
insert_date(Math.floor(new Date().getTime()), "year", "month", "day", "hour", "minute", "second", "month_name");
setTimeout(current_date, 1000)
}
function insert_date(timestamp, year, month, day, hour, minute, second, month_name) {
timestamp = Math.floor(timestamp/1000.0) - YEAR_ZERO;
insert_text(year, Math.floor(timestamp / 24 ** 5), 4);
insert_text(month, unit(timestamp / 24 ** 4) + 1, 2);
insert_text(day, unit(timestamp / 24 ** 3) + 1, 2);
insert_text(hour, unit(timestamp / 24 ** 2), 2);
insert_text(minute, unit(timestamp / 24), 2);
insert_text(second, unit(timestamp), 2);
insert_text(month_name, MONTHS[unit(timestamp / 24 ** 4)], 0)
}
normal_date_input.addEventListener("change", (event) => {
insert_date(Date.parse(event.target.value), "ld-year", "ld-month", "ld-day", "ld-hour", "ld-minute", "ld-second", "ld-month_name");
})
lotte_date_input.addEventListener("change", (event) => {
var year = parseInt(document.getElementById("input-year").value);
var month = parseInt(document.getElementById("input-month").value);
var day = parseInt(document.getElementById("input-day").value);
var hour = parseInt(document.getElementById("input-hour").value);
var minute = parseInt(document.getElementById("input-minute").value);
var second = parseInt(document.getElementById("input-second").value);
var timestamp = year * (24 ** 5) + (month - 1) * (24 ** 4) + (day - 1) * (24 ** 3) + hour * (24 ** 2) + minute * 24 + second + YEAR_ZERO;
var date = new Date(Math.floor(timestamp * 1000.0))
var display = document.getElementById("normal-date")
console.log(timestamp);
display.innerHTML = date.toLocaleString()
})
function unit(x) {
return Math.floor(x - Math.floor(x / 24) * 24);
}