Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update splash and auth #166

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 102 additions & 80 deletions ai-trip-creator/src/components/auth/auth.css
Original file line number Diff line number Diff line change
@@ -1,86 +1,108 @@
/* auth.css */
form {
display: flex;
flex-direction: column;
gap: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
}

form div {
width: 100%;
margin-bottom: 1rem;
}

label {
display: block;
margin-bottom: 0.5rem;
color: #000;
}

input {
width: 100%;
padding: 0.5rem;
border: 1px solid #ccc;
border-radius: 4px;
}

button {
background-color: #0070f3;
color: white;
border: none;
padding: 0.75rem;
border-radius: 4px;
transition: background-color 0.3s;
}

button:hover {
background-color: #005bb5;
}

p {
padding: 25px;
margin-top: 0;
color: #000;
}

p a {
padding: 5px;
color: #0070f3;
}

.splash-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f2f5;
}

.splash-container h1 {
font-size: 2.5rem;
margin-bottom: 2rem;
}

.modal {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1000;
background-color: white;
padding: 2rem;
border-radius: 16px;
width: 100%;
max-width: 400px;
animation: modalFadeIn 0.3s ease-in-out;
}

@keyframes modalFadeIn {
from {
opacity: 0;
transform: translate(-50%, -48%);
}

form div {
width: 100%;
margin-bottom: 1rem;
}

label {
display: block;
margin-bottom: 0.5rem;
color: #000;
}

input {
width: 100%;
padding: 0.5rem;
border: 1px solid #ccc;
border-radius: 4px;
}

button {
background-color: #0070f3;
color: white;
border: none;
padding: 0.75rem;
border-radius: 4px;
transition: background-color 0.3s;
}

button:hover {
background-color: #005bb5;
}

p {
padding: 25px;
margin-top: 0;
color: #000;
}

p a {
padding: 5px;
color: #0070f3;
}

.splash-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f2f5;
}

.splash-container h1 {
font-size: 2.5rem;
margin-bottom: 2rem;
}

.modal {
position: absolute;
top: 50%;
left: 50%;
to {
opacity: 1;
transform: translate(-50%, -50%);
z-index: 1000;
background-color: white;
padding: 2rem;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
width: 20rem;
}

.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 500;
}

.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
z-index: 500;
animation: overlayFadeIn 0.3s ease-in-out;
}

@keyframes overlayFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
109 changes: 73 additions & 36 deletions ai-trip-creator/src/components/auth/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,26 @@ const Login = ({ setIsLoggedIn, closeLogin, openSignup }) => {
<Box
component="form"
onSubmit={handleLogin}
className="login-container"
sx={{
display: "flex",
flexDirection: "column",
gap: 2,
display: 'flex',
flexDirection: 'column',
gap: 3,
maxWidth: 400,
margin: "0 auto",
width: '100%',
padding: '2rem',
backgroundColor: 'white',
borderRadius: '16px',
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.08)',
}}
>
{error && <Alert severity="error">{error}</Alert>}
{resetError && <Alert severity="error">{resetError}</Alert>}
{resetSuccess && <Alert severity="success">{resetSuccess}</Alert>}
<Typography variant="h4" sx={{ textAlign: 'center', fontWeight: 600, mb: 2 }}>
Welcome Back
</Typography>

{error && <Alert severity="error" sx={{ borderRadius: '8px' }}>{error}</Alert>}
{resetError && <Alert severity="error" sx={{ borderRadius: '8px' }}>{resetError}</Alert>}
{resetSuccess && <Alert severity="success" sx={{ borderRadius: '8px' }}>{resetSuccess}</Alert>}

<TextField
label="Email"
Expand All @@ -106,6 +115,7 @@ const Login = ({ setIsLoggedIn, closeLogin, openSignup }) => {
fullWidth
required
autoComplete="email"
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '8px' } }}
/>
<TextField
label="Password"
Expand All @@ -115,38 +125,65 @@ const Login = ({ setIsLoggedIn, closeLogin, openSignup }) => {
fullWidth
required
autoComplete="current-password"
sx={{ '& .MuiOutlinedInput-root': { borderRadius: '8px' } }}
/>

<Box sx={{ position: "relative" }}>
<Button
type="submit"
variant="contained"
color="primary"
fullWidth
disabled={loading} // Disable button when loading
>
{loading ? <CircularProgress size={24} /> : "Login"}
</Button>
</Box>
<Button
type="submit"
variant="contained"
fullWidth
disabled={loading}
sx={{
py: 1.5,
borderRadius: '8px',
textTransform: 'none',
fontSize: '1rem',
fontWeight: 600,
backgroundColor: '#2563eb',
'&:hover': {
backgroundColor: '#1d4ed8',
},
}}
>
{loading ? <CircularProgress size={24} color="inherit" /> : "Sign In"}
</Button>

<Typography variant="body2" sx={{ textAlign: "center" }}>
Don't have an account?{" "}
<Link
component="button"
variant="body2"
onClick={() => {
closeLogin();
openSignup();
}}
>
Signup
</Link>
<br />
Forgot your password?{" "}
<Link component="button" variant="body2" onClick={handlePasswordReset}>
Reset Password
</Link>
</Typography>
<Box sx={{ textAlign: 'center', mt: 2 }}>
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
Don't have an account?{' '}
<Link
component="button"
variant="body2"
onClick={() => {
closeLogin();
openSignup();
}}
sx={{
fontWeight: 600,
color: '#2563eb',
textDecoration: 'none',
'&:hover': { textDecoration: 'underline' }
}}
>
Sign up
</Link>
</Typography>
<Typography variant="body2" sx={{ mt: 1, color: 'text.secondary' }}>
<Link
component="button"
variant="body2"
onClick={handlePasswordReset}
sx={{
fontWeight: 600,
color: '#2563eb',
textDecoration: 'none',
'&:hover': { textDecoration: 'underline' }
}}
>
Forgot password?
</Link>
</Typography>
</Box>
</Box>
);
};
Expand Down
Loading
Loading