From 9cba8169b349f09213abc927e8399366c334ef5c Mon Sep 17 00:00:00 2001 From: David Polakovic Date: Fri, 6 Jun 2025 20:23:39 +0200 Subject: [PATCH] javascript blog and final update --- Pictures/dot2.png | Bin 0 -> 2175 bytes Pictures/dpo2.png | Bin 0 -> 4189 bytes Pictures/space2.png | Bin 0 -> 2302 bytes blogs/clicky-images-in-blogs.js | 127 +++++++++++++++++ blogs/javascript.html | 119 ++++++++++++++++ clicky-images.js | 40 ++++-- mars-clock.php | 240 +++++++++++++++++++------------- ro.php | 100 +++++++++++++ rss.xml | 38 +++-- 9 files changed, 553 insertions(+), 111 deletions(-) create mode 100644 Pictures/dot2.png create mode 100644 Pictures/dpo2.png create mode 100644 Pictures/space2.png create mode 100644 blogs/clicky-images-in-blogs.js create mode 100755 blogs/javascript.html create mode 100755 ro.php diff --git a/Pictures/dot2.png b/Pictures/dot2.png new file mode 100644 index 0000000000000000000000000000000000000000..39d81f6c04bbd4188691ef805a8d350618651f65 GIT binary patch literal 2175 zcmV-_2!QvAP)cq*O#K#8PlbFf)y9 z$b{I6BcW4MlRsi+?2MDx(vD-2N!zsM(PpZX_(#mN88meg5}kxh&_*S(f+&g=t!YZR zK6onc_v`MS{sB!dT(~aCUSP^Of8Cigdq4Zz-+q6OJx54p%TSm@okN`+!(w#d6;wJ< zryM{MipEj~Z@W?$Q-EXG=%n2g)CgjMayq60wUbgDXAnQ)0JVI9Kfm#~66s;KQ^`p-0y#8#TzO}6fRDMCKk_de9#(m@Y8L^N zkq_9ho2Zyp7Gt4^CXe3g5jBF(IXo;WW~Ma~9Z3NvxyqHvyjG_H2M!+K5&&N;wLu(0Qyq%na0SXbiS3hR`G?55)QAidi_^xr(o78ZEYF;3XMt&A`_0r1$ zF}!S22-rKXd*f?=ZFZ)T#95L^8Sep%HLs9QENdvCk^JCS%A@rZ`I+pKQtDGYTjZZ) zpv>xdCFK~+6p_L&so?S$Ok;u`r-*E9yh!$=4?!VUHS+lfL# zcEe(X*&!ej=R9@@6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?4h{F+4ikjYj`=?GK?Jc^CA@$Fel{8&YP@=~8NN)eWDsqU z93h{f2GN=(U7qOOm(vvC!pcBmpjLcTd(79%rf4J6;I)P1v3-p*9Vbq5DJ0F5*&;?a z(T*LQ1Cq$A;z`?Vf2*eDVs_Y1c(R*Dw0dvS#95**dwG~dA9&37_cYA=d+>Ng2eXk% zT991J(<~|j&SBH6AIrtC^i1w^ClH-q=bS6vpgTV>fYm-ZYKmF0cYEQ-AEK-Rp!=QvpuQG$cRv8VRG*Lf`x3sF9Bbi#(k1SsUYwil#fn5yQx7JZhd4+vP~7h5nu5Nr03aL&^Wri6_Ks!OE@@ghc`)~a^JAvDQ6LJFxkRj1-mUBacfgiFYahx>b>|Jr+(qtae3oyLF& zcRvW}wokc#z6gAY*QEg<0|({8f5LA<=oB#%p!UFpT~v!o<&?)iErnEMppfjow<2*; zMrmJ1Pd-QC*G4ZVD(2+tnnM)OU6O)jceb8=^NQQZ-zx%V_t=Jq#7cRHHv nuBombQ*tv!1Cva;R_Ol$+-i0$`bAky00000NkvXXu0mjf#AUyk literal 0 HcmV?d00001 diff --git a/Pictures/space2.png b/Pictures/space2.png new file mode 100644 index 0000000000000000000000000000000000000000..c8c90cb5bdc1fff5a8cefd931a0fe7d3d779c3ae GIT binary patch literal 2302 zcmV003eL1ONa4443Ka00004XF*Lt006O% z3;baP00001b5ch_0olnce*gdgAY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy0%A)?L;(MXkIcUS000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2k8YE2r36(&KTJM00>4&L_t(|+U?zaY*pm}$MNrT&VA_%7?RC}P)0;~ z5h>UfdT;N!&;FpWO0oBx+k5G`_x?WpgQncv_B_x1o%5XM?SP1gh=_=Yh=_=Yh=_=Y zh=_=Yh=_=Yh=_=YNUj0 zhN_I~bN-ImmGLb(OlJfGq`YsFy7WISlWhG5IS=|94P9H#RJ%DZOG^!h*sD{n$N*!Q zPCQd`?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g;x|^%cXU^7p{^94*Pkf^^Tuh`?sfFIx~!io}IYr)Z|kY z|E;ygnn+)w+(~ee?W^o5KNnBBmxR+vN4<#WT4SBcOLncZ#yWQJFE!R7-RD?5 zI_-xxmE$5Cjn5rBVzw`t$DIO3;wTbD@R1+w?>~LaCTHF+C0kjCJ~x;|xj; z!1?5GVrB{v5fKp)5fKp)37x%8?Rb@fNYPtVcD1Wg5GiseB42WAG^tHQL_|bHMC8i) YAM&F6TUPcv6aWAK07*qoM6N<$g6+vnc>n+a literal 0 HcmV?d00001 diff --git a/blogs/clicky-images-in-blogs.js b/blogs/clicky-images-in-blogs.js new file mode 100644 index 0000000..a3c489d --- /dev/null +++ b/blogs/clicky-images-in-blogs.js @@ -0,0 +1,127 @@ + +/** + * + * @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"); + +// 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", () => { + 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"; + checkRedirect(" "); + }); + + 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"; + checkRedirect("d"); + }); + + dpoImg.addEventListener("mouseup", () => { + dpoImg.src = "../Pictures/dpolakovic.png"; + }); + + dpoImg.addEventListener("mouseleave", () => { + dpoImg.src = "../Pictures/dpolakovic.png"; + }); +} + +// Keyboard behavior +document.addEventListener("keydown", (event) => { + keysPressed[event.key] = true; + + if (dotImg && event.key === ".") { + dotImg.src = "../Pictures/dot2.png"; + } + if (spaceImg && event.key === " ") { + spaceImg.src = "../Pictures/space2.png"; + } + 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) => { + delete keysPressed[event.key]; + + if (dotImg && event.key === ".") { + dotImg.src = "../Pictures/dot.png"; + } + if (spaceImg && event.key === " ") { + spaceImg.src = "../Pictures/space.png"; + } + if (dpoImg && event.key === "d") { + dpoImg.src = "../Pictures/dpolakovic.png"; + } +}); + diff --git a/blogs/javascript.html b/blogs/javascript.html new file mode 100755 index 0000000..dc8a3fc --- /dev/null +++ b/blogs/javascript.html @@ -0,0 +1,119 @@ + + + + + + + "This site uses client-side scripting" + + + + + + + + + + + + + + +
+

