164 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			HTML
		
	
	
			
		
		
	
	
			164 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			HTML
		
	
	
<!doctype html>
 | 
						|
<html lang="en">
 | 
						|
  <head>
 | 
						|
    <meta charset="utf-8" />
 | 
						|
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
						|
    <meta
 | 
						|
      name="viewport"
 | 
						|
      content="width=device-width, initial-scale=1, user-scalable=no"
 | 
						|
    />
 | 
						|
 | 
						|
    [{[ if .ReCaptcha -]}]
 | 
						|
    <script src="[{[ .ReCaptchaHost ]}]/recaptcha/api.js?render=explicit"></script>
 | 
						|
    [{[ end ]}]
 | 
						|
 | 
						|
    <title>
 | 
						|
      [{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]
 | 
						|
    </title>
 | 
						|
 | 
						|
    <meta name="robots" content="noindex,nofollow" />
 | 
						|
 | 
						|
    <link rel="icon" type="image/svg+xml" href="[{[ .StaticURL ]}]/img/icons/favicon.svg" />
 | 
						|
    <link rel="shortcut icon" href="[{[ .StaticURL ]}]/img/icons/favicon.ico" />
 | 
						|
    <link rel="apple-touch-icon" sizes="180x180" href="[{[ .StaticURL ]}]/img/icons/apple-touch-icon.png" />
 | 
						|
    <meta name="apple-mobile-web-app-title" content="File Browser" />
 | 
						|
 | 
						|
    <!-- Add to home screen for Android and modern mobile browsers -->
 | 
						|
    <link
 | 
						|
      rel="manifest"
 | 
						|
      id="manifestPlaceholder"
 | 
						|
      crossorigin="use-credentials"
 | 
						|
    />
 | 
						|
    <meta
 | 
						|
      name="theme-color"
 | 
						|
      content="[{[ if .Color -]}][{[ .Color ]}][{[ else ]}]#2979ff[{[ end ]}]"
 | 
						|
    />
 | 
						|
 | 
						|
    <!-- Inject Some Variables and generate the manifest json -->
 | 
						|
    <script>
 | 
						|
      // We can assign JSON directly
 | 
						|
      window.FileBrowser = [{[ .Json ]}];
 | 
						|
      // Global function to prepend static url
 | 
						|
      window.__prependStaticUrl = (url) => {
 | 
						|
        return `${window.FileBrowser.StaticURL}/${url.replace(/^\/+/, "")}`;
 | 
						|
      };
 | 
						|
      var dynamicManifest = {
 | 
						|
        name: window.FileBrowser.Name || "File Browser",
 | 
						|
        short_name: window.FileBrowser.Name || "File Browser",
 | 
						|
        icons: [
 | 
						|
          {
 | 
						|
            src: window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
 | 
						|
            sizes: "192x192",
 | 
						|
            type: "image/png",
 | 
						|
          },
 | 
						|
          {
 | 
						|
            src: window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
 | 
						|
            sizes: "512x512",
 | 
						|
            type: "image/png",
 | 
						|
          },
 | 
						|
        ],
 | 
						|
        start_url: window.location.origin + window.FileBrowser.BaseURL,
 | 
						|
        display: "standalone",
 | 
						|
        background_color: "#ffffff",
 | 
						|
        theme_color: window.FileBrowser.Color || "#455a64",
 | 
						|
      };
 | 
						|
 | 
						|
      const stringManifest = JSON.stringify(dynamicManifest);
 | 
						|
      const blob = new Blob([stringManifest], { type: "application/json" });
 | 
						|
      const manifestURL = URL.createObjectURL(blob);
 | 
						|
      document
 | 
						|
        .querySelector("#manifestPlaceholder")
 | 
						|
        .setAttribute("href", manifestURL);
 | 
						|
    </script>
 | 
						|
 | 
						|
    <style>
 | 
						|
      #loading {
 | 
						|
        position: fixed;
 | 
						|
        top: 0;
 | 
						|
        left: 0;
 | 
						|
        width: 100%;
 | 
						|
        height: 100%;
 | 
						|
        background: #fff;
 | 
						|
        z-index: 9999;
 | 
						|
        transition: 0.1s ease opacity;
 | 
						|
        -webkit-transition: 0.1s ease opacity;
 | 
						|
      }
 | 
						|
 | 
						|
      #loading.done {
 | 
						|
        opacity: 0;
 | 
						|
      }
 | 
						|
 | 
						|
      #loading .spinner {
 | 
						|
        width: 70px;
 | 
						|
        text-align: center;
 | 
						|
        position: fixed;
 | 
						|
        top: 50%;
 | 
						|
        left: 50%;
 | 
						|
        -webkit-transform: translate(-50%, -50%);
 | 
						|
        transform: translate(-50%, -50%);
 | 
						|
      }
 | 
						|
 | 
						|
      #loading .spinner > div {
 | 
						|
        width: 18px;
 | 
						|
        height: 18px;
 | 
						|
        background-color: #333;
 | 
						|
        border-radius: 100%;
 | 
						|
        display: inline-block;
 | 
						|
        -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
 | 
						|
        animation: sk-bouncedelay 1.4s infinite ease-in-out both;
 | 
						|
      }
 | 
						|
 | 
						|
      #loading .spinner .bounce1 {
 | 
						|
        -webkit-animation-delay: -0.32s;
 | 
						|
        animation-delay: -0.32s;
 | 
						|
      }
 | 
						|
 | 
						|
      #loading .spinner .bounce2 {
 | 
						|
        -webkit-animation-delay: -0.16s;
 | 
						|
        animation-delay: -0.16s;
 | 
						|
      }
 | 
						|
 | 
						|
      @-webkit-keyframes sk-bouncedelay {
 | 
						|
        0%,
 | 
						|
        80%,
 | 
						|
        100% {
 | 
						|
          -webkit-transform: scale(0);
 | 
						|
        }
 | 
						|
        40% {
 | 
						|
          -webkit-transform: scale(1);
 | 
						|
        }
 | 
						|
      }
 | 
						|
 | 
						|
      @keyframes sk-bouncedelay {
 | 
						|
        0%,
 | 
						|
        80%,
 | 
						|
        100% {
 | 
						|
          -webkit-transform: scale(0);
 | 
						|
          transform: scale(0);
 | 
						|
        }
 | 
						|
        40% {
 | 
						|
          -webkit-transform: scale(1);
 | 
						|
          transform: scale(1);
 | 
						|
        }
 | 
						|
      }
 | 
						|
    </style>
 | 
						|
  </head>
 | 
						|
  <body>
 | 
						|
    <div id="app"></div>
 | 
						|
 | 
						|
    <div id="loading">
 | 
						|
      <div class="spinner">
 | 
						|
        <div class="bounce1"></div>
 | 
						|
        <div class="bounce2"></div>
 | 
						|
        <div class="bounce3"></div>
 | 
						|
      </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script type="module" src="/src/main.ts"></script>
 | 
						|
 | 
						|
    [{[ if .CSS -]}]
 | 
						|
    <link rel="stylesheet" href="[{[ .StaticURL ]}]/custom.css" />
 | 
						|
    [{[ end ]}]
 | 
						|
  </body>
 | 
						|
</html>
 |