From 14f80f0fb8b781d03a0f8607c60aff0596954933 Mon Sep 17 00:00:00 2001 From: ZennDev1337 Date: Tue, 22 Aug 2023 14:51:41 +0200 Subject: [PATCH] Docs update for mobile --- docs/image-converter.html | 728 ++++--- docs/index.html | 343 ++-- docs/sprite-converter.html | 3740 ++++++++++++++++++------------------ docs/tile-converter.html | 918 +++++---- 4 files changed, 2864 insertions(+), 2865 deletions(-) diff --git a/docs/image-converter.html b/docs/image-converter.html index 04239b1..3d67029 100644 --- a/docs/image-converter.html +++ b/docs/image-converter.html @@ -1,401 +1,397 @@ - - - ZennDev1337 Image Converter - - - -
- -
-

Drop your image here

-
-
-
-
-
-
-
- - - + - - + // Print the column in hex notation, add a comma for formatting + var digitStr = spriteByte.toString(16); + if (digitStr.length == 1) { + digitStr = "0" + digitStr; + } + spriteString += "0x" + digitStr + ", "; + if ( + currentByte % droppedImage.naturalWidth == + droppedImage.naturalWidth - 1 + ) { + spriteString += "\n"; + } + currentByte++; + } + } + // Terminate the array + spriteString += "];"; + // Create an invisible element containing the string + droppedImageCode.innerHTML = spriteString; + + // Resize canvas to show 2x scaled image + droppedImageCanvas.width = + droppedImage.naturalWidth * 2; + droppedImageCanvas.height = + droppedImage.naturalHeight * 2; + droppedImageContext = + droppedImageCanvas.getContext("2d"); + droppedImageContext.imageSmoothingEnabled = false; + droppedImageContext.drawImage( + droppedImage, + 0, + 0, + droppedImage.naturalWidth * 2, + droppedImage.naturalHeight * 2 + ); + }, 50); + }; + reader.readAsDataURL(imageData); + } + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6e059b9..eccccd0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,175 +1,185 @@ - - - ZennDev1337 Sprite Converter - - - -
- - + .topnav a.icon { + float: right; + display: block; + } + } + + @media screen and (max-width: 810px) { + .topnav.responsive { + position: relative; + height: 188px; + } + + .topnav.responsive a.icon { + position: absolute; + right: 0; + top: 0; + } + + .topnav.responsive a { + float: none; + display: block; + text-align: left; + } + } + + iframe { + width: 100vw; + border: none; + height: calc(100vh - 110px); + } + +
+ + + - - + + + \ No newline at end of file diff --git a/docs/sprite-converter.html b/docs/sprite-converter.html index 451de0a..0a04f06 100644 --- a/docs/sprite-converter.html +++ b/docs/sprite-converter.html @@ -1,1956 +1,1952 @@ - - - ZennDev1337 Sprite Converter - - - -
- -
-

Drop your sprite here

-
-
-
-
-
-
+ + .topnav.responsive a.icon { + position: absolute; + right: 0; + top: 0; + } + + .topnav.responsive a { + float: none; + display: block; + text-align: left; + } + } + +
+ +
+

Drop your sprite here

+
+
+
+
+
+
+
- - - + - + - + - + - - + + - - + // Put the code in the text field + droppedImageCode.innerHTML = spriteString; + droppedMaskCode.innerHTML = maskString; + droppedComboCode.innerHTML = comboString; + }, 50); + }; + reader.readAsDataURL(imageData); + } + + + + \ No newline at end of file diff --git a/docs/tile-converter.html b/docs/tile-converter.html index 39dce79..d2e4132 100644 --- a/docs/tile-converter.html +++ b/docs/tile-converter.html @@ -1,487 +1,483 @@ - - - ZennDev1337 Tile Converter - - - -
- -
-

Drop your tile sheet here

-
-
-
-
-
-
-
- - - + - - + } + // Terminate the array + spriteString += "];"; + // Create an invisible element containing the string + droppedImageCode.innerHTML = spriteString; + }, 50); + }; + reader.readAsDataURL(imageData); + } + + + + \ No newline at end of file