show eridian seconds
This commit is contained in:
parent
5c2f4508ce
commit
6f2836350a
|
|
@ -0,0 +1,108 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredUrls">
|
||||||
|
<list>
|
||||||
|
<option value="http://localhost" />
|
||||||
|
<option value="http://127.0.0.1" />
|
||||||
|
<option value="http://0.0.0.0" />
|
||||||
|
<option value="http://www.w3.org/" />
|
||||||
|
<option value="http://json-schema.org/draft" />
|
||||||
|
<option value="http://java.sun.com/" />
|
||||||
|
<option value="http://xmlns.jcp.org/" />
|
||||||
|
<option value="http://javafx.com/javafx/" />
|
||||||
|
<option value="http://javafx.com/fxml" />
|
||||||
|
<option value="http://maven.apache.org/xsd/" />
|
||||||
|
<option value="http://maven.apache.org/POM/" />
|
||||||
|
<option value="http://www.springframework.org/schema/" />
|
||||||
|
<option value="http://www.springframework.org/tags" />
|
||||||
|
<option value="http://www.springframework.org/security/tags" />
|
||||||
|
<option value="http://www.thymeleaf.org" />
|
||||||
|
<option value="http://www.jboss.org/j2ee/schema/" />
|
||||||
|
<option value="http://www.jboss.com/xml/ns/" />
|
||||||
|
<option value="http://www.ibm.com/webservices/xsd" />
|
||||||
|
<option value="http://activemq.apache.org/schema/" />
|
||||||
|
<option value="http://schema.cloudfoundry.org/spring/" />
|
||||||
|
<option value="http://schemas.xmlsoap.org/" />
|
||||||
|
<option value="http://cxf.apache.org/schemas/" />
|
||||||
|
<option value="http://primefaces.org/ui" />
|
||||||
|
<option value="http://tiles.apache.org/" />
|
||||||
|
<option value="http://" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ourVersions">
|
||||||
|
<value>
|
||||||
|
<list size="3">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="3.12" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="3.11" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="3.10" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredPackages">
|
||||||
|
<list>
|
||||||
|
<option value="annotated-types" />
|
||||||
|
<option value="arrow" />
|
||||||
|
<option value="asgiref" />
|
||||||
|
<option value="attrs" />
|
||||||
|
<option value="black" />
|
||||||
|
<option value="caldav" />
|
||||||
|
<option value="certifi" />
|
||||||
|
<option value="charset-normalizer" />
|
||||||
|
<option value="click" />
|
||||||
|
<option value="Django" />
|
||||||
|
<option value="django-ninja" />
|
||||||
|
<option value="gunicorn" />
|
||||||
|
<option value="h11" />
|
||||||
|
<option value="icalendar" />
|
||||||
|
<option value="ics" />
|
||||||
|
<option value="idna" />
|
||||||
|
<option value="isort" />
|
||||||
|
<option value="Jinja2" />
|
||||||
|
<option value="lxml" />
|
||||||
|
<option value="Markdown" />
|
||||||
|
<option value="MarkupSafe" />
|
||||||
|
<option value="mypy-extensions" />
|
||||||
|
<option value="nanodjango" />
|
||||||
|
<option value="packaging" />
|
||||||
|
<option value="pathspec" />
|
||||||
|
<option value="platformdirs" />
|
||||||
|
<option value="pydantic" />
|
||||||
|
<option value="pydantic_core" />
|
||||||
|
<option value="python-dateutil" />
|
||||||
|
<option value="pytz" />
|
||||||
|
<option value="recurring-ical-events" />
|
||||||
|
<option value="requests" />
|
||||||
|
<option value="shortuuid" />
|
||||||
|
<option value="six" />
|
||||||
|
<option value="sqlparse" />
|
||||||
|
<option value="TatSu" />
|
||||||
|
<option value="types-python-dateutil" />
|
||||||
|
<option value="typing_extensions" />
|
||||||
|
<option value="tzdata" />
|
||||||
|
<option value="urllib3" />
|
||||||
|
<option value="uvicorn" />
|
||||||
|
<option value="validators" />
|
||||||
|
<option value="vobject" />
|
||||||
|
<option value="whitenoise" />
|
||||||
|
<option value="x-wr-timezone" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredErrors">
|
||||||
|
<list>
|
||||||
|
<option value="N813" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PyTypeHintsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="ReassignedToPlainText" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -19,6 +19,10 @@ h1 {
|
||||||
font-family: Arvo, serif;
|
font-family: Arvo, serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
ul li {
|
ul li {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
@ -40,11 +44,14 @@ ul li {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock {
|
#clock-eridani, #clock-human {
|
||||||
font-family: 'eridani' !important;
|
|
||||||
color: #52ff7c;
|
color: #52ff7c;
|
||||||
font-size: 62px;
|
font-size: 62px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 60px;
|
padding-top: 60px;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock-eridani {
|
||||||
|
font-family: 'eridani' !important;
|
||||||
}
|
}
|
||||||
29
index.html
29
index.html
|
|
@ -9,21 +9,24 @@
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.png">
|
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.png">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="clock"></div>
|
|
||||||
<div class="subtitle">
|
|
||||||
<p>
|
|
||||||
This clock shows the Eridian number of Earth seconds that have passed on Earth today.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Time measurement on Earth</h1>
|
<div id="clock-eridani"></div>
|
||||||
<ul>
|
<div class="subtitle">
|
||||||
<li>One day on Earth lasts <span class="eridani">1504000</span> Earth seconds.</li>
|
<p>This clock shows the number of Eridian seconds that have passed on Earth
|
||||||
<li> Humans divide a day into <span class="eridani">40</span> units called <b>hours</b>.</li>
|
today (UTC).</p>
|
||||||
<li>Each hour is divided into <span class="eridani">140</span> <b>minutes</b>.</li>
|
<p>One day on earth lasts <span class="eridani">441021</span> Eridian
|
||||||
<li>Each minute lasts <span class="eridani">140</span> Earth seconds.</li>
|
seconds.</p>
|
||||||
</ul>
|
<p><span class="eridani">1</span> = 2.366</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="clock-human"></div>
|
||||||
|
<div class="subtitle">
|
||||||
|
<p>This clock shows the number of Earth seconds that have passed today (UTC).</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="js/scripts.js"></script>
|
<script type="text/javascript" src="js/scripts.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,22 +1,45 @@
|
||||||
function earthTime() {
|
function eridaniTime() {
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
let hours = date.getUTCHours()
|
let hours = date.getUTCHours()
|
||||||
let minutes = date.getUTCMinutes()
|
let minutes = date.getUTCMinutes()
|
||||||
let seconds = date.getUTCSeconds()
|
let seconds = date.getUTCSeconds()
|
||||||
|
let milliseconds = date.getUTCMilliseconds();
|
||||||
|
let secondsToday = (hours * 3600) + (minutes * 60) + seconds + (milliseconds / 1000);
|
||||||
|
|
||||||
document.getElementById("clock").innerText =
|
document.getElementById("clock-eridani").innerText =
|
||||||
appendLeadingZeros(((hours * 3600) + (minutes * 60) + seconds).toString(6));
|
appendLeadingZeros(((secondsToday / 2.366).toString(6).split(".")[0]), 6);
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
earthTime()
|
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendLeadingZeros(time) {
|
function humanTime() {
|
||||||
while (time.length < 7) {
|
let date = new Date();
|
||||||
|
let hours = date.getUTCHours()
|
||||||
|
let minutes = date.getUTCMinutes()
|
||||||
|
let seconds = date.getUTCSeconds()
|
||||||
|
let milliseconds = date.getUTCMilliseconds();
|
||||||
|
let secondsToday = (hours * 3600) + (minutes * 60) + seconds + (milliseconds / 1000);
|
||||||
|
|
||||||
|
document.getElementById("clock-human").innerText =
|
||||||
|
appendLeadingZeros(secondsToday.toString(10).split(".")[0], 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendLeadingZeros(time, zeros) {
|
||||||
|
while (time.length < zeros) {
|
||||||
time = "0" + time;
|
time = "0" + time;
|
||||||
}
|
}
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
earthTime();
|
function tick() {
|
||||||
|
setInterval(eridaniTime, 2366);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tock() {
|
||||||
|
setInterval(humanTime, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
eridaniTime();
|
||||||
|
humanTime();
|
||||||
|
tick();
|
||||||
|
tock();
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue