From a4c5f99c913728509190eb667a0063b8ad0955c6 Mon Sep 17 00:00:00 2001 From: haruyan-hopemucci Date: Wed, 6 Dec 2023 21:46:15 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E3=83=86=E3=82=AD=E3=82=B9?= =?UTF-8?q?=E3=83=88=E4=BD=8D=E7=BD=AE=E3=83=A9=E3=82=B8=E3=82=AA=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/index.html b/docs/index.html index 3a4cc2a..b363327 100644 --- a/docs/index.html +++ b/docs/index.html @@ -35,6 +35,21 @@

LGTN Generator v0.4.0

+
+
+ + +
+
+ + +
+
+ + +
+
From 514c83056b8e8ca623a1baf18574cbfd618dfb60 Mon Sep 17 00:00:00 2001 From: haruyan-hopemucci Date: Wed, 6 Dec 2023 22:04:40 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E3=83=86=E3=82=AD=E3=82=B9?= =?UTF-8?q?=E3=83=88=E4=BD=8D=E7=BD=AE=E3=81=AE=E6=8F=8F=E7=94=BB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/js/app.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/js/app.js b/docs/js/app.js index 30c89b4..130d8d6 100644 --- a/docs/js/app.js +++ b/docs/js/app.js @@ -1,18 +1,24 @@ "use strict"; +const textPositionOffset = { + top: [0, -100], + middle: [0, 0], + bottom: [0, 120], +} + $(function () { var gCanvas = document.querySelector("canvas#output-image"); var gPastedImage = document.querySelector("img#pasted-image"); const selectedOverlayImageValue = () => document.querySelector('input[name="chooseOverlay"]:checked').value; const getOverlayImage = () => document.querySelector(`img#img__${selectedOverlayImageValue()}`); - + const getTextPosition = () => document.querySelector('input[name="textPosition"]:checked').value const setMessage = (message) => { const elem = document.querySelector("#paste-area-message"); elem.textContent = message; }; - $('input[name="chooseOverlay"]').on("change", (event) => { + $('input[name="chooseOverlay"], input[name="textPosition"]').on("change", (event) => { if (gPastedImage.src) { setMessage(`${selectedOverlayImageValue()}画像を再生成しています...`); redrawLgtnImage(); @@ -90,10 +96,12 @@ $(function () { drawWidth = (imgWidth * drawHeight) / imgHeight; drawX = (canvas.width - drawWidth) / 2; } - + + // テキスト描画位置の決定 + const [drawTextX, drawTextY] = textPositionOffset[getTextPosition()] context.clearRect(0, 0, canvas.width, canvas.height); context.drawImage(imgEl, drawX, drawY, drawWidth, drawHeight); - context.drawImage(lgtnEl, 0, 0, canvas.width, canvas.height); + context.drawImage(lgtnEl, drawTextX, drawTextY, canvas.width, canvas.height); copyImageToClipboard(canvas); }; From f4bae7a28118ea7109040d819464d6cacced3002 Mon Sep 17 00:00:00 2001 From: haruyan-hopemucci Date: Wed, 6 Dec 2023 22:05:34 +0900 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E7=95=AA=E5=8F=B7up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index b363327..156c7da 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,7 +19,7 @@
-

LGTN Generator v0.4.0

+

LGTN Generator v0.5.0

クリップボードにコピーした画像をペーストしてください。