Skip to content

Commit

Permalink
feat: improve styling, add background, fix primary color and notifica…
Browse files Browse the repository at this point in the history
…tions

issue #66
  • Loading branch information
RMCampos committed Oct 6, 2024
1 parent d03c963 commit 9d430b9
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 45 deletions.
Binary file added client/src/assets/landing-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions client/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Button, Col, Container, Row
} from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
import { env } from '../../env';
import AuthContext from '../../context/AuthContext';
import './style.css';

Expand All @@ -19,7 +18,7 @@ import './style.css';
function Footer(): JSX.Element {
const { signOut, user } = useContext(AuthContext);
const navigate = useNavigate();
const build = env.VITE_BUILD;
const build = import.meta.env.VITE_BUILD;
const currentYear = new Date().getFullYear();

const goOut = () => {
Expand Down
19 changes: 12 additions & 7 deletions client/src/styles/custom.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
//$theme-colors: (
// 'info': tomato,
// 'danger': teal,
// 'primary': green,
//);
$theme-colors: (
'info': tomato,
'danger': teal,
'primary': #61cd8d,
);

@import '~bootstrap/scss/bootstrap';

.bg-body-secondary {
background-color: red;
$primary-color: #61cd8d;
$light-bg: #f8f9fa;
$dark-text: #343a40;

body {
background-color: $light-bg;
}

11 changes: 5 additions & 6 deletions client/src/views/Landing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useCallback, useContext, useEffect } from 'react';
import { Button, Container } from 'react-bootstrap';
import './styles.scss';
import { useNavigate } from 'react-router-dom';
import AuthContext from '../../context/AuthContext';
import './styles.scss';

/**
* Landing page component.
Expand Down Expand Up @@ -45,10 +45,10 @@ function Landing(): JSX.Element {
}, []);

return (
<Container fluid className="vh-100 d-flex justify-content-center align-items-center">
<div className="text-center">
<h1 className="display-4 fw-bold">Welcome to TaskNote App</h1>
<p className="lead mb-4">
<Container fluid className="vh-100 d-flex justify-content-center align-items-center landing-page">
<div>
<h1 className="display-4">Welcome to TaskNote</h1>
<p className="lead">
Your best friend to keep up with notes and tasks!
</p>

Expand All @@ -71,7 +71,6 @@ function Landing(): JSX.Element {
</Button>
</div>
</Container>

);
}

Expand Down
63 changes: 61 additions & 2 deletions client/src/views/Landing/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
body {
background-color: #ccc;
$primary-color: #61cd8d;
$light-bg: #f8f9fa;
$dark-text: #343a40;

.landing-page {
position: relative;
text-align: center;
color: $dark-text;
background: url('../../assets/landing-bg.jpg') no-repeat center center;
background-size: cover; // Ensures the image covers the whole background

&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.85); // Slight white overlay for text readability
z-index: 1;
}

div {
position: relative;
z-index: 2; // Ensures the content is above the background and overlay
}

h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
color: $dark-text;
}

p {
font-size: 1.25rem;
margin-bottom: 2rem;
color: $dark-text;
}

.btn-lg {
font-size: 1rem;
padding: 0.75rem 1.5rem;
}

.btn-primary {
background-color: $primary-color;
border-color: $primary-color;
&:hover {
background-color: darken($primary-color, 10%);
}
}

.btn-outline-primary {
color: $primary-color;
border-color: $primary-color;
&:hover {
background-color: $primary-color;
color: #fff;
}
}
}
26 changes: 14 additions & 12 deletions client/src/views/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import React, {
import {
Alert, Button, Card, Col, Container, Form, Row
} from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import AuthContext from '../../context/AuthContext';
import './styles.scss';

/**
* Login page component.
Expand Down Expand Up @@ -45,6 +46,7 @@ function Login(): JSX.Element {
const form = event.currentTarget;
if (form.checkValidity() === false) {
setFormInvalid(true);
setErrorMessage('Please fill in your username and password!');
return;
}

Expand All @@ -65,12 +67,12 @@ function Login(): JSX.Element {
useEffect(() => {}, [formInvalid]);

return (
<Container className="vh-100 d-flex justify-content-center align-items-center">
<Container fluid className="login-page">
<Row className="justify-content-center w-100">
<Col xs={12} md={6} lg={4}>
<Card>
<Card.Body className="p-4">
<h2 className="text-center mb-4">Login</h2>
<h2 className="text-center">Login</h2>

{formInvalid ? (
<Alert variant="danger">
Expand All @@ -80,12 +82,12 @@ function Login(): JSX.Element {

<Form noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className="mb-3" controlId="formBasicEmail">
<Form.Label>Email address</Form.Label>
<Form.Label>Email</Form.Label>
<Form.Control
required
type="email"
name="email"
placeholder="Enter email"
placeholder="Type your email here"
/>
</Form.Group>

Expand All @@ -95,7 +97,7 @@ function Login(): JSX.Element {
required
type="password"
name="password"
placeholder="Password"
placeholder="Type your password here"
/>
</Form.Group>

Expand All @@ -109,16 +111,16 @@ function Login(): JSX.Element {
</Form>

<div className="text-center mt-3">
Don&apos;t have an account?&nbsp;
<a href="/register" className="text-decoration-none">
Register
</a>
Don&apos;t have an account yet?&nbsp;
<Link to={"/register"} className="text-decoration-none">
Register here
</Link>
</div>

<div className="text-center mt-3">
<a href="/" className="text-decoration-none">
<Link to={"/"} className="text-decoration-none">
Back to home
</a>
</Link>
</div>
</Card.Body>
</Card>
Expand Down
62 changes: 62 additions & 0 deletions client/src/views/Login/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
$primary-color: #61cd8d;
$light-bg: #f8f9fa;
$dark-text: #343a40;

.login-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: url('../../assets/landing-bg.jpg') no-repeat center center;
background-size: cover;

&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.85); // White overlay for readability
z-index: 1;
}

.card {
position: relative;
z-index: 2;
border: none;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h2 {
font-size: 1.75rem;
font-weight: 600;
margin-bottom: 1.5rem;
color: $dark-text;
}

.form-control {
border-radius: 5px;
}

.btn-primary {
background-color: $primary-color;
border-color: $primary-color;
&:hover {
background-color: darken($primary-color, 10%);
}
}

.text-center a {
color: $primary-color;
&:hover {
text-decoration: underline;
}
}

.alert-danger {
background-color: rgba(255, 0, 0, 0.1);
border-color: rgba(255, 0, 0, 0.3);
}
}
29 changes: 13 additions & 16 deletions client/src/views/Register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, {
import {
Alert, Button, Card, Col, Container, Form, Row
} from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import AuthContext from '../../context/AuthContext';

/**
Expand Down Expand Up @@ -45,6 +45,7 @@ function Register(): JSX.Element {
const form = event.currentTarget;
if (form.checkValidity() === false) {
setFormInvalid(true);
setErrorMessage('Please fill in your username and password!');
return;
}

Expand All @@ -65,12 +66,12 @@ function Register(): JSX.Element {
useEffect(() => {}, [formInvalid]);

return (
<Container className="vh-100 d-flex justify-content-center align-items-center">
<Container fluid className="login-page">
<Row className="justify-content-center w-100">
<Col xs={12} md={6} lg={4}>
<Card>
<Card.Body className="p-4">
<h2 className="text-center mb-4">Create account</h2>
<h2 className="text-center">Create account</h2>

{formInvalid ? (
<Alert variant="danger">
Expand All @@ -80,12 +81,12 @@ function Register(): JSX.Element {

<Form noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Group className="mb-3" controlId="formBasicEmail">
<Form.Label>Email address</Form.Label>
<Form.Label>Email</Form.Label>
<Form.Control
required
type="email"
name="email"
placeholder="Enter email"
placeholder="Type your email here"
/>
</Form.Group>

Expand All @@ -95,7 +96,7 @@ function Register(): JSX.Element {
required
type="password"
name="password"
placeholder="Password"
placeholder="Type your password here"
/>
</Form.Group>

Expand All @@ -104,25 +105,21 @@ function Register(): JSX.Element {
type="submit"
className="w-100"
>
Login
Sign-up and register
</Button>
</Form>

<div className="text-center mt-3">
Already have an account?&nbsp;
<a href="/login" className="text-decoration-none">
Login
</a>
&nbsp;or&nbsp;
<a href="/" className="text-decoration-none">
Reset
</a>
<Link to={"/login"} className="text-decoration-none">
Go to Login
</Link>
</div>

<div className="text-center mt-3">
<a href="/" className="text-decoration-none">
<Link to={"/"} className="text-decoration-none">
Back to home
</a>
</Link>
</div>
</Card.Body>
</Card>
Expand Down

0 comments on commit 9d430b9

Please sign in to comment.