From c5205fb096bafa93986bdcceef73c33c09af3859 Mon Sep 17 00:00:00 2001 From: David Polakovic Date: Sat, 24 May 2025 14:05:55 +0200 Subject: [PATCH] javascript update --- blog.php | 22 ++++---- clicky-images.js | 101 ++++++++++++++++++++++++++++++++++ dead-drop.php | 20 +++---- dir.php | 131 ++++++++++++++++++++++++++++++++++++++++++++ index.php | 14 ++--- php/clock-earth.php | 8 +++ php/clock-mars.php | 9 +++ php/time.php | 10 ++-- test.php | 11 +++- 9 files changed, 290 insertions(+), 36 deletions(-) create mode 100644 clicky-images.js create mode 100755 dir.php create mode 100644 php/clock-earth.php create mode 100644 php/clock-mars.php diff --git a/blog.php b/blog.php index 2fc0789..f092496 100755 --- a/blog.php +++ b/blog.php @@ -15,19 +15,21 @@ @@ -60,10 +62,8 @@ Publications on this domain are licensed under CC BY-SA 4.0.
- This site uses no client side scripting. The source code is available - here - under - GPLv3 license. + This site uses client side scripting. Please, read the source code +here for more information.

diff --git a/clicky-images.js b/clicky-images.js new file mode 100644 index 0000000..c79d02d --- /dev/null +++ b/clicky-images.js @@ -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 diff --git a/dead-drop.php b/dead-drop.php index b291c29..d8cfbe1 100755 --- a/dead-drop.php +++ b/dead-drop.php @@ -20,18 +20,20 @@