Add mobile navigation support.
Some checks are pending
CI/CD / build-and-test (push) Waiting to run

This commit is contained in:
Felipe Cotti 2024-11-18 14:00:07 -03:00
parent 11812df93b
commit 1bd452286b
4 changed files with 73 additions and 13 deletions

View file

@ -3,14 +3,13 @@
word-spacing: 0.3em; word-spacing: 0.3em;
letter-spacing: -0.05em; letter-spacing: -0.05em;
background: linear-gradient(180deg, hsl(15, 80%, 10%) 0%, hsl(15, 50%, 60%) 100%); background: linear-gradient(180deg, hsl(15, 80%, 10%) 0%, hsl(15, 50%, 60%) 100%);
width: 100%; width: 100dvw;
padding: 2ch; padding: 2ch;
border-bottom: 0.1em solid hsl(15, 80%, 20%); border-bottom: 0.1em solid hsl(15, 80%, 20%);
} }
.header h1 { .header h1 {
margin-inline: auto; margin-inline: auto;
width: 1200px;
color: hsl(15, 100%, 90%); color: hsl(15, 100%, 90%);
text-shadow: 0.01em 0.01em 0.01em hsl(15, 0%, 20%); text-shadow: 0.01em 0.01em 0.01em hsl(15, 0%, 20%);
font-family: "Carattere", cursive; font-family: "Carattere", cursive;
@ -22,3 +21,17 @@
margin-inline: auto; margin-inline: auto;
padding: 2ch; padding: 2ch;
} }
@media screen and (max-width: 1200px) {
.content {
width: 100%;
max-width: 100%;
padding: 0;
}
.header{
font-size: clamp(1.5em, 3dvh, 2em);
}
.header h1 {
word-break: break-word;
}
}

View file

@ -101,6 +101,7 @@ ul li button:hover {
font-weight: 300; font-weight: 300;
border-radius: 0.5em; border-radius: 0.5em;
box-shadow: 0.05em 0.05em 0.05em hsla(15, 20%, 20%, 0.5); box-shadow: 0.05em 0.05em 0.05em hsla(15, 20%, 20%, 0.5);
white-space: pre-wrap;
} }
.message-text p{ .message-text p{
@ -109,3 +110,35 @@ ul li button:hover {
text-justify: inter-word; text-justify: inter-word;
text-align-last: left; text-align-last: left;
} }
@media screen and (max-width: 1200px) {
.warning {
margin: 1ch;
margin-inline: auto;
}
ul li {
grid-template-columns: auto auto;
grid-template-rows: auto;
grid-row-gap: 1ch;
}
ul li h2 {
grid-row: 1;
grid-column: 1 / 3;
}
ul li h3 {
grid-row: 2;
grid-column: 1 / 3;
font-size: 1em;
}
ul li button {
justify-self: center;
grid-row: 1;
grid-column: 2;
}
.message-text {
grid-row: 4;
grid-column: 1 / 3;
margin: 0;
}
}

View file

@ -62,3 +62,20 @@ form button {
font-family: 'Solway', serif; font-family: 'Solway', serif;
font-weight: 300; font-weight: 300;
} }
@media screen and (max-width: 1200px) {
form {
grid-template-columns: 1fr;
grid-column-gap: initial;
grid-row-gap: 2ch;
}
form * {
grid-column: 1;
}
form label {
text-align: left;
}
form button {
grid-column: 1;
}
}

View file

@ -1,13 +1,12 @@
import React, { useRef } from 'react'; import React, {useRef} from 'react';
import useAuth from '../hooks/useAuth.js'; import useAuth from '../hooks/useAuth.js';
import './LoginPage.css' import './LoginPage.css'
const LoginPage = ({onLoggedIn}) => const LoginPage = ({onLoggedIn}) => {
{
const userInputRef = useRef(null); const userInputRef = useRef(null);
const passInputRef = useRef(null); const passInputRef = useRef(null);
const { authenticate, error } = useAuth(); const {authenticate, error} = useAuth();
const handleSubmit = (e) => { const handleSubmit = (e) => {
e.preventDefault() e.preventDefault()
@ -19,21 +18,19 @@ const LoginPage = ({onLoggedIn}) =>
if (error === null) { if (error === null) {
onLoggedIn(true) onLoggedIn(true)
} }
}); });
} }
return( return (
<>
<div className="login-form fade-in"> <div className="login-form fade-in">
<form action="post" onSubmit={handleSubmit}> <form action="post" onSubmit={handleSubmit}>
<label>User: </label><input type='text' name='username' placeholder='' <label htmlFor={'username'}>User: </label><input type='text' name='username' placeholder=''
ref={userInputRef}></input> ref={userInputRef}></input>
<label>Password: </label><input type='password' name='password' placeholder='' <label htmlFor={'password'}>Password: </label><input type='password' name='password' placeholder=''
ref={passInputRef}></input> ref={passInputRef}></input>
<button type='submit' className='login-button'>Login</button> <button type='submit' className='login-button'>Login</button>
</form> </form>
</div> </div>
</>
) )
} }