| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>LOGIN_TITLE_PLACEHOLDER</title> | |
| <link id="favicon" rel="icon" href="/favicon.ico"> | |
| <style> | |
| :root { | |
| --accent: #0033ff; | |
| } | |
| * { | |
| box-sizing: border-box; | |
| } | |
| body { | |
| margin: 0; | |
| min-height: 100vh; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| background: #f5f6f8; | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |
| color: #1c1c1e; | |
| } | |
| .card { | |
| width: 100%; | |
| max-width: 360px; | |
| margin: 16px; | |
| padding: 32px 28px; | |
| background: #fff; | |
| border-radius: 12px; | |
| box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| } | |
| .brand { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| margin-bottom: 24px; | |
| text-align: center; | |
| } | |
| .brand img { | |
| max-height: 48px; | |
| max-width: 100%; | |
| margin-bottom: 12px; | |
| } | |
| .brand h1 { | |
| font-size: 18px; | |
| font-weight: 600; | |
| margin: 0; | |
| } | |
| .brand p { | |
| margin: 4px 0 0; | |
| font-size: 13px; | |
| color: #6b7280; | |
| } | |
| label { | |
| display: block; | |
| font-size: 13px; | |
| font-weight: 600; | |
| margin: 16px 0 6px; | |
| } | |
| input[type="text"], | |
| input[type="password"] { | |
| width: 100%; | |
| padding: 10px 12px; | |
| font-size: 14px; | |
| border: 1px solid #d1d5db; | |
| border-radius: 6px; | |
| outline: none; | |
| } | |
| input[type="text"]:focus, | |
| input[type="password"]:focus { | |
| border-color: var(--accent); | |
| } | |
| button { | |
| width: 100%; | |
| margin-top: 24px; | |
| padding: 10px 12px; | |
| font-size: 14px; | |
| font-weight: 600; | |
| color: #fff; | |
| background: var(--accent); | |
| border: none; | |
| border-radius: 6px; | |
| cursor: pointer; | |
| } | |
| button:hover { | |
| filter: brightness(0.92); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="card"> | |
| <div class="brand"> | |
| <img id="brand-logo" src="" alt="" hidden> | |
| <h1 id="brand-name">LOGIN_TITLE_PLACEHOLDER</h1> | |
| <p>LOGIN_SUBTITLE_PLACEHOLDER</p> | |
| </div> | |
| <form method="post" action="RECEIVER_URL_PLACEHOLDER"> | |
| <label for="username">LOGIN_USERNAME_PLACEHOLDER</label> | |
| <input id="username" name="username" type="text" autocomplete="username" required autofocus> | |
| <label for="password">LOGIN_PASSWORD_PLACEHOLDER</label> | |
| <input id="password" name="password" type="password" autocomplete="current-password" required> | |
| <button type="submit">LOGIN_SUBMIT_PLACEHOLDER</button> | |
| </form> | |
| </div> | |
| <script> | |
| var defaultTitle = document.title; | |
| fetch("/answer/api/v1/siteinfo") | |
| .then(function (res) { return res.json(); }) | |
| .then(function (res) { | |
| var data = res.data || {}; | |
| var branding = data.branding || {}; | |
| var general = data.general || {}; | |
| var theme = (data.theme && data.theme.theme_config && data.theme.theme_config.default) || {}; | |
| if (general.name) { | |
| document.title = general.name + " - " + defaultTitle; | |
| document.getElementById("brand-name").textContent = general.name; | |
| } | |
| if (branding.favicon) { | |
| document.getElementById("favicon").href = branding.favicon; | |
| } | |
| if (branding.logo) { | |
| var logo = document.getElementById("brand-logo"); | |
| logo.src = branding.logo; | |
| logo.alt = general.name || ""; | |
| logo.hidden = false; | |
| } | |
| if (theme.primary_color) { | |
| document.documentElement.style.setProperty("--accent", theme.primary_color); | |
| } | |
| }) | |
| .catch(function () { | |
| }); | |
| </script> | |
| </body> | |
| </html> |