From b3608aa1e215bc72f44fbe8b8ae41f107bfd6171 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 17:04:24 +0200 Subject: [PATCH 01/11] add codeberg link --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1fc530c..b60f662 100644 --- a/index.html +++ b/index.html @@ -200,7 +200,7 @@

You can check the source code by downloading the page (everything is stored in a single html file), - by going to your browser's devtools or on codeberg. + by going to your browser's devtools or on Codeberg.

From 51cc45adff784bc63ac37db9c9e855e7b7f1f320 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 17:21:28 +0200 Subject: [PATCH 02/11] more style changes --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b60f662..43fa553 100644 --- a/index.html +++ b/index.html @@ -116,6 +116,7 @@ font-family: monospace; } main { + background-color: #202025; padding: 1em; border: 1px solid white; width: 50%; border-radius: 1em; @@ -133,6 +134,7 @@ border: 1px solid white; padding: 0.5em; border-radius: 0em 1em 1em 1em; + box-shadow: 0px 5px 15px black; } .result:empty { display: none;} .result { @@ -153,7 +155,7 @@ transition: box-shadow 200ms ease; } .button:hover { - box-shadow: 1px 5px 15px black; + box-shadow: 0px 5px 25px black; } .button:active { background-color: rgba(255,255,255, 0.2); From be40b8503cb7be81c7f80d29ed2acc4eafd20106 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 17:28:09 +0200 Subject: [PATCH 03/11] Add README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5776f8d --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# infohash ↔ base64 tool + +You can check the tool at + (requires javascript) + +This tool was made to work with +[an suggestion posted by @toxictenement@lemmy.dbzer0.com](https://lemmy.dbzer0.com/post/1009713) +by [magmaus3](https://magmaus3.eu.org). + +You can check the source code by downloading the page +(everything is stored in a single html file), +by going to your browser's devtools or on [Codeberg](https://codeberg.org/magmaus3/infohash2base64). From 6a4b576a8196e31752d437f6d31964dd926788f5 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 17:37:34 +0200 Subject: [PATCH 04/11] Even more style changes --- index.html | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 43fa553..ee43659 100644 --- a/index.html +++ b/index.html @@ -109,8 +109,11 @@ @@ -194,18 +203,15 @@
-
-

About

-

- This tool was made to work with an suggestion posted by @toxictenement@lemmy.dbzer0.com - by magmaus3. -

-

- You can check the source code by downloading the page (everything is stored in a single html file), - by going to your browser's devtools or on Codeberg. -

-
-
+

About

+

+ This tool was made to work with an suggestion posted by @toxictenement@lemmy.dbzer0.com + by magmaus3. +

+

+ You can check the source code by downloading the page (everything is stored in a single html file), + by going to your browser's devtools or on Codeberg. +

From 206b295268890f25ccd292cbff44d49f9cfe5ea2 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 18:24:05 +0200 Subject: [PATCH 05/11] more changes --- index.html | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index ee43659..a45fe70 100644 --- a/index.html +++ b/index.html @@ -69,6 +69,9 @@ function switchTab(name) { // Switches the tab // only "encode","decode" and "about" values are supported + let url = new URL(window.location) + url.searchParams.set("tab", name) + window.history.replaceState(null, "", url.href) if (name === "encode") { document.getElementById("encode").style.display = "block" document.getElementById("decode").style.display = "none" @@ -112,7 +115,7 @@ width: 100vw; height: 100vh; margin: 0; padding: 0; display: flex; flex-direction: column; - justify-content: center; text-align: center; + justify-content: center; align-items: center; background-color: #10101a; color: white; @@ -123,20 +126,18 @@ padding: 1em; border: 1px solid white; border-radius: 1em; - width: fit-content; box-shadow: 0px 5px 15px black, 0px 1px 15px black inset; } input { color: white; background-color: transparent; - border: 1px solid #50505a; + border: 1px solid white; } label { margin-right: 0.5rem; } .tab { - display: none; /* Default value to keep tabs hidden when JS is not available */ border: 1px solid white; padding: 1em; border-radius: 0em 1em 1em 1em; @@ -150,9 +151,8 @@ border: 1px solid gray; border-radius: 1em; } - .tabBar { + .tab, .tabBar { display: none; /* Default value to keep tabs hidden when JS is not available */ - border-collapse: collapse; } .button { padding: 0.5em; @@ -160,6 +160,9 @@ border-bottom: none; transition: box-shadow 200ms ease; } + .leftButton { + border-radius: 1em 0em 0em 0em; + } .button:hover { box-shadow: 0px 5px 25px black; } @@ -180,9 +183,9 @@ You can use DevTools in your browser to look at the code (it's intended to be easily readable).
-
Encode
+
Encode
Decode
-
About
+
About
From 97215d42654ca4fea8fe60a7fd4b6f79b498e8e5 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Mon, 24 Jul 2023 18:53:22 +0200 Subject: [PATCH 06/11] Reduce the amount of functions on the backend Instead of using separate functions for each step (hex -> bytearray -> base64 and the opposite), this commit merges the required functions into their uses. --- index.html | 54 +++++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index a45fe70..c58c95c 100644 --- a/index.html +++ b/index.html @@ -7,58 +7,42 @@