]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Add hint that the control bar can be moved
authorSamuel Mannehed <samuel@cendio.se>
Mon, 22 May 2017 06:24:41 +0000 (08:24 +0200)
committerSamuel Mannehed <samuel@cendio.se>
Mon, 29 May 2017 13:57:13 +0000 (15:57 +0200)
The control bar can be dragged to the other side, this isn't obvious
however. This adds a hint on the opposite side in the form of a subtle
glowing half-ellipse.

app/styles/base.css
app/ui.js
vnc.html

index ce31cf7edbde65475776fdf8a13cce664fd0f7dd..dbab5ddf0ba11d1b81e7947f6850a516bb226b62 100644 (file)
@@ -402,6 +402,35 @@ select:active {
   padding: 0 5px 0 10px;
 }
 
+/* Control bar hint */
+#noVNC_control_bar_hint {
+  position: fixed;
+  left: calc(100vw - 50px);
+  right: auto;
+  width: 100px;
+  height: 50%;
+  max-height: 600px;
+
+  visibility: hidden;
+  opacity: 0;
+  transition: 0.2s ease-in-out;
+  background: transparent;
+  box-shadow: 0 0 10px black, inset 0 0 10px 10px rgba(110, 132, 163, 0.8);
+  border-radius: 10px;
+  transition-delay: 0s;
+  transform: scale(0);
+}
+#noVNC_control_bar_anchor.noVNC_right #noVNC_control_bar_hint{
+  left: auto;
+  right: calc(100vw - 50px);
+}
+#noVNC_control_bar_hint.noVNC_active {
+  visibility: visible;
+  opacity: 1;
+  transition-delay: 0.2s;
+  transform: scale(1);
+}
+
 /* General button style */
 .noVNC_button {
   display: block;
index 0d6a65784a75ee75dc2c8c12e0a5dde0785275ee..e4ba3d22309e0747949d4802b3b23d4a676e957b 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
@@ -627,6 +627,15 @@ const UI = {
         UI.controlbarDrag = true;
     },
 
+    showControlbarHint: function (show) {
+        var hint = document.getElementById('noVNC_control_bar_hint');
+        if (show) {
+            hint.classList.add("noVNC_active");
+        } else {
+            hint.classList.remove("noVNC_active");
+        }
+    },
+
     dragControlbarHandle: function (e) {
         if (!UI.controlbarGrabbed) return;
 
@@ -722,6 +731,7 @@ const UI = {
             UI.activateControlbar();
         }
         UI.controlbarGrabbed = false;
+        UI.showControlbarHint(false);
     },
 
     controlbarHandleMouseDown: function(e) {
@@ -740,6 +750,8 @@ const UI = {
         UI.controlbarGrabbed = true;
         UI.controlbarDrag = false;
 
+        UI.showControlbarHint(true);
+
         UI.controlbarMouseDownClientY = ptr.clientY;
         UI.controlbarMouseDownOffsetY = ptr.clientY - bounds.top;
         e.preventDefault();
index 6cb4be4d497a6c6854e298b3cebd73117339ec62..0109ce69d8efdf3716b57d1548de9946cd0ca493 100644 (file)
--- a/vnc.html
+++ b/vnc.html
             </div>
         </div>
 
+        <div id="noVNC_control_bar_hint"></div>
+
     </div> <!-- End of noVNC_control_bar -->
 
     <!-- Status Dialog -->