+

This site uses client-side scripting

+ 5 Jun 2025 - Spooky, scary JavaScript update. +
+

+ + Jerry about to be eaten by Tom +

+

+ 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. +

+
+
+
+ + +
+ Copyright 2025 David Polakovic - + This publication is licensed under + CC BY-SA 4.0. +
+ 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 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. -

-

-

- Download +

+

+

+Download (12.7kb) / - Source code -
-

-
-
-
-

- +Source code +

+

+
+

+ 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. - -

-
-
+ +

+
+ - -
+ +
Copyright David Polakovic - 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. -
-

- - - +CC BY-SA 4.0. +
+ This site uses client-side scripting. Please, read the source code +here for more information. +
+

+ + \ No newline at end of file diff --git a/ro.php b/ro.php new file mode 100755 index 0000000..3217937 --- /dev/null +++ b/ro.php @@ -0,0 +1,100 @@ + + + + + + dpolakovic.biza + + + + + + + + + + + + + + + +
+

+

Giyo tagab

+ Sit ac is erken in! +
+
+ Abe rokab ela + David + ud al ela Ro ro robit + iv abe rabali web biza. Ab neli vev ag uyid gizit, ub + avit ab vev, ag gizit hek camib cid iv abe ladup ta. + Ac eluk relidek ay iv abe ugz, abe uyil lajog git ramibaf + ur ac aluk eca alid ud dotac al cednob.

