my website banner

javascript update
authorDavid Polakovic <email@dpolakovic.space>
Sat, 24 May 2025 12:05:55 +0000 (14:05 +0200)
committerDavid Polakovic <email@dpolakovic.space>
Sat, 24 May 2025 12:05:55 +0000 (14:05 +0200)
blog.php
clicky-images.js [new file with mode: 0644]
dead-drop.php
dir.php [new file with mode: 0755]
index.php
php/clock-earth.php [new file with mode: 0644]
php/clock-mars.php [new file with mode: 0644]
php/time.php
test.php

index 2fc0789460394b94376fb2ace3a5466e83b7fecf..f0924961dcd8008558e4b3e020fe58aac6d08f27 100755 (executable)
--- a/blog.php
+++ b/blog.php
     <!-- show pictures (banner) on top of the page -->
     <div class="banner">
       <p>
-       <img src="./Pictures/dpolakovic.png" alt="simple">
-       <img src="./Pictures/dot.png" alt="website">
-       <img src="./Pictures/space.png" alt="banner">
+             <img id="toggleImagedpo" src="./Pictures/dpolakovic.png" alt="simple">
+             <img id="toggleImageDot" src="./Pictures/dot.png" alt="website">
+        <img id="toggleImageSpace" src="./Pictures/space.png" alt="website">
       </p>
+      <script src="clicky-images.js"></script>
     </div>
     
     <!-- 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/mars-clock.php">Mars clock</a></li>
-        <li><a href="https://www.dpolakovic.space/dead-drop.php">Dead drop</a></li>
+       <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>
     </nav>
     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 no client side scripting. The source code is available
-    <a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a>
-    under
-    <a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3 license</a>.
+    This site uses client side scripting. Please, read the source code
+<a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a> for more information.
     </footer>
     <br><br>   
   </body>
diff --git a/clicky-images.js b/clicky-images.js
new file mode 100644 (file)
index 0000000..c79d02d
--- /dev/null
@@ -0,0 +1,101 @@
+  
+/**
+ *
+ * @licstart  The following is the entire license notice for the 
+ *  JavaScript code in this page.
+ *
+ * Copyright (C) 2025  David Polakovic
+ *
+ *
+ * The JavaScript code in this page is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GNU GPL) as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option)
+ * any later version.  The code is distributed WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
+ *
+ * As additional permission under GNU GPL version 3 section 7, you
+ * may distribute non-source (e.g., minimized or compacted) forms of
+ * that code without the copy of the GNU GPL normally required by
+ * section 4, provided you include this license notice and a URL
+ * through which recipients can access the Corresponding Source.
+ *
+ * @licend  The above is the entire license notice
+ * for the JavaScript code in this page.
+ *
+ */
+
+const dotImg = document.getElementById("toggleImageDot");
+const spaceImg = document.getElementById("toggleImageSpace");
+const dpoImg = document.getElementById("toggleImagedpo");
+
+// Mouse behavior for dot
+if (dotImg) {
+  dotImg.addEventListener("mousedown", () => {
+    dotImg.src = "./Pictures/dot2.png";
+  });
+
+  dotImg.addEventListener("mouseup", () => {
+    dotImg.src = "./Pictures/dot.png";
+  });
+
+  dotImg.addEventListener("mouseleave", () => {
+    dotImg.src = "./Pictures/dot.png";
+  });
+}
+
+// Mouse behavior for space
+if (spaceImg) {
+  spaceImg.addEventListener("mousedown", () => {
+    spaceImg.src = "./Pictures/space2.png";
+  });
+
+  spaceImg.addEventListener("mouseup", () => {
+    spaceImg.src = "./Pictures/space.png";
+  });
+
+  spaceImg.addEventListener("mouseleave", () => {
+    spaceImg.src = "./Pictures/space.png";
+  });
+}
+
+// Mouse behavior for dpo
+if (dpoImg) {
+  dpoImg.addEventListener("mousedown", () => {
+    dpoImg.src = "./Pictures/dpo2.png";
+  });
+
+  dpoImg.addEventListener("mouseup", () => {
+    dpoImg.src = "./Pictures/dpolakovic.png";
+  });
+
+  dpoImg.addEventListener("mouseleave", () => {
+    dpoImg.src = "./Pictures/dpolakovic.png";
+  });
+}
+
+// Keyboard behavior
+document.addEventListener("keydown", (event) => {
+  if (event.key === "." && dotImg) {
+    dotImg.src = "./Pictures/dot2.png";
+  }
+  if (event.key === " " && spaceImg) {
+    spaceImg.src = "./Pictures/space2.png";
+  }
+  if (event.key === "d" && dpoImg) {
+    dpoImg.src = "./Pictures/dpo2.png";
+  }
+});
+
+document.addEventListener("keyup", (event) => {
+  if (event.key === "." && dotImg) {
+    dotImg.src = "./Pictures/dot.png";
+  }
+  if (event.key === " " && spaceImg) {
+    spaceImg.src = "./Pictures/space.png";
+  }
+  if (event.key === "d" && dpoImg) {
+    dpoImg.src = "./Pictures/dpolakovic.png";
+  }
+});
\ No newline at end of file
index b291c29c800152b562a6b91d8264575ebb50d485..d8cfbe10b4ff732093c0fba1712ed52ef272fb1a 100755 (executable)
     <!-- show pictures (banner) on top of the page -->
     <div class="banner">
       <p>
