feature: Login screen

This commit is contained in:
jamesread 2024-10-14 09:26:08 +01:00 committed by James Read
parent fb7e650267
commit 3b8976fd51
3 changed files with 58 additions and 0 deletions

View File

@ -92,6 +92,35 @@
</fieldset>
</section>
<section id = "contentLogin" title = "Login" hidden>
<div class = "flex-col">
<form class = "box-shadow padded-content">
<h2>OAuth Login</h2>
<div>
<button>GitHub</button>
<button>Google</button>
</div>
<hr />
<h2>Local Login</h2>
<div class = "arguments">
<label for = "username">
<span>Username:</span>
</label>
<input type = "text" name = "username" />
<span></span>
<label for = "password">
<span>Password:</span>
</label>
<input type = "password" name = "password" />
<span></span>
<button type = "submit">Login</button>
</div>
</form>
</div>
</section>
<noscript>
<div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
</noscript>

View File

@ -264,6 +264,7 @@ export function setupSectionNavigation (style) {
registerSection('/', 'Actions', null, document.getElementById('showActions'))
registerSection('/diagnostics', 'Diagnostics', null, document.getElementById('showDiagnostics'))
registerSection('/logs', 'Logs', null, document.getElementById('showLogs'))
registerSection('/login', 'Login', null, null)
}
function registerSection (path, section, view, linkElement) {

View File

@ -552,6 +552,34 @@ div.display {
padding: 1em;
}
.flex-col {
display: flex;
flex-direction: column;
}
#contentLogin form {
width: 40%;
place-self: center;
}
#contentLogin hr {
border: 0;
border-top: 1px dashed #ccc;
}
#contentLogin button {
display: block;
width: 100%;
grid-column: 1 / span 3;
margin-bottom: 1em;
font-weight: bold;
background-color: #ced3d7;
}
#contentLogin button:last-child {
margin-bottom: 0;
}
@media screen and (width <= 600px) {
fieldset {
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));