JAL-4059 Improvement to launch indicator
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 14 Dec 2023 12:38:15 +0000 (12:38 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 14 Dec 2023 12:38:15 +0000 (12:38 +0000)
src/jalview/util/JalviewJSUtil.java
utils/jalviewjs/site-resources/index.html [new file with mode: 0644]
utils/jalviewjs/site-resources/jalviewjs-core.html
utils/jalviewjs/site-resources/jalviewjs.html

index 15bf400..f46014b 100644 (file)
@@ -324,6 +324,10 @@ public class JalviewJSUtil
       final String splashClassInactive = nsu + "jalviewjsSplashInactive";
       final String splashClassFinal = nsu + "jalviewjsSplashFinal";
       final String j2s_overflow = JalviewJSUtil.getJ2sInfoValue("overflow");
+
+      int hideSplashDelayMS = 5000;
+      final Object j2s_hideSplashDelay = JalviewJSUtil
+              .getJ2sInfoValue("hideSplashDelay");
       /**
        * @j2sNative // splash element disappearance
        * 
@@ -343,7 +347,16 @@ public class JalviewJSUtil
        * 
        *            async function hideSplash() {
        * 
-       *            await sleep(5000);
+       *            var hideSplashDelay =
+       *            J2S.thisApplet.__Info.j2s_hideSplashDelay;
+       * 
+       *            if (hideSplashDelay === undefined) {
+       * 
+       *            hideSplashDelay = 20000; // 20s default
+       * 
+       *            }
+       * 
+       *            await sleep(hideSplashDelay);
        * 
        *            splashElement.classList.add(splashClassFinal);
        * 
diff --git a/utils/jalviewjs/site-resources/index.html b/utils/jalviewjs/site-resources/index.html
new file mode 100644 (file)
index 0000000..9605bd8
--- /dev/null
@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>jalviewjs.html and jalviewjs-core.html examples</title>
+</head>
+<body>
+<h1>jalviewjs.html and jalviewjs-core.html examples with new CLI style query parameters</h1>
+<ul>
+<li>
+<a href="http://localhost:8000/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">http://localhost:8000/jalviewjs.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
+</li>
+<li>
+<a href="http://localhost:8000/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true">http://localhost:8000/jalviewjs-core.html?jv:open=examples/plantfdx.fa&amp;jv:colour=gecos-ocean&amp;jv:structure=../../examples/AF-P00221-F1-model_v4.pdb&amp;jv:seqid=FER1_SPIOL&amp;jv:tempfac=plddt&amp;jv:paematrix=../../examples/AF-P00221-F1-predicted_aligned_error_v4.json&amp;jv:noshowannotations&amp;jv:debug=true</a>
+</li>
+</ul>
+</body>
+</html>
index b22caf1..e7f82f0 100644 (file)
@@ -6,7 +6,7 @@
 <script src="swingjs/swingjs2.js"></script>
 <script>
 if (!self.SwingJS)alert('swingjs2.js was not found. It needs to be in swingjs folder in the same directory as ' + document.location.href)
-Info = {
+jv_Info = {
   code: null,
   main: "jalview.bin.JalviewJS",
   core: "_jalview",
@@ -21,7 +21,7 @@ Info = {
   allowjavascript: true,
   // all j2s_... values can be accessed in JalviewJSUtil.getInstance().getJSInfoValue(key)
   j2s_namespace: "jv",
-  j2s_overflow: true
+  j2s_overflow: true,
 }
 </script>
 <style>
@@ -34,28 +34,31 @@ Info = {
   }
 }
 .jv_jalviewjsSplashRotate {
-  animation: rotation 6s infinite cubic-bezier(0.4, 0.6, 0.6, 0.4);
+  animation-name: rotation;
+  animation-iteration-count: 150;
+  animation-duration: 4s;
+  animation-timing-function: cubic-bezier(0.4, 0.6, 0.6, 0.4);
 }
 .jv_jalviewjsSplashActive {
   display: visible;
   opacity: 100%;
+  animation-fill-mode: forwards;
 }
 .jv_jalviewjsSplashInactive {
   animation-iteration-count: 1;
-  animation-fill-mode: forwards;
-  opacity: 30%;
+  opacity: 20%;
   transition: all 1s;
-  z-index: 100;
 }
 .jv_jalviewjsSplashFinal {
+  animation: none;
+  opacity: 20%;
   z-index: -1;
-  opacity: 30%;
 }
 </style>
 </head>
 <body>
 <script>
-SwingJS.getApplet('jalviewjs', Info);
+SwingJS.getApplet('jalviewjs', jv_Info);
 getClassList = function(){J2S._saveFile('_j2sclasslist.txt', Clazz.ClassFilesLoaded.sort().join('\n'))};
 </script>
 <div style="position:absolute;left:10px;top:10px;width:640px;height:1200px;">
index 34b24c8..d735f00 100644 (file)
@@ -6,7 +6,7 @@
 <script src="swingjs/swingjs2.js"></script>
 <script>
 if (!self.SwingJS)alert('swingjs2.js was not found. It needs to be in swingjs folder in the same directory as ' + document.location.href)
-Info = {
+jv_Info = {
   code: null,
   main: "jalview.bin.JalviewJS",
   core: "NONE",
@@ -21,7 +21,7 @@ Info = {
   allowjavascript: true,
   // all j2s_... values can be accessed in JalviewJSUtil.getInstance().getJSInfoValue(key)
   j2s_namespace: "jv",
-  j2s_overflow: true
+  j2s_overflow: true,
 }
 </script>
 <style>
@@ -34,28 +34,31 @@ Info = {
   }
 }
 .jv_jalviewjsSplashRotate {
-  animation: rotation 6s infinite cubic-bezier(0.4, 0.6, 0.6, 0.4);
+  animation-name: rotation;
+  animation-iteration-count: 150;
+  animation-duration: 4s;
+  animation-timing-function: cubic-bezier(0.4, 0.6, 0.6, 0.4);
 }
 .jv_jalviewjsSplashActive {
   display: visible;
   opacity: 100%;
+  animation-fill-mode: forwards;
 }
 .jv_jalviewjsSplashInactive {
-  animation-iteration-count: 1;
-  animation-fill-mode: forwards;
-  opacity: 30%;
+  animation-iteration-count: 2;
+  opacity: 20%;
   transition: all 1s;
-  z-index: 100;
 }
 .jv_jalviewjsSplashFinal {
+  animation: none;
+  opacity: 20%;
   z-index: -1;
-  opacity: 30%;
 }
 </style>
 </head>
 <body>
 <script>
-SwingJS.getApplet('jalviewjs', Info);
+SwingJS.getApplet('jalviewjs', jv_Info);
 getClassList = function(){J2S._saveFile('_j2sclasslist.txt', Clazz.ClassFilesLoaded.sort().join('\n'))};
 </script>
 <div style="position:absolute;left:10px;top:10px;width:640px;height:1200px;">