فهرست منبع

fix `set_env(output_animation=False)` not work for image

wangweimin 2 سال پیش
والد
کامیت
b57cac446b
2فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 5 0
      pywebio/html/css/app.css
  2. 5 0
      webiojs/src/handlers/env.ts

+ 5 - 0
pywebio/html/css/app.css

@@ -127,6 +127,11 @@ img {
     animation-duration: .6s
 }
 
+.no-animation img {
+    -webkit-animation-name: none;
+    animation-name: none
+}
+
 @-webkit-keyframes image-load-in {
     0% {
         -webkit-filter: blur(8px);

+ 5 - 0
webiojs/src/handlers/env.ts

@@ -19,6 +19,11 @@ export class EnvSettingHandler implements CommandHandler {
 
         if (spec.output_animation !== undefined) {
             config.outputAnimation = spec.output_animation;
+            if(!spec.output_animation){
+                document.body.classList.add('no-animation');
+            }else{
+                document.body.classList.remove('no-animation');
+            }
         }
 
         if (spec.http_pull_interval !== undefined) {