my website banner

updated mars clock website and logic
authorDavid Polakovic <email@dpolakovic.space>
Fri, 31 Oct 2025 17:41:46 +0000 (18:41 +0100)
committerDavid Polakovic <email@dpolakovic.space>
Fri, 31 Oct 2025 17:41:46 +0000 (18:41 +0100)
Styles/styles.css
dead-drop.php
mars-clock.php
php/clock-mars.php
php/dd2.php
php/rnd.txt [deleted file]
php/time.php

index c1e14775f2d1b4202686dc2c599ef039ca2fbc8a..f10d9e9dd37715630f02ccc89ea09e7bc880afca 100755 (executable)
@@ -15,7 +15,7 @@
 @import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@450;700&display=swap');
 
 body {
-    background-color: #e8cba9;
+    background-color: #E8CBA9;
     color: #000000;
     font-family: 'Noto Serif', serif; /* Set font to Noto Serif */
     font-size: 18px;
@@ -47,53 +47,91 @@ tr:hover {
 */
 
 nav {
 display: flex;
+ display: flex;
 }
-
 .nav-bar > ul {
-  list-style-type: none;
-  max-width: 1000px;
-  width: 100%;
-  margin: 0 auto;
-  padding: 0;
-  background-color: #333;
-  border-radius: 10px;
+list-style-type: none;
+max-width: 1000px;
+width: 100%;
+margin: 0 auto;
+padding: 0;
+background-color: #333333;
+border-radius: 10px;
 }
-
 .nav-bar li {
-  float: left;
+float: left;
+position: relative; /* Added for dropdown positioning */
 }
-
 .nav-bar li a {
-  display: block;
-  color: white;
-  text-align: center;
-  padding: 14px 16px;
-  text-decoration: none;
+display: block;
+color: white;
+text-align: center;
+padding: 14px 16px;
+text-decoration: none;
 }
-
 .nav-bar li:last-child {
-  float: right;
-  position: relative;
+float: right;
+position: relative;
 }
-
 .nav-bar li:last-child a {
-  border-radius: 0 14px 14px 0;
+border-radius: 0 14px 14px 0;
 }
-
 .gitserver {
-  background-color: #1e1e1e;
+background-color: #1e1e1e;
 }
-
 .gitstatus {
-  display: none;
-  list-style-type: none;
-  position: absolute;
-  color: black;
+display: none;
+list-style-type: none;
+position: absolute;
+color: black;
 }
-
 .nav-bar li:last-child:hover .gitstatus {
-  display: block;
+display: block;
+}
+
+/* Dropdown styles */
+.dropdown {
+display: block;
+color: white;
+text-align: center;
+padding: 14px 16px;
+text-decoration: none;
+cursor: pointer;
+}
+
+.dropdown-content {
+display: none;
+position: absolute;
+background-color: #333333;
+min-width: 160px;
+z-index: 1;
+top: 100%;
+left: 0;
+border-radius: 0 0 10px 10px;
+}
+
+.dropdown-content a {
+color: white;
+padding: 12px 16px;
+text-decoration: none;
+display: block;
+text-align: left;
+}
+
+.dropdown-content a:hover {
+
+}
+
+.dropdown-content a:last-child {
+border-radius: 0 0 10px 10px;
+}
+
+.dropdown:hover .dropdown-content {
+display: block;
+}
+
+.dropdown:hover {
+
 }
 
 /*
@@ -327,4 +365,3 @@ nav {
     text-decoration: inherit;
 }
 /* styles.css */
-
index d8cfbe10b4ff732093c0fba1712ed52ef272fb1a..70a92b87d0f2d21cc076d926588f49093b592d5e 100755 (executable)
       <script src="clicky-images.js"></script>
     </div>
     
+    <!-- navigation bar -->
     <!-- navigation bar -->
     <nav class="nav-bar">
-      <ul>
-       <li><a href="https://dpolakovic.space">About</a></li>
-       <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
-       <li><a href="https://dpolakovic.space/dir.php">Web directory</a></li>
-       <li><a href="https://dpolakovic.space/mars-clock.php">Mars clock</a></li>
-       <li><a href="https://www.dpolakovic.space/dead-drop.php">Dead drop</a></li>
-       <li><?php  serverStatus() ?></li>
+    <ul>
+        <li><a href="https://www.dpolakovic.space">About</a></li>
+        <li><a href="https://www.dpolakovic.space/blog.php">Blog</a></li>
+             <li><a href="https://www.dpolakovic.space/dir.php">Web directory</a></li>
+        <li>
+          <div class="dropdown">Other stuff
+            <div class="dropdown-content">
+              <a href="https://www.dpolakovic.space/mars-clock.php">Mars clock</a>
+              <a href="https://www.dpolakovic.space/dead-drop.php">Dead drop</a>
+            </div>
+          </div>
+        </li>
+        <li><?php serverStatus() ?></li>
       </ul>
     </nav>
 
@@ -63,6 +70,7 @@
             <br><br>
           </i>
 </p>
+
     </main>
 
     <!-- footer  -->
index 765009fadc5bf55008ad95f7db03a9148bc70b7a..d31d9f4f1e3a305219e9a3f38d123c4d3321e225 100755 (executable)
@@ -5,7 +5,7 @@
 <meta name="viewport" content="width=600, initial-scale=1.0">
 <title>dpolakovic.space</title>
 <link rel="icon"         href="./Pictures/dot.png">
-<link rel="stylesheet"   href="./Styles/styles.css">
+<link rel="stylesheet"   href="https://www.dpolakovic.space/Styles/styles.css">
 <?php require_once('./php/config.php'); ?>
 <?php require_once('./php/time.php'); ?>
 <link rel="author"       href="mailto:email@dpolakovic.space">
@@ -68,15 +68,23 @@ setInterval(() => {
       <script src="clicky-images.js"></script>
     </div>
 <!-- navigation bar -->
-<nav class="nav-bar">
-<ul>
-       <li><a href="https://dpolakovic.space">About</a></li>
-       <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
-       <li><a href="https://dpolakovic.space/dir.php">Web directory</a></li>
-       <li><a href="https://dpolakovic.space/mars-clock.php">Mars clock</a></li>
-
-<li><?php serverStatus() ?></li>
-</ul>
+    <!-- navigation bar -->
+    <nav class="nav-bar">
+    <ul>
+        <li><a href="https://www.dpolakovic.space">About</a></li>
+        <li><a href="https://www.dpolakovic.space/blog.php">Blog</a></li>
+             <li><a href="https://www.dpolakovic.space/dir.php">Web directory</a></li>
+        <li>
+          <div class="dropdown">Other stuff
+            <div class="dropdown-content">
+              <a href="https://www.dpolakovic.space/mars-clock.php">Mars clock</a>
+              <a href="https://www.dpolakovic.space/dead-drop.php">Dead drop</a>
+            </div>
+          </div>
+        </li>
+        <li><?php serverStatus() ?></li>
+      </ul>
+    </nav>
 </nav>
 
 <!-- page content -->
@@ -93,7 +101,7 @@ setInterval(() => {
 </p>
 <p>
 <div class="terminal-block" style="white-space: pre;">
-<?php title() ?>
+Mars clock 1.0.3 
 ---------------------------------------------------------
 Earth                  |    Time    |       Date        |
 ---------------------------------------------------------
@@ -106,35 +114,94 @@ Tokyo                  |  <?php timeEarth("Asia/Tokyo") ?>  |  <?php dateEarth("
 ---------------------------------------------------------
 Mars                   |    Time    |       Date        |
 ---------------------------------------------------------
-<span class="mars-block">Jezero Crater          |  <?php timeMars(10) ?>  |  <?php dateMars(10) ?>   |
-Gale Crater            |  <?php timeMars(6) ?>  |  <?php dateMars(6) ?>   |
+<span class="mars-block">Jezero Crater          |  <?php timeMars(-10) ?>  |  <?php dateMars(-10) ?>   |
+Gale Crater            |  <?php timeMars(-6) ?>  |  <?php dateMars(-6) ?>   |
 Olympus Mons*          |  <?php timeMars(0) ?>  |  <?php dateMars(0) ?>   |
-Tharsis Tholus         |  <?php timeMars(-3) ?>  |  <?php dateMars(-3) ?>   |
-Conv. Prime Meridian   |  <?php timeMars(-9) ?>  |  <?php dateMars(-9) ?>   |
+Tharsis Tholus         |  <?php timeMars(3) ?>  |  <?php dateMars(3) ?>   |
+Airy-0                 |  <?php timeMars(9) ?>  |  <?php dateMars(9) ?>   |
 </span><br><br>
 ---------------------------------------------------------
-* 0 offset time zone
+* 0 offset time zone<br>
 </div>
 </p>
 <p>
-        The idea was to create the most humanly readable modification of the 
-<a href="https://en.wikipedia.org/wiki/Darian_calendar#Calendar_layout">Darian calendar</a> 
-        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.
+  The idea was to create the most humanly readable modification of the Darian calendar. 
+  I named it Scarlett calendar. Sol (a Martian day) has
+        24 hours like Earth day, but Martian second is just slightly longer (as can 
+        be seen in the clock itself) which results in day length of 24 hours, 37 minutes and
+        approximately 23 seconds. Martian weeks have 7 sols, every month has exactly 4 weeks and Martian 
+        year has 24 months. This is basicaly same as in original Darian calendar. Complete 
+        layout can bee seen  
+        <a href="https://en.wikipedia.org/wiki/Darian_calendar#Calendar_layout">here</a>.
+</p>
+<p>      
+        Differences start with the prime meridian, which was chosen not conventionally (the first landing spot of man-made object) 
+        but rather by matching the time with actual daylight (sollight?) on the Red Planet. 
+        This way, prime meridian happens to match the location of the highest mountain on Mars (and Solar System), Olympus Mons. 
+        Because the difference, time zone with new prime meridian is called "0 offset time zone" 
+        just to avoid confusion with the NASAs one (Airy-0). 
+        Table below lists all time zones, with most notable landmark in it. 
+</p>
+<p>
+<table border="1" cellspacing="0" cellpadding="6">
+  <thead>
+    <tr>
+      <th>MTZ</th>
+      <th>Longitude interval</th>
+      <th>Landmark</th>
+      <th>Location</th>
+      <th>Note</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr><td>-11</td><td>55°E – 70°E</td><td>Schroeter Crater</td><td>55.6°E</td><td></td></tr>
+    <tr><td>-10</td><td>70°E – 85°E</td><td>Jezero Crater</td><td>77.58°E</td><td>Perseverance rover</td></tr>
+    <tr><td>-9</td><td>85°E – 100°E</td><td>Du Martheray Crater</td><td>93.5°E</td><td></td></tr>
+    <tr><td>-8</td><td>100°E – 115°E</td><td>Tyrrhena Patera</td><td>~105°E</td><td>Zhurong rover</td></tr>
+    <tr><td>-7</td><td>115°E – 130°E</td><td>Arrhenius Crater</td><td>122.6°E</td><td></td></tr>
+    <tr><td>-6</td><td>130°E – 145°E</td><td>Gale Crater</td><td>137.8°E</td><td>Curiosity rover</td></tr>
+    <tr><td>-5</td><td>145°E – 160°E</td><td>Elysium Mons</td><td>147.21°E</td><td></td></tr>
+    <tr><td>-4</td><td>160°E – 175°E</td><td>Reuyl Crater</td><td>166.8°E</td><td></td></tr>
+    <tr><td>-3</td><td>170°W – 175°E</td><td>Pettit Crater</td><td>174.0°W</td><td></td></tr>
+    <tr><td>-2</td><td>155°W – 170°W</td><td>Newton Crater</td><td>158.1°W</td><td></td></tr>
+    <tr><td>-1</td><td>140°W – 155°W</td><td>Amazonis Mensa</td><td>149.06°W</td><td></td></tr>
+    <tr><td>0</td><td>125°W – 140°W</td><td>Olympus Mons</td><td>133.88°W</td><td>New prime meridian</td></tr>
+    <tr><td>+1</td><td>110°W – 125°W</td><td>Pavonis Mons</td><td>112.96°W</td><td></td></tr>
+    <tr><td>+2</td><td>95°W – 110°W</td><td>Ascraeus Mons</td><td>104.08°W</td><td></td></tr>
+    <tr><td>+3</td><td>80°W – 95°W</td><td>Tharsis Tholus</td><td>90.69°W</td><td></td></tr>
+    <tr><td>+4</td><td>65°W – 80°W</td><td>Hebes Chasma</td><td>76.2°W</td><td></td></tr>
+    <tr><td>+5</td><td>50°W – 65°W</td><td>Mutch Crater</td><td>55.3°W</td><td></td></tr>
+    <tr><td>+6</td><td>35°W – 50°W</td><td>Orson Welles Crater</td><td>45.9°W</td><td></td></tr>
+    <tr><td>+7</td><td>20°W – 35°W</td><td>Aureum Chaos</td><td>27°W</td><td></td></tr>
+    <tr><td>+8</td><td>5°W – 20°W</td><td>Iani Chaos</td><td>~18°W</td><td></td></tr>
+    <tr><td>+9</td><td>5°W – 10°E</td><td>Airy-0</td><td>0°</td><td>Conventional prime meridian</td></tr>
+    <tr><td>+10</td><td>10°E – 25°E</td><td>Schiaparelli Crater</td><td>16.7°E</td><td></td></tr>
+    <tr><td>+11</td><td>25°E – 40°E</td><td>Ares Vallis</td><td>25.8°E</td><td></td></tr>
+    <tr><td>+12</td><td>40°E – 55°E</td><td>Teisserenc de Bort Crater</td><td>45°E</td><td></td></tr>
+  </tbody>
+</table>
+</p>
+<p>
+<i>Note,
+        that geographic features spanning trough multiple time zones are not included, to 
+        avoid confusion.
+</i>
 </p>
 <p>
-        Note, that original Darian calendar designates the first
+  Darian calendar starts on Earths date UTC 00:00 11th April 1609 which 
+  is an astronomical convention for first use of telescope in the field. My modification 
+  starts with year 1, not year 0 like the original. Darian calendar also 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.
+        three or four times a year. I am not certain how this would be received by future Martian 
+        colonists, so I didn't implemented Martian day names, week count as well as
+        winter/summer time shifts or any holidays whatsoever in Scarlett calendar.          
 </p>
 <p>
-        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.
+        Since the calendar is on the web, it is not very useful extraterrestrially. 
+        So I made a portable version which you can fit on your Raspberry 
+        Pi or any portable device running Java. It runs in GUI mode and terminal as well and is 
+        released under GPL so you can download, use and modify it for free.
 </p>
 <p>
 <center>
@@ -149,7 +216,7 @@ Conv. Prime Meridian   |  <?php timeMars(-9) ?>  |  <?php dateMars(-9) ?>   |
         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 
-        2426-hour day. Therefore, it is much easier to implement the classic 
+        24 to 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).
@@ -179,7 +246,8 @@ Conv. Prime Meridian   |  <?php timeMars(-9) ?>  |  <?php dateMars(-9) ?>   |
     Publications on this domain are licensed under
 <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.
 <br>
-    This site uses client-side scripting. Please, read the source code
+    <a href="https://www.dpolakovic.space/blogs/javascript">This site uses client-side scripting.</a> 
+    Please, read the source code
 <a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a> for more information.
 </footer>
 <br><br>
index 094135061f2f7ec51b91b0bea6ce2eb0b37548b3..d15286b78bab221051e4bb6289a451d3a057ff1e 100644 (file)
@@ -2,8 +2,8 @@
 require_once('config.php');
 require_once('time.php');
 ?>
-Jezero Crater          |  <?php timeMars(10) ?>  |  <?php dateMars(10) ?>   |
-Gale Crater            |  <?php timeMars(6) ?>  |  <?php dateMars(6) ?>   |
+Jezero Crater          |  <?php timeMars(-10) ?>  |  <?php dateMars(-10) ?>   |
+Gale Crater            |  <?php timeMars(-6) ?>  |  <?php dateMars(-6) ?>   |
 Olympus Mons*          |  <?php timeMars(0) ?>  |  <?php dateMars(0) ?>   |
-Tharsis Tholus         |  <?php timeMars(-3) ?>  |  <?php dateMars(-3) ?>   |
-Conv. Prime Meridian   |  <?php timeMars(-9) ?>  |  <?php dateMars(-9) ?>   |
+Tharsis Tholus         |  <?php timeMars(3) ?>  |  <?php dateMars(3) ?>   |
+Airy-0                 |  <?php timeMars(9) ?>  |  <?php dateMars(9) ?>   |
index 44c223955922d76c2c2d3a78d21a3d3d82de3c87..778cb32309ba3e77a1067b51ddce15e81c72e1cb 100644 (file)
@@ -1,16 +1,20 @@
 <?php
 
-define('API_KEY', 'ABC123');                        // API key for What3Words
-define('DROP_EXPIRY_SECONDS', (24 * 3600) + 2375);  // 24h 39min 35sec
-define('DEAD_DROP_DIR', './Dead-drops');            // path to the directory with messages
-define('DROP_LIMIT', 1024);                         // maximum amount of hot dead drops
-define('CSRF_TOKEN_LIFETIME', 600);                 // it is what is says...
-define('IGNORED_DROPS', [                           // list permanent drops (test purposes)
+define('API_KEY', 'NHQNNPJP');
+define('DROP_EXPIRY_SECONDS', (24 * 3600) + 2375); // 24h 39min 35sec
+define('DEAD_DROP_DIR', './Dead-drops');
+define('DROP_LIMIT', 1024);
+define('CSRF_TOKEN_LIFETIME', 600);
+define('IGNORED_DROPS', [
     '62a5bced62e7219c8e164d64fdae67900476ed54f39c5851a07bb65b590e04df'
 ]);
-
-define('TEXT_BOTTOM','
-    example text, that will be shown on bellow the form on landing page only
+define('TEXT_BOTTOM', 
+'
+<p>
+If you don\'t know the W3W coordinates for location you want to check, 
+just click on the question mark next to the search box. Make sure to
+use <b>English</b> coordinates.<br><br>
+</p>
 ');
 
 require_once 'captcha.php';
@@ -105,13 +109,14 @@ HTML;
 <form method="post">
 <label><a href="https://www.what3words.com/" target="_blank">?</a>&nbsp;</label>
 <input type="hidden" name="csrf_token" value="{$token}">
-<input type="text" id="inputString" name="inputString" placeholder="///what.three.words (English)" size="30" maxlength="50" required>
+<input type="text" id="inputString" name="inputString" placeholder="///what.three.words" size="30" maxlength="50" required>
 <input type="submit" value="Check">
 </form>
 </center>
 <br><br>
-</p>
 $text_bottom
+</p>
+
 HTML;
     }
 
@@ -150,8 +155,10 @@ HTML;
             echo "<center><br>{$result['message']}</center>";
         }
     } elseif ($result['mode'] === 'stashed') {
-        echo "<center><h3>Message stashed at " . htmlentities($result['w3w']) ."</h3>Your dead drop is hot.</center><br><br>";
+        echo "<center><h3>Message stashed at " . htmlentities($result['w3w']) ."</h3>Your dead drop is hot. <a href=\"https://www.dpolakovic.space/dead-drop.php\">Continue.</a></center><br><br>";
     }
+
+    
 }
 
 function deadDropLogic() {
diff --git a/php/rnd.txt b/php/rnd.txt
deleted file mode 100755 (executable)
index 5cad212..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-I unironically liked The Phantom Menace.
-I willingly play healers in D&D.
-I prefer Star Trek DS9 over the TNG.
-<i>J bn gbo pg dszquphsbgz</i> ;-) .
-I prefer pencils over pens.
-I still use floppy disks for backups.
-I think way too much about time travel.
-I own ~200g of meteorites.
-I am fascinated by left-handed people.
-I like to randomly browse Wikipedia.
-I am fan of Detroit Red Wings.
-I love pickles, even fried ones.
-I have one cat.
-yo aprendo español.
-I still believe that Huki and Maku were a thing.
-I liked the original Metroid more than Super Metroid.
-I don't like pudding.
-I don't use Arch btw.
-I don't play Protos in Starcraft.
-I don't drink coffee.
-my favorite visual artist is Edvard Hopper.
-my favorite author is Eric Arthur Blair.
-my favorite super hero is Batman.
-my favorite ninja turtle is Donnie.
-my favorite board game is Talisman (4th ed).
-my favorite season is autumn.
-my favorite Pokemon is #95, Onix.
-my favorite ice cream flavor is vanilla.
-my favorite junk food is fish sticks.
-my favorite dinosaur is pterodactyl.
\ No newline at end of file
index 770a309728277823498c38db9b9e31dc8129808b..b50c52de07cbc1f962ae4a6b098d1129062cadf7 100644 (file)
@@ -1,12 +1,8 @@
 <?php
 
-function title() {
-    global $time_t;
-    $current_time = date('H:i:s', $time_t);
-    
-    echo "Mars clock 1.1<br>";
-    //echo "Data valid to time: ". $current_time . "<br>";
-}
+$time_t;
+$current_time = date('H:i:s', $time_t);
+
 
 function timeEarth($timezone) {
     try {
@@ -36,7 +32,7 @@ function get_time_m(){
 
 function timeMars($offset) {
     $time_m = get_time_m();
-    $time_m = $time_m - ($offset * 3600);
+    $time_m = $time_m + ($offset * 3600);
 
     $hrs = floor(($time_m % 86400) / 3600);
     $min = floor(($time_m % 3600) / 60);
@@ -49,7 +45,7 @@ function timeMars($offset) {
 function dateMars($offset) {
   
     $time_m = get_time_m();
-    $time_m = $time_m - ($offset * 3600);
+    $time_m = $time_m + ($offset * 3600);
 
     $time_m_days = $time_m / 86400;
     $year = 1;