add form style
This commit is contained in:
1 parent
387b2c32cf
commit
fef249acd3
8 files changed
+176
-156
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
import styles from './../pages/Login/LoginPage.module.css';
|
import styles from "./background.module.css";
|
||||||
const Background = ({ children, className }) => {
|
const Background = ({ children, className }) => {
|
||||||
return (
|
return (
|
||||||
<div className={`${styles["background-container"]} ${className || ''}`}>
|
<div className={`${styles["background-container"]} ${className || ''}`}>
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
/* BACKGROUND ////////////////////////////////////////////////////////*/
|
||||||
|
.background-container {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #ff9500, #ffb347);
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle {
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 0.8;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-1 {
|
||||||
|
width: 600px;
|
||||||
|
height: 600px;
|
||||||
|
background-color: rgba(255, 255, 204, 0.6);
|
||||||
|
top: -10%;
|
||||||
|
left: -10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-2 {
|
||||||
|
width: 250px;
|
||||||
|
height: 250px;
|
||||||
|
background-color: rgba(255, 255, 153, 0.829);
|
||||||
|
top: 51%;
|
||||||
|
left: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-3 {
|
||||||
|
width: 280px;
|
||||||
|
height: 280px;
|
||||||
|
background-color: rgba(255, 255, 204, 0.439);
|
||||||
|
top: 17%;
|
||||||
|
right: 9%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-4 {
|
||||||
|
width: 500px;
|
||||||
|
height: 500px;
|
||||||
|
background-color: rgb(244, 244, 172);
|
||||||
|
bottom: 0%;
|
||||||
|
right: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-5 {
|
||||||
|
width: 240px;
|
||||||
|
height: 240px;
|
||||||
|
background-color: rgba(240, 240, 41, 0.827);
|
||||||
|
top: 2%;
|
||||||
|
right: 2%;
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
import login from "../utils/login.js";
|
|
||||||
import getUser from "../utils/getUser.js";
|
|
||||||
|
|
||||||
function LoginForm({ className }) {
|
|
||||||
|
|
||||||
const [email, setEmail] = useState('');
|
|
||||||
const [password, setPassword] = useState('');
|
|
||||||
|
|
||||||
async function handleSubmit(e) {
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
await login(email, password);
|
|
||||||
getUser();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={className}>
|
|
||||||
<h1>Connexion</h1>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<br/>
|
|
||||||
<label htmlFor="email" className="floating-label">Adresse e-mail</label>
|
|
||||||
<input type="email" id="email" value={email} onChange={e => setEmail(e.target.value)} required/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-group">
|
|
||||||
<label htmlFor="password" className="floating-label">Mot de passe</label>
|
|
||||||
<input type="password" id="password" value={password} onChange={e => setPassword(e.target.value)} required/>
|
|
||||||
<br/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button className="login-button" onClick={e => handleSubmit(e)}>Se connecter</button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
export default LoginForm;
|
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import login from "../../utils/login.js";
|
||||||
|
import getUser from "../../utils/getUser.js";
|
||||||
|
import styles from "./form.module.css";
|
||||||
|
function LoginForm({ className }) {
|
||||||
|
const [email, setEmail] = useState('');
|
||||||
|
const [password, setPassword] = useState('');
|
||||||
|
async function handleSubmit(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
await login(email, password);
|
||||||
|
getUser();
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className={className}>
|
||||||
|
<div className={styles.formgroup}>
|
||||||
|
<input type="email" id="email" value={email} placeholder="Adresse mail" onChange={e => setEmail(e.target.value)} required/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.formgroup}>
|
||||||
|
<input type="password" id="password" value={password} placeholder="Adresse mail" onChange={e => setPassword(e.target.value)} required/>
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
<div className={styles.logButton} >
|
||||||
|
<button className={styles.loginButton} onClick={e => handleSubmit(e)}>Se connecter</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default LoginForm;
|
||||||
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
padding: 0px 10px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #111;
|
||||||
|
box-shadow: 0 2px 6px rgba(0,0,0,0.06) inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
input::placeholder{
|
||||||
|
font-size: 20px;
|
||||||
|
color: rgba(0,0,0,0.45);
|
||||||
|
}
|
||||||
|
.logButton{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.formgroup{
|
||||||
|
margin-top:23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* style scoped (module) */
|
||||||
|
.loginButton {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.55rem 1rem;
|
||||||
|
height: 55px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background-color: #2b6cb0;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 2px 6px rgba(43,108,176,0.15);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginButton:hover {
|
||||||
|
background-color: #235a9a;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 6px 14px rgba(43,108,176,0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginButton:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: 0 3px 8px rgba(43,108,176,0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginButton:focus {
|
||||||
|
outline: 2px solid rgba(43,108,176,0.24);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.loginButton:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: 0 3px 8px rgba(43,108,176,0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginButton:focus {
|
||||||
|
outline: 2px solid rgba(43,108,176,0.24);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
+7
-11
@@ -1,3 +1,9 @@
|
|||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width:100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
:root {
|
:root {
|
||||||
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@@ -36,17 +42,7 @@ h1 {
|
|||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
padding: 0.6em 1.2em;
|
|
||||||
font-size: 1em;
|
|
||||||
font-weight: 500;
|
|
||||||
font-family: inherit;
|
|
||||||
background-color: #1a1a1a;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: border-color 0.25s;
|
|
||||||
}
|
|
||||||
button:hover {
|
button:hover {
|
||||||
border-color: #646cff;
|
border-color: #646cff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import styles from "./LoginPage.module.css";
|
import styles from "./LoginPage.module.css";
|
||||||
import LoginForm from "../../components/form.jsx";
|
import LoginForm from "../../components/form/form.jsx";
|
||||||
import Background from "../../components/background.jsx";
|
import Background from "../../components/background/background.jsx";
|
||||||
|
|
||||||
function LoginPage() {
|
function LoginPage() {
|
||||||
return (
|
return (
|
||||||
@@ -13,3 +13,5 @@ function LoginPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default LoginPage;
|
export default LoginPage;
|
||||||
|
|
||||||
|
|
||||||
@@ -1,111 +1,15 @@
|
|||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width:100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.container {
|
.container {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 30%;
|
||||||
height: 100vh;
|
overflow: hidden;
|
||||||
|
max-height: 80%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border: 1px solid #ccc;
|
border-radius:12px;
|
||||||
}
|
|
||||||
.login-form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 40px 20px;
|
|
||||||
width: 25%;
|
|
||||||
max-width: 400px;
|
|
||||||
background-color: rgb(232, 229, 229);
|
|
||||||
opacity: 0.85;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.form-group {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
label{
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 15px 10px 5px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
color: orange;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.login-button {
|
|
||||||
padding: 10px;
|
|
||||||
background-color: rgb(125, 117, 133);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
margin-top: 100px;
|
|
||||||
}
|
|
||||||
/* BACKGROUND ////////////////////////////////////////////////////////*/
|
|
||||||
.background-container {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
min-height: 100vh;
|
|
||||||
background: linear-gradient(135deg, #ff9500, #ffb347);
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
width: 100vw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.circle {
|
|
||||||
position: absolute;
|
|
||||||
border-radius: 50%;
|
|
||||||
opacity: 0.8;
|
|
||||||
z-index: 1; /* Place les cercles sous le contenu */
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-1 {
|
|
||||||
width: 600px;
|
|
||||||
height: 600px;
|
|
||||||
background-color: rgba(255, 255, 204, 0.6);
|
|
||||||
top: -10%;
|
|
||||||
left: -10%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-2 {
|
|
||||||
width: 250px;
|
|
||||||
height: 250px;
|
|
||||||
background-color: rgba(255, 255, 153, 0.829);
|
|
||||||
top: 51%;
|
|
||||||
left: 10%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-3 {
|
|
||||||
width: 280px;
|
|
||||||
height: 280px;
|
|
||||||
background-color: rgba(255, 255, 204, 0.439);
|
|
||||||
top: 17%;
|
|
||||||
right: 9%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-4 {
|
|
||||||
width: 500px;
|
|
||||||
height: 500px;
|
|
||||||
background-color: rgb(244, 244, 172);
|
|
||||||
bottom: 0%;
|
|
||||||
right: 0%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-5 {
|
|
||||||
width: 240px;
|
|
||||||
height: 240px;
|
|
||||||
background-color: rgba(240, 240, 41, 0.827);
|
|
||||||
top: 2%;
|
|
||||||
right: 2%;
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user