From ed9801d9dbd38748457be4edb7b824cd31a30bae Mon Sep 17 00:00:00 2001 From: Luthics Date: Sat, 24 Dec 2022 00:05:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E7=94=BB=E6=A8=A1=E5=BC=8F=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +--- main.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 21a4aab..2ddb06a 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,6 @@
点击缩放
-
点击缩放
指定比例缩放
@@ -46,12 +45,11 @@
点击缩放
-
点击缩放
趣味功能
马赛克化
-
动画模式
+
动画模式
下载
diff --git a/main.js b/main.js index 3d0b4b0..d3beb4a 100644 --- a/main.js +++ b/main.js @@ -3,6 +3,7 @@ let canvass = [], imgs = [] let pic_info let multi let imgh = [0, 0, 0] +let ani_mode = 0 let vh = window.innerHeight / 100; let vw = window.innerWidth / 100;; @@ -157,6 +158,7 @@ function processFiles(files) { if (canvas.width > 60 * vw) image.setAttribute("width", 60 * vw + "px") document.getElementById("c1").appendChild(image) document.getElementById("c1").style.width = 70 * vw + "px" + document.getElementById("c1").style['justify-content'] = "center" imgs.push(image); @@ -309,4 +311,14 @@ function saveImg() { saveAs(blob, "yiipic.png"); }); } +} + +function animatePic() { + ani_mode = !ani_mode + if(ani_mode){ + document.getElementById("ani_but").style.color = "red" + } + else { + document.getElementById("ani_but").style.color = "black" + } } \ No newline at end of file