+
+ cool dancing alien +
+

+

+ Ab neli vev sicu jivabz, alif uf ac hib col ir ab, + ac elul vev E-pipac. Ab rur abe pipac-pejab lacik gizit + alif ab fafac kimerem in zab taf. + Rek ladup eb vev abaque GPG patab rubigeb ace pipalz. +

+

+

+ email@dpolakovic.space +   + Kalibev abe GPG patab +   + (Avif vev GPG petab?) +
+

+

+

+
+

+ + the glider + +

+ + +
+ + GIF button: html and php only + +
+

+
+ + +
+ Ob-rul-sob David Polakovic - + Pipalz if alz dafz hab + CC BY-SA 4.0. +
+ Al daf viv JavaScript. Sec, rur at +jedac is cik rocab. +
+ + diff --git a/rss.xml b/rss.xml index 553d1e2..da432d1 100755 --- a/rss.xml +++ b/rss.xml @@ -6,48 +6,66 @@ Some obscure thoughts caught on the Web. en-us + + This site uses client-side scripting + https://www.dpolakovic.space/blogs/javascript.html + Spooky, scary JavaScript update. + Thu, 5 Jun 2025 22:00:00 GMT + https://www.dpolakovic.space/blogs/pics/jst.jpg + 100% 1 + + + + Stormtrooper's guide to Galaxies + https://www.dpolakovic.space/blogs/star-wars-galaxies + "You seen that new VT-16?" + Wed, 26 Mar 2025 15:00:00 GMT + https://www.dpolakovic.space/blogs/pics/sw5.jpg + 100% 1 + + The Phantom Menace is good - https://dpolakovic.space/blogs/phantom-menace + https://www.dpolakovic.space/blogs/phantom-menace An inevitable STAR WARS rant. Sun, 18 Aug 2024 17:00:00 GMT - https://dpolakovic.space/blogs/pics/starwars26.jpg + https://www.dpolakovic.space/blogs/pics/starwars26.jpg 100% 1 Y292B bug - https://dpolakovic.space/blogs/y292b + https://www.dpolakovic.space/blogs/y292b We're doomed! Again... Wed, 26 Jun 2024 17:00:00 GMT - https://dpolakovic.space/blogs/pics/bug.jpg + https://www.dpolakovic.space/blogs/pics/bug.jpg 100% 0 Reproducing the printer hack of Windows 95 - https://dpolakovic.space/blogs/windows-95-printer-hack + https://www.dpolakovic.space/blogs/windows-95-printer-hack Start me up! Fri, 12 Apr 2024 16:00:00 GMT - https://dpolakovic.space/blogs/pics/deskjet710c.jpg + https://www.dpolakovic.space/blogs/pics/deskjet710c.jpg 100% 5 Let's play Zork - https://dpolakovic.space/blogs/zork + https://www.dpolakovic.space/blogs/zork A hollow voice says "Fool". Fri, 24 Nov 2023 20:00:00 GMT - https://dpolakovic.space/blogs/pics/zork.png + https://www.dpolakovic.space/blogs/pics/zork.png 100% 1 On the nature of Free software - https://dpolakovic.space/blogs/free-software + https://www.dpolakovic.space/blogs/free-software Does your synthetic colleague pose a threat to you? Tue, 25 Jul 2023 20:00:00 GMT - https://dpolakovic.space/blogs/pics/free2.jpg + https://www.dpolakovic.space/blogs/pics/free2.jpg 100% 0 -- 2.30.2