]> git.proxmox.com Git - mirror_novnc.git/blobdiff - app/styles/base.css
Use transition animation while loading
[mirror_novnc.git] / app / styles / base.css
index 51ba9396a9dd5c98698ae4c5de4e76f0c07f6d6f..4cec17357791540db2fa686d80b98111f87ff801 100644 (file)
@@ -7,6 +7,20 @@
  * This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
  */
 
+/*
+ * Z index layers:
+ *
+ * 0: Main screen
+ * 10: Control bar
+ * 50: Transition blocker
+ * 60: Connection popups
+ * 100: Status bar
+ * ...
+ * 1000: Javascript crash
+ * ...
+ * 10000: Max (used for polyfills)
+ */
+
 body {
   margin:0;
   padding:0;
@@ -27,6 +41,10 @@ html {
   display: none;
 }
 
+.noVNC_disabled {
+  color: rgb(128, 128, 128);
+}
+
 /* ----------------------------------------
  * Spinner
  * ----------------------------------------
@@ -38,24 +56,27 @@ html {
 .noVNC_spinner, .noVNC_spinner::before, .noVNC_spinner::after {
   width: 10px;
   height: 10px;
-  border-radius: 50%;
-  animation: noVNC_spinner 1.0s ease-in-out alternate infinite;
+  border-radius: 2px;
+  animation: noVNC_spinner 1.0s linear infinite;
 }
 .noVNC_spinner::before {
   content: "";
   position: absolute;
-  left: -20px;
-  animation-delay: -0.2s;
+  left: 0px;
+  top: 0px;
+  animation-delay: -0.1s;
 }
 .noVNC_spinner::after {
   content: "";
   position: absolute;
-  left: 20px;
-  animation-delay: 0.2s;
+  top: 0px;
+  left: 0px;
+  animation-delay: 0.1s;
 }
 @keyframes noVNC_spinner {
-  0% { box-shadow: 0 10px 0 white; }
-  100% { box-shadow: 0 30px 0 white; }
+  0% { box-shadow: -60px 10px 0 rgba(255, 255, 255, 0); width: 20px; }
+  25% { box-shadow: 20px 10px 0 rgba(255, 255, 255, 1); width: 10px; }
+  50% { box-shadow: 60px 10px 0 rgba(255, 255, 255, 0); width: 10px; }
 }
 
 /* ----------------------------------------
@@ -63,7 +84,8 @@ html {
  * ----------------------------------------
  */
 
-input[type=input], input[type=password], input:not([type]), textarea {
+input[type=input], input[type=password], input[type=number],
+input:not([type]), textarea {
   /* Disable default rendering */
   -webkit-appearance: none;
   -moz-appearance: none;
@@ -77,7 +99,7 @@ input[type=input], input[type=password], input:not([type]), textarea {
   background: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240));
 }
 
-input[type=button], select {
+input[type=button], input[type=submit], select {
   /* Disable default rendering */
   -webkit-appearance: none;
   -moz-appearance: none;
@@ -95,7 +117,7 @@ input[type=button], select {
   vertical-align: middle;
 }
 
-input[type=button] {
+input[type=button], input[type=submit] {
   padding-left: 20px;
   padding-right: 20px;
 }
@@ -107,29 +129,35 @@ option {
 
 input[type=input]:focus, input[type=password]:focus,
 input:not([type]):focus, input[type=button]:focus,
+input[type=submit]:focus,
 textarea:focus, select:focus {
   box-shadow: 0px 0px 3px rgba(74, 144, 217, 0.5);
   border-color: rgb(74, 144, 217);
   outline: none;
 }
 
-input[type=button]::-moz-focus-inner {
+input[type=button]::-moz-focus-inner,
+input[type=submit]::-moz-focus-inner {
   border: none;
 }
 
 input[type=input]:disabled, input[type=password]:disabled,
 input:not([type]):disabled, input[type=button]:disabled,
+input[type=submit]:disabled, input[type=number]:disabled,
 textarea:disabled, select:disabled {
   color: rgb(128, 128, 128);
   background: rgb(240, 240, 240);
 }
 
-input[type=button]:active, select:active {
+input[type=button]:active, input[type=submit]:active,
+select:active {
   border-bottom-width: 1px;
   margin-top: 3px;
 }
 
-:root:not(.noVNC_touch) input[type=button]:hover:not(:disabled), :root:not(.noVNC_touch) select:hover:not(:disabled) {
+:root:not(.noVNC_touch) input[type=button]:hover:not(:disabled),
+:root:not(.noVNC_touch) input[type=submit]:hover:not(:disabled),
+:root:not(.noVNC_touch) select:hover:not(:disabled) {
   background: linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250));
 }
 
@@ -172,6 +200,15 @@ input[type=button]:active, select:active {
   pointer-events: auto;
 }
 
+/* ----------------------------------------
+ * Layering
+ * ----------------------------------------
+ */
+
+.noVNC_connect_layer {
+  z-index: 60;
+}
+
 /* ----------------------------------------
  * Fallback error
  * ----------------------------------------
@@ -179,7 +216,7 @@ input[type=button]:active, select:active {
 
 #noVNC_fallback_error {
   position: fixed;
-  z-index: 3;
+  z-index: 1000;
   left: 50%;
   transform: translate(-50%, -50px);
   transition: 0.5s ease-in-out;
@@ -234,7 +271,7 @@ input[type=button]:active, select:active {
 #noVNC_control_bar_anchor {
   /* The anchor is needed to get z-stacking to work */
   position: fixed;
-  z-index: 2;
+  z-index: 10;
 
   transition: 0.5s ease-in-out;
 
@@ -294,7 +331,7 @@ input[type=button]:active, select:active {
   transform: translateY(35px);
   width: calc(100% + 30px);
   height: 50px;
-  z-index: -2;
+  z-index: -1;
   cursor: pointer;
   border-radius: 5px;
   background-color: rgb(83, 99, 122);
@@ -433,6 +470,7 @@ input[type=button]:active, select:active {
 
 .noVNC_panel label {
   display: block;
+  white-space: nowrap;
 }
 
 .noVNC_panel .noVNC_heading {
@@ -480,6 +518,10 @@ input[type=button]:active, select:active {
 
 /* Control bar content */
 
+#noVNC_control_bar .noVNC_logo {
+  font-size: 13px;
+}
+
 :root:not(.noVNC_connected) #noVNC_view_drag_button {
   display: none;
 }
@@ -492,18 +534,6 @@ input[type=button]:active, select:active {
   display: none;
 }
 
-#noVNC_keyboardinput {
-  width: 1px;
-  height: 1px;
-  background-color: #fff;
-  color: #fff;
-  border: 0;
-  position: relative;
-  left: -40px;
-  z-index: -1;
-  ime-mode: disabled;
-}
-
 /* Extra manual keys */
 :root:not(.noVNC_connected) #noVNC_extra_keys {
   display: none;
@@ -558,9 +588,6 @@ input[type=button]:active, select:active {
 }
 
 /* Connection Controls */
-:root.noVNC_connected #noVNC_connect_button {
-  display: none;
-}
 :root:not(.noVNC_connected) #noVNC_disconnect_button {
   display: none;
 }
@@ -575,9 +602,11 @@ input[type=button]:active, select:active {
   top: 0;
   left: 0;
   width: 100%;
-  z-index: 3;
+  z-index: 100;
   transform: translateY(-100%);
 
+  cursor: pointer;
+
   transition: 0.5s ease-in-out;
 
   visibility: hidden;
@@ -629,12 +658,87 @@ input[type=button]:active, select:active {
   content: url("../images/warning.svg") " ";
 }
 
+/* ----------------------------------------
+ * Connect Dialog
+ * ----------------------------------------
+ */
+
+#noVNC_connect_dlg {
+  transition: 0.5s ease-in-out;
+
+  transform: scale(0, 0);
+  visibility: hidden;
+  opacity: 0;
+}
+#noVNC_connect_dlg.noVNC_open {
+  transform: scale(1, 1);
+  visibility: visible;
+  opacity: 1;
+}
+#noVNC_connect_dlg .noVNC_logo {
+  transition: 0.5s ease-in-out;
+  padding: 10px;
+  margin-bottom: 10px;
+
+  font-size: 80px;
+  text-align: center;
+
+  border-radius: 5px;
+}
+@media (max-width: 440px) {
+  #noVNC_connect_dlg {
+    max-width: calc(100vw - 100px);
+  }
+  #noVNC_connect_dlg .noVNC_logo {
+    font-size: calc(25vw - 30px);
+  }
+}
+#noVNC_connect_button {
+  cursor: pointer;
+
+  padding: 10px;
+
+  color: white;
+  background-color: rgb(110, 132, 163);
+  border-radius: 12px;
+
+  text-align: center;
+  font-size: 20px;
+
+  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
+}
+#noVNC_connect_button div {
+  margin: 2px;
+  padding: 5px 30px;
+  border: 1px solid rgb(83, 99, 122);
+  border-bottom-width: 2px;
+  border-radius: 5px;
+  background: linear-gradient(to top, rgb(110, 132, 163), rgb(99, 119, 147));
+
+  /* This avoids it jumping around when :active */
+  vertical-align: middle;
+}
+#noVNC_connect_button div:active {
+  border-bottom-width: 1px;
+  margin-top: 3px;
+}
+:root:not(.noVNC_touch) #noVNC_connect_button div:hover {
+  background: linear-gradient(to top, rgb(110, 132, 163), rgb(105, 125, 155));
+}
+
+#noVNC_connect_button img {
+  vertical-align: bottom;
+  height: 1.3em;
+}
+
 /* ----------------------------------------
  * Password Dialog
  * ----------------------------------------
  */
 
 #noVNC_password_dlg {