-       <img src="./Pictures/dpolakovic.png" alt="simple">
-       <img src="./Pictures/dot.png" alt="website">
-       <img src="./Pictures/space.png" alt="banner">
+             <img id="toggleImagedpo" src="./Pictures/dpolakovic.png" alt="simple">
+             <img id="toggleImageDot" src="./Pictures/dot.png" alt="website">
+        <img id="toggleImageSpace" src="./Pictures/space.png" alt="website">
       </p>
+      <script src="clicky-images.js"></script>
     </div>
     
     <!-- 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/mars-clock.php">Mars clock</a></li>
+       <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>
     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 no client side scripting. The source code is available
-    <a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a>
-    under
-    <a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3 license</a>.
+    This site uses client side scripting. Please, read the source code
+<a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a> for more information.
     </footer>
     <br><br>
     
diff --git a/dir.php b/dir.php
new file mode 100755 (executable)
index 0000000..68bfab2
--- /dev/null
+++ b/dir.php
@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <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">
+    <?php require_once('./php/config.php'); ?>
+    <link rel="author"       href="mailto:email@dpolakovic.space">
+    <meta name="description" content="personal website and git server">
+    <meta name="author"      content="David Polakovic, 2023">
+  
+  </head>
+  <body>
+    
+    <!-- show pictures (banner) on top of the page -->
+    <div class="banner">
+      <p>
+             <img id="toggleImagedpo" src="./Pictures/dpolakovic.png" alt="simple">
+             <img id="toggleImageDot" src="./Pictures/dot.png" alt="website">
+        <img id="toggleImageSpace" src="./Pictures/space.png" alt="website">
+      </p>
+      <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><a href="https://www.dpolakovic.space/dead-drop.php">Dead drop</a></li>
+       <li><?php  serverStatus() ?></li>
+      </ul>
+    </nav>
+
+    <!-- page content -->
+    <main class="content">
+      <p>
+       <h2> My Web directory </h2> 
+       <i> Let's explore the Web. </i>
+       <br>
+       <br>
+       The online space is vast and still expanding. Sadly, not thanks to
+       the users but rather spam bots and focus black holes - the social networks.
+       Therefore it's good practice for surfers to share links between each other
+       in "web directories" like this one. So here are links I thought you might
+       find useful. 
+      </p>
+         <p>
+           <b>software</b><br>
+           <a href="https://directory.fsf.org/wiki/Main_Page">Free software directory</a>
+           - a collaborative catalog of free software<br>
+           <a href="https://winworldpc.com/home">WinWorld</a>
+           - online museum/library of vintage operating systems<br>
+           <a href="https://eblong.com/infocom/">Infocom catalog</a>
+           - every Infocom text adventure ever<br>
+           <a href="https://kolibrios.org/en/">KolibriOS</a>
+           - operating system on 1,44MB floppy<br>
+           <a href="https://atariage.com/index.php">AtariAge</a>
+           - hub for enthusiasts of Atari PCs and consoles<br>
+         </p>
+         <p>
+           <b>programming</b><br>
+           <a href="https://whichjdk.com/">Which JDK?</a>
+           - neat website for navigating alternative Java Dev Kits<br>
+           <a href="https://sdkman.io/">SDKman</a>
+           - must have tool for every JVM based project<br>
+           <a href="https://mvnrepository.com/">MVN repository</a>
+           - Java libraries packed in .jars<br>
+           <a href="https://perlmonks.org/">Perl monks</a>
+           - best place  to seek help and wisdom in Perl<br>
+           <a href="https://rosettacode.org/wiki/Category:Programming_Tasks">Rosetta Code</a>
+           - solutions for many tasks in many languages [2]<br>
+           <a href="https://opensource.com/sites/default/files/2022-04/OSDC_cheatsheet-git-2022.4.7.pdf">Git cheat sheet</a>
+           - feel free to laugh, but I use this a lot [PDF]
+         </p>
+         <p>
+           <b>tools & tutorials</b><br>
+           <a href="https://cidr.xyz/">Cidr.xyz</a>
+           - when you don't want to die over subnet tables [3]<br>
+           <a href="https://www.deadlinkchecker.com/">Broken link checker</a>
+           - it does, exactly what it says [3]<br>
+           <a href="https://wine.htmlvalidator.com/">Installing Wine on Linux</a>
+           - this is tricky task for many distros<br>
+         </p>
+         <p>
+           <b>other</b><br>
+           <a href="https://lkml.iu.edu/hypermail/linux/kernel/">Linux Kernel Mailing List</a>
+           - this is my preferred instance<br>
+           <a href="https://wiki.eth0.nl/index.php/LackRack">Lack rack</a>
+           - nice hack that I use for my servers<br>
+           <a href="https://www.floppydisk.com">Floppydisk.com</a>
+           - new and refurbished floppies for okay prices [3]<br>
+           <a href="https://brisray.com/web/webring-list.htm">Webring list</a>
+           - pick a community and meet fellow netizens<br>
+           <a href="https://www.gutenberg.org/">Project Gutenberg</a>
+           - my go to place to get books online<br>
+           <a href="https://www.av8n.com/physics/thermo/">Av8ns thermodynamics</a>
+           - thermodynamics reference page<br>
+           <a href="https://www.swpc.noaa.gov/">SWPC NOAA</a>
+           - space weather forecast [3]<br>            
+           <a href="https://en.uesp.net/wiki/Morrowind:Morrowind#Quest_Information">UESP wiki</a>
+           - everything I ever needed for Morrowind [1, 3]
+         </p>  
+      <br>
+      <hr>
+      <p>
+       Some of these websites contains "allergens"<br>
+       [1] - advertisements,
+       [2] - unnecessary cookies, 
+       [3] - proprietary javascript
+      </p>
+      <br>
+      </main>
+
+    <!-- footer  -->
+    <footer class="footer">
+    Copyright <?php printYear() ?> David Polakovic - 
+    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://git.dpolakovic.space/?p=my-website;a=tree">here</a> for more information.
+    </footer>
+    <br><br>
+    
+  </body>
+  </html>
index 4377420f49abbc93904b5cede59890577c6dbf8d..8311e18c9af4ae89d8b5390ac618ccfa843fc626 100755 (executable)
--- a/index.php
+++ b/index.php
     <!-- show pictures (banner) on top of the page -->
     <div class="banner">
       <p>
