From 6c9a97c590d7a3020fdb7c9c9cc5d69e0d48d81b Mon Sep 17 00:00:00 2001
From: Ferry Ayunda <135429317+kisahklasik@users.noreply.github.com>
Date: Mon, 5 Aug 2024 00:56:07 +0700
Subject: [PATCH] Update index.html
---
index.html | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/index.html b/index.html
index 683f25f..a86715e 100644
--- a/index.html
+++ b/index.html
@@ -120,16 +120,11 @@
Example Twibbon
// combine image
function gen() {
-// let baseIMG = document.getElementById("avatar");
-// let overlayIMG = document.getElementById("frame");
-// let canvas = document.getElementById("result");
-// let context = canvas.getContext("2d");
-
-var baseIMG = document.getElementById("avatar"),
- overlayIMG = document.getElementById("frame"),
- canvas = document.getElementById("result"),
-// context = canvas.getContext("2d");
- imagePosition;
+let baseIMG = document.getElementById("avatar");
+let overlayIMG = document.getElementById("frame");
+let canvas = document.getElementById("result");
+let context = canvas.getContext("2d");
+ imagePosition;
// canvas.width = 1024;
// canvas.height = 1024;
@@ -140,9 +135,7 @@ Example Twibbon
bImage.style.backgroundImage = 'url(' + image.src + ')';
imagePosition = canvasImageCoverPosition(baseIMG.naturalWidth, baseIMG.naturalHeight , canvas2.width, canvas2.height);
-
-// canvas1.getContext('2d').drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight);
-canvas.getContext('2d').drawImage(baseIMG, imagePosition.offsetLeft, imagePosition.offsetTop, imagePosition.width, imagePosition.height);
+context.drawImage(baseIMG, imagePosition.offsetLeft, imagePosition.offsetTop, imagePosition.width, imagePosition.height);
// Download
function dlPNG() {