+  position: relative;
+
   transform: translateY(-50px);
 }
 #noVNC_password_dlg.noVNC_open {
@@ -663,46 +767,54 @@ input[type=button]:active, select:active {
 
   color: white;
   background: rgba(0, 0, 0, 0.5);
-  z-index: 1000;
+  z-index: 50;
 
   /*display: flex;*/
   align-items: center;
   justify-content: center;
   flex-direction: column;
 }
+:root.noVNC_loading #noVNC_transition,
 :root.noVNC_connecting #noVNC_transition,
-:root.noVNC_disconnecting #noVNC_transition {
+:root.noVNC_disconnecting #noVNC_transition,
+:root.noVNC_reconnecting #noVNC_transition {
   display: flex;
 }
+:root:not(.noVNC_reconnecting) #noVNC_cancel_reconnect_button {
+  display: none;
+}
 #noVNC_transition_text {
   font-size: 1.5em;
 }
 
 /* Main container */
 #noVNC_container {
-  display: table;
   width: 100%;
   height: 100%;
   background-color: #313131;
   border-bottom-right-radius: 800px 600px;
   /*border-top-left-radius: 800px 600px;*/
 }
-:root.noVNC_connected #noVNC_container {
-  background-color: rgb(40, 40, 40);
-  border-radius: 0;
+
+#noVNC_keyboardinput {
+  width: 1px;
+  height: 1px;
+  background-color: #fff;
+  color: #fff;
+  border: 0;
+  position: absolute;
+  left: -40px;
+  z-index: -1;
+  ime-mode: disabled;
 }
 
 /* HTML5 Canvas */
 #noVNC_screen {
