+ I have a few thoughts on client-side scripting. It was only recently that
+ I decided to burden your browsers with up to 2.9 kilobytes of JavaScript
+ code per page[*]. My previous zealotry of avoiding
+ it was based on privacy and security concerns that I have with this
+ technology, which I didn't want my few readers to deal with. So, let me
+ explain why I decided to burden your browser with a code size of a photo
+ taken with a Nokia 6600.
+
+
+ The sheer concept of running served code locally in your browser is alien
+ to me. Sandboxed or not, escapes happen on a large scale. Just this week,
+ the zero-day vulnerability
+ CVE-2025-5419
+ was documented after having existed for almost half a year in the wild. Last
+ year, four severe vulnerabilities in the JavaScript engine emerged that
+ I am aware of, one of which enabled ACE with as little as 40 lines of code
+ (including the payload!).
+
+
+ Running code client-side means placing a lot of trust in your source (the
+ website) but even more in the tool (the browser). My decision to include
+ JavaScript in the non-critical functionality of the site was made for the
+ comfort of average surfers. To be specific, now visitors can see my
+ mars clock
+ update in real time. I wanted to demonstrate the difference between a Mars
+ second and an Earth second in the simplest possible example.
+
+
+ The core functionality is, and always will be, executed server-side. All
+ scripting is purely cosmetic and in no way interferes with your experience
+ on my domain.
+
+
+ But don't take my word for it. I encourage every visitor to read my source
+ code. Up-to-date "backups" are stored on my Git server and linked in every
+ footer. Compare them with the dev console and call me out if you find any
+ discrepancies. If you don't feel comfortable diving into the code, fire up
+ JShelter
+ to protect yourself. Even better, I encourage you to disable all JavaScript
+ and fetch only my
+ RSS feed.
+
+
+ Remember, a web publication should be obtained from the server in its complete and
+ unaltered form. If someone hides information behind potential security risks,
+ it might not be worth your time.
+
+
+
+
+
+
+
+
+
+
+ * If we include the license statements, which don't affect the logic of mentioned code,
+ it adds up to 5 kilobytes per page.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clicky-images.js b/clicky-images.js
index c79d02d..16a3f0d 100644
--- a/clicky-images.js
+++ b/clicky-images.js
@@ -25,15 +25,28 @@
* for the JavaScript code in this page.
*
*/
-
const dotImg = document.getElementById("toggleImageDot");
const spaceImg = document.getElementById("toggleImageSpace");
const dpoImg = document.getElementById("toggleImagedpo");
+// Track key state
+const keysPressed = {};
+
+// Helper function to check for redirect
+function checkRedirect(clickedKey) {
+ const requiredKeys = [".", "d", " "];
+ const otherKeys = requiredKeys.filter(k => k !== clickedKey);
+
+ if (keysPressed[otherKeys[0]] && keysPressed[otherKeys[1]]) {
+ window.location.href = "https://www.dpolakovic.space/ro";
+ }
+}
+
// Mouse behavior for dot
if (dotImg) {
dotImg.addEventListener("mousedown", () => {
dotImg.src = "./Pictures/dot2.png";
+ checkRedirect(".");
});
dotImg.addEventListener("mouseup", () => {
@@ -48,7 +61,8 @@ if (dotImg) {
// Mouse behavior for space
if (spaceImg) {
spaceImg.addEventListener("mousedown", () => {
- spaceImg.src = "./Pictures/space2.png";
+ spaceImg.src = "../Pictures/space2.png";
+ checkRedirect(" ");
});
spaceImg.addEventListener("mouseup", () => {
@@ -64,6 +78,7 @@ if (spaceImg) {
if (dpoImg) {
dpoImg.addEventListener("mousedown", () => {
dpoImg.src = "./Pictures/dpo2.png";
+ checkRedirect("d");
});
dpoImg.addEventListener("mouseup", () => {
@@ -77,25 +92,34 @@ if (dpoImg) {
// Keyboard behavior
document.addEventListener("keydown", (event) => {
- if (event.key === "." && dotImg) {
+ keysPressed[event.key] = true;
+
+ if (dotImg && event.key === ".") {
dotImg.src = "./Pictures/dot2.png";
}
- if (event.key === " " && spaceImg) {
+ if (spaceImg && event.key === " ") {
spaceImg.src = "./Pictures/space2.png";
}
- if (event.key === "d" && dpoImg) {
+ if (dpoImg && event.key === "d") {
dpoImg.src = "./Pictures/dpo2.png";
}
+
+ // Check if all three keys are pressed
+ if (keysPressed["."] && keysPressed["d"] && keysPressed[" "]) {
+ window.location.href = "https://www.dpolakovic.space/ro";
+ }
});
document.addEventListener("keyup", (event) => {
- if (event.key === "." && dotImg) {
+ delete keysPressed[event.key];
+
+ if (dotImg && event.key === ".") {
dotImg.src = "./Pictures/dot.png";
}
- if (event.key === " " && spaceImg) {
+ if (spaceImg && event.key === " ") {
spaceImg.src = "./Pictures/space.png";
}
- if (event.key === "d" && dpoImg) {
+ if (dpoImg && event.key === "d") {
dpoImg.src = "./Pictures/dpolakovic.png";
}
});
\ No newline at end of file
diff --git a/mars-clock.php b/mars-clock.php
index f79f60a..765009f 100755
--- a/mars-clock.php
+++ b/mars-clock.php
@@ -1,133 +1,187 @@
-
-
-
- dpolakovic.space
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+dpolakovic.space
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
Mars clock
+ Ack Ack Ack Ack Ack!
+
+
It was my friend Peter who got me into timekeeping "nerding". He is a devoted fan
of Mars colonization and author of few articles about timekeeping on other
celestial bodies. He inspired me to make a simple app to help me (and you!)
to see what time it is on other places in our Solar system.
-
-
-
+
+
+
-------------------------------------------------------
-Earth | Time | Date |
-------------------------------------------------------
-Silicon Valley | | |
+---------------------------------------------------------
+Earth | Time | Date |
+---------------------------------------------------------
+Silicon Valley | | |
Boston | | |
London* | | |
Tokyo | | |
+
-------------------------------------------------------
-Mars | Time | Date |
-------------------------------------------------------
-Jezero Crater | | |
+---------------------------------------------------------
+Mars | Time | Date |
+---------------------------------------------------------
+Jezero Crater | | |
Gale Crater | | |
Olympus Mons* | | |
Tharsis Tholus | | |
Conv. Prime Meridian | | |
-
-
-
-------------------------------------------------------
+
+---------------------------------------------------------
* 0 offset time zone
-
-
-
-
+
+
+
The idea was to create the most humanly readable modification of the
- Darian calendar
+Darian calendar
On contrary to the original, the epoch starts on UTC 00:00 11th April,
1609 (invention / first use of telescope) with year 1, not year 0. Aditionaly, the time zone with zero offset was chosen not
conventionally (the first landing spot / prime meridian) but rather by matching the
converted time with actual daylight on the Red Planet.
-
-
+
+
Note, that original Darian calendar designates the first
day of each month as the start of a new week, which results in a one-day weekend occurring
three or four times a year. I am uncertain how this would be received by future Martian
colonists, so I didn't implemented this feature as well as
winter/summer time shifts or any holidays whatsoever.
-
-
- Also, the clocks are not updating automatically like clocks usually do,
- because I didn't want to DDOS myself nor invade your client with
- any scripting. It is also not very useful extraterrestrially,
+
+
+ Also, this site is not very useful extraterrestrially,
so I made a portable version which you can fit on your Raspberry
Pi or any device running Java. It runs in GUI mode and terminal as well.
-
+ What about other celestial bodies in the Solar System? All relatively good
+ colonization candidates have a problem adopting a customized timekeeping
+ format due to their vastly different synodic rotation periods compared to
+ that of Earth. Homo sapiens are biologically programmed to function on a
+ 24â26-hour day. Therefore, it is much easier to implement the classic
+ Gregorian calendar with a 24-hour day and disregard the actual daylight
+ period (especially since the thin atmospheres and natural luminous intensity
+ would require artificial lighting anyway).
+
+
+ However, it is important to keep track of local daylight duration for technical purposes,
+ such as photovoltaic system management, energy conservation during spacewalks,
+ or monitoring surface temperature. Nasa is actually working on their custom timekeeping format
+ for future Moon missions. You can read more about it
+here.
+
+
+
+
+
Mars clock is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE like aerospace engineering, tax payments and/or time travel.
-
-