fix: sidebar fixa na tela (nao sobe com tabelas longas) + mostrar/ocultar senha no login
Sidebar antes esticava junto com o conteudo (align-items:stretch do flex), entao em telas com tabela longa (Clientes) o rodape (tema/sair/ recolher) ficava fora da area visivel sem rolar a pagina toda. Agora fica position:sticky, presa ao topo da viewport, com rolagem propria se a lista de links for maior que a tela. Login ganha um botao de olho pra mostrar/ocultar a senha digitada. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
7febe7c652
commit
1728a2dbdd
@@ -88,6 +88,10 @@ a { color: var(--cor-acento-texto); }
|
|||||||
border-right: 1px solid var(--cor-borda);
|
border-right: 1px solid var(--cor-borda);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: auto;
|
||||||
transition: width var(--transicao), transform var(--transicao);
|
transition: width var(--transicao), transform var(--transicao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,15 @@
|
|||||||
.login-subtitulo { color: var(--cor-texto-secundario); font-size: 0.9rem; margin: 0 0 20px; }
|
.login-subtitulo { color: var(--cor-texto-secundario); font-size: 0.9rem; margin: 0 0 20px; }
|
||||||
.login-cartao form { text-align: left; }
|
.login-cartao form { text-align: left; }
|
||||||
.login-cartao button { width: 100%; }
|
.login-cartao button { width: 100%; }
|
||||||
|
.campo-senha { position: relative; }
|
||||||
|
.campo-senha input { padding-right: 40px; }
|
||||||
|
.botao-ver-senha {
|
||||||
|
position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
|
||||||
|
margin: 0; padding: 6px; width: auto; background: transparent; border: none;
|
||||||
|
color: var(--cor-texto-secundario); cursor: pointer; display: flex; align-items: center;
|
||||||
|
}
|
||||||
|
.botao-ver-senha:hover { color: var(--cor-texto); }
|
||||||
|
.botao-ver-senha svg { width: 18px; height: 18px; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -32,9 +41,26 @@
|
|||||||
<label for="usuario">Usuário</label>
|
<label for="usuario">Usuário</label>
|
||||||
<input type="text" id="usuario" name="usuario" required autofocus>
|
<input type="text" id="usuario" name="usuario" required autofocus>
|
||||||
<label for="senha">Senha</label>
|
<label for="senha">Senha</label>
|
||||||
<input type="password" id="senha" name="senha" required>
|
<div class="campo-senha">
|
||||||
|
<input type="password" id="senha" name="senha" required>
|
||||||
|
<button type="button" class="botao-ver-senha" id="botao-ver-senha" aria-label="Mostrar senha">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z"/><circle cx="12" cy="12" r="3"/></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<button type="submit">Entrar</button>
|
<button type="submit">Entrar</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var botao = document.getElementById('botao-ver-senha');
|
||||||
|
var campo = document.getElementById('senha');
|
||||||
|
if (!botao || !campo) return;
|
||||||
|
botao.addEventListener('click', function () {
|
||||||
|
var mostrando = campo.type === 'text';
|
||||||
|
campo.type = mostrando ? 'password' : 'text';
|
||||||
|
botao.setAttribute('aria-label', mostrando ? 'Mostrar senha' : 'Ocultar senha');
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user