tianyun 2 năm trước cách đây
mục cha
commit
962513d875
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 3 1
      simple-demo/webp.html
  2. 2 2
      tmp.js

+ 3 - 1
simple-demo/webp.html

@@ -13,7 +13,7 @@
 </head>
 <body>
 <h1>粘贴图片并展示</h1>
-<p>右键粘贴图片,本地图片或网络图片地址都可以,将被压缩为webp格式并展示</p>
+<p>右键粘贴图片,本地图片或网络图片地址都可以,将被压缩为webp格式并展示<span id="status"></span></p>
 <div id="image-container">
     <img id="image-display" src="" alt="Image Display">
 </div>
@@ -37,6 +37,7 @@
 
                 // 将图片展示
                 imageDisplay.src = imageUrl;
+                document.getElementById("status").innerText = " 压缩中……";
 
                 // 压缩为webp格式
                 const image = new Image();
@@ -50,6 +51,7 @@
                         // 将压缩后的webp图片展示在页面上
                         const webpUrl = URL.createObjectURL(webpBlob);
                         imageDisplay.src = webpUrl;
+                        document.getElementById("status").innerText = " 已压缩☺";
 
                     }, "image/webp", 0.8);
                 };

+ 2 - 2
tmp.js

@@ -1,3 +1,3 @@
 setInterval(()=>{
-    document.querySelector(".next-btn-primary").click();
-},2000)
+    location.reload();
+},60000)