improved login box

This commit is contained in:
Michael Quigley 2022-08-03 12:41:37 -04:00
parent 46b00ab9f0
commit 6ff9a90896
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 57 additions and 18 deletions

View File

@ -10,7 +10,7 @@ const Login = (props) => {
identity.login({body: {"email": email, "password": password}}) identity.login({body: {"email": email, "password": password}})
.then(resp => { .then(resp => {
if(!resp.error) { if (!resp.error) {
let user = { let user = {
"email": email, "email": email,
"token": resp.data "token": resp.data
@ -29,16 +29,18 @@ const Login = (props) => {
}; };
return ( return (
<form onSubmit={handleSubmit}> <div className={"login"}>
<label htmlFor="email">email: </label> <img src={"ziggy.svg"} width={200}/>
<input type="text" value={email} placeholder="enter an email" onChange={({ target }) => setEmail(target.value)}/> <h1>zrok</h1>
<div> <form onSubmit={handleSubmit}>
<label htmlFor="password">password: </label> <fieldset>
<input type="password" value={password} placeholder="enter a password" onChange={({ target }) => setPassword(target.value)}/> <legend>Log In</legend>
</div> <p><label htmlFor="email">email: </label><input type="text" value={email} placeholder="enter an email" onChange={({target}) => setEmail(target.value)}/></p>
<button type="submit">Log In</button> <p><label htmlFor="password">password: </label><input type="password" value={password} placeholder="enter a password" onChange={({target}) => setPassword(target.value)}/><button type="submit">Log In</button></p>
</form> </fieldset>
); </form>
</div>
)
} }
export default Login; export default Login;

View File

@ -14,13 +14,49 @@ h1, h2, h3, h4, h5, h6 {
font-family: 'Russo One', sans-serif; font-family: 'Russo One', sans-serif;
} }
.container { .container {
display: grid; display: grid;
margin-left: 10%; margin-left: 10%;
margin-right: 10%; margin-right: 10%;
} }
.login {
background-color: #3b2693;
text-align: center;
padding: 25px;
color: white;
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
justify-content: center;
}
.login h1 {
font-size: 64pt;
}
.login fieldset {
width: 500px;
border-radius: 25px;
}
.login label {
text-align: right;
width: 100px;
float: left;
font-family: 'Russo One', sans-serif;
margin-right: 10px;
}
.login fieldset legend {
font-family: 'Russo One', sans-serif;
}
.login fieldset p {
clear: both;
padding: 5px;
}
.login input {
width: 300px;
float: left;
}
.header { .header {
background-color: #3b2693; background-color: #3b2693;
color: white; color: white;
@ -38,8 +74,7 @@ h1, h2, h3, h4, h5, h6 {
.header-status { .header-status {
width: 100%; width: 100%;
display: grid; display: grid;
padding-bottom: 1em; grid-template-rows: 1fr 1fr;
grid-row-start: 2;
} }
.header-status div p { .header-status div p {
font-size: 75%; font-size: 75%;
@ -49,20 +84,22 @@ h1, h2, h3, h4, h5, h6 {
} }
.header-controls { .header-controls {
display: flex; display: flex;
grid-row-start: 2;
justify-content: right; justify-content: right;
align-items: flex-end;
} }
.header-controls button { .header-controls button {
margin-left: 30px; margin-left: 30px;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #5241a8; background-color: #222;
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
border: 1px solid #846fec; border: 1px solid #846fec;
color: lightgray; color: #846fec;
padding: 5px; padding: 5px;
width: 60px; width: 100px;
justify-content: center; justify-content: center;
height: 2em;
margin-bottom: 1em;
} }
.header-controls button:hover { .header-controls button:hover {
color: white; color: white;