-  position: absolute;
-  margin: 0px;
-  padding: 0px;
-  bottom: 0px;
-  top: 0px;
-  left: 0px;
-  right: 0px;
-  width: auto;
-  height: auto;
+  display: flex;
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+  background-color: rgb(40, 40, 40);
 }
 :root:not(.noVNC_connected) #noVNC_screen {
   display: none;
@@ -712,12 +824,9 @@ input[type=button]:active, select:active {
  * scaling will occur. Canvas size depends on remote VNC
  * settings and noVNC settings. */
 #noVNC_canvas {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
   margin: auto;
+  /* IE miscalculates width without this :( */
+  flex-shrink: 0;
 }
 
 /*Default noVNC logo.*/
@@ -732,31 +841,14 @@ input[type=button]:active, select:active {
 
 .noVNC_logo {
   color:yellow;
-  text-align:left;
   font-family: 'Orbitron', 'OrbitronTTF', sans-serif;
-  font-size: 13px;
   line-height:90%;
-  text-shadow: 1px 1px 0 #000;
+  text-shadow: 0.1em 0.1em 0 black;
 }
 .noVNC_logo span{
   color:green;
 }
 
-#noVNC_logo {
-  margin-top: 60px;
-  margin-left: 60px;
-  font-size: 180px;
-  text-shadow:
-       5px 5px 0 #000,
-      -1px -1px 0 #000,
-       1px -1px 0 #000,
-      -1px 1px 0 #000,
-       1px 1px 0 #000;
-}
-:root.noVNC_connected #noVNC_logo {
-  display: none;
-}
-
 #noVNC_bell {
   display: none;
 }