-       <img src="./Pictures/dpolakovic.png" alt="simple">
-       <img src="./Pictures/dot.png" alt="website">
-       <img src="./Pictures/space.png" alt="banner">
+             <img id="toggleImagedpo" src="./Pictures/dpolakovic.png" alt="simple">
+             <img id="toggleImageDot" src="./Pictures/dot.png" alt="website">
+        <img id="toggleImageSpace" src="./Pictures/space.png" alt="website">
       </p>
+      <script src="clicky-images.js"></script>
     </div>
     
     <!-- navigation bar -->
@@ -31,6 +32,7 @@
     <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><a href="https://www.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>
     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 no client side scripting. The source code is available
-    <a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a>
-    under
-    <a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3 license</a>.
+    This site uses client side scripting. Please, read the source code
+<a href="https://git.dpolakovic.space/?p=my-website;a=tree">here</a> for more information.    
     </footer>
     <div class="what-is-this">
       <center>
diff --git a/php/clock-earth.php b/php/clock-earth.php
new file mode 100644 (file)
index 0000000..03a88ed
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+require_once('config.php');
+require_once('time.php');
+?>
+Silicon Valley         |  <?php timeEarth("America/Los_Angeles") ?>  |  <?php dateEarth("America/Los_Angeles") ?>  |
+Boston                 |  <?php timeEarth("America/New_York") ?>  |  <?php dateEarth("America/New_York") ?>  |
+London*                |  <?php timeEarth("Europe/London") ?>  |  <?php dateEarth("Europe/London") ?>  |
+Tokyo                  |  <?php timeEarth("Asia/Tokyo") ?>  |  <?php dateEarth("Asia/Tokyo") ?>  |
diff --git a/php/clock-mars.php b/php/clock-mars.php
new file mode 100644 (file)
index 0000000..0941350
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+require_once('config.php');
+require_once('time.php');
+?>
+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) ?>   |
index 8a6905b33712d63ab783839c78c6463c1323c1b4..770a309728277823498c38db9b9e31dc8129808b 100644 (file)
@@ -4,14 +4,14 @@ function title() {
     global $time_t;
     $current_time = date('H:i:s', $time_t);
     
-    echo "Mars clock 1.0 (PHP version)<br>";
+    echo "Mars clock 1.1<br>";
     //echo "Data valid to time: ". $current_time . "<br>";
 }
 
 function timeEarth($timezone) {
     try {
         $dateTime = new DateTime("now", new DateTimeZone($timezone));
-        echo $dateTime->format("H:i");
+        echo $dateTime->format("H:i:s");
     } catch (Exception $e) {
         echo "Invalid timezone provided.";
     }
@@ -35,16 +35,17 @@ function get_time_m(){
 }
 
 function timeMars($offset) {
-
     $time_m = get_time_m();
     $time_m = $time_m - ($offset * 3600);
 
     $hrs = floor(($time_m % 86400) / 3600);
     $min = floor(($time_m % 3600) / 60);
+    $sec = floor($time_m % 60);
 
-    echo sprintf("%02d:%02d", $hrs, $min);
+    echo sprintf("%02d:%02d:%02d", $hrs, $min, $sec);
 }
 
+
 function dateMars($offset) {
   
     $time_m = get_time_m();
@@ -104,6 +105,5 @@ function dateMars($offset) {
 
 
 
-
 function test() { $test = strtotime("1609-04-11 00:00:00"); echo $test; }
 ?>
index 0c1e86124aa862349cb4547a916cfffe28b2be84..37e5d8dc705a886768cf5c4dbb7d7e0c216f99a5 100755 (executable)
--- a/test.php
+++ b/test.php
     <!-- show pictures (banner) on top of the page -->
     <div class="banner">
       <p>
-       <img src="./Pictures/dpolakovic.png" alt="simple">
-       <img src="./Pictures/dot.png" alt="website">
+       <img id="toggleImagedpo" src="./Pictures/dpolakovic.png" alt="simple">
+       <img id="toggleImageDot" src="./Pictures/dot.png" alt="website">
+  <img id="toggleImageSpace" src="./Pictures/space.png" alt="website">
       </p>
+      <script src="clicky-images.js"></script>
     </div>
     
     <!-- navigation bar -->
@@ -80,7 +82,7 @@ if (isWebsiteOnline2($websiteUrl)) {
       </p>
       <p>
        <!-- <img src="https://dpolakovic.space/Pictures/donkey-kong-country-eyes.gif" alt="cool dancing alien"> -->
-        <img src="https://dpolakovic.space/Pictures/bonzi-buddy.gif" alt="cool dancing alien">
+        <img  src="https://dpolakovic.space/Pictures/bonzi-buddy.gif" alt="cool dancing alien">
       </p>
       <p>
        <form action="https://www.paypal.com/donate" method="post" target="_top">
@@ -92,6 +94,9 @@ if (isWebsiteOnline2($websiteUrl)) {
       <p> 
         <a href="">DOWNLOAD NOW</a>
       </p>
+      
+
+
 
 
       <br><br>