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

Added light and dark mode. Update Navbar with search field and other … #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Navbar from './pages/Navbar';
import './index.css'
import Home from './pages/Home';
import Team from './pages/Team';
import MemberPage from "./pages/Member";
import { useEffect, useState } from "react";

function App() {

const current_theme = localStorage.getItem('current_theme'); // This will store the default theme of web browser
const [theme, setTheme] = useState(current_theme ? current_theme : 'light'); // Created constant for dark mode

useEffect (()=>{
localStorage.setItem('current_theme', theme);
},[theme])


return (
<div className="App">
<div className={`App ${theme}`}>
<Router>
<Navbar />
<Navbar theme={theme} setTheme={setTheme} />
<Routes>
<Route exact path="/" element={<Home />} />
<Route exact path="/team/:code" element={<Team />} />
Expand Down
24 changes: 24 additions & 0 deletions src/component/CreateMember.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.create-member {
margin: 0;
padding: 0;
}

.create-member .create-button-member {
background-color: #078d14; /* Button background color */
padding: 10px;
margin: 20px;
color: #fff;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
font-size: 15px;
width: 90%;
align-items: center;
}

/* Style for the buttons on hover */
.create-member .create-button-member:hover {
background-color: #055837;
color: white;
}
6 changes: 3 additions & 3 deletions src/component/CreateMember.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import '../index.css';
import './CreateMember.css';
// use this format if fetching
import { apiPath } from '../api';
// fetch(apiPath('/teams'))
Expand Down Expand Up @@ -53,9 +53,9 @@ function CreateMember({teamsDatabase }) {
};

return (
<div>
<div className="create-member">
{!isFormVisible && (
<button className="create-button" onClick={() => setIsFormVisible(true)}>Create Member</button>
<button className="create-button-member" onClick={() => setIsFormVisible(true)}>Create Member</button>
)}
{isFormVisible && (
<form onSubmit={handleSubmit} className="member-form">
Expand Down
18 changes: 18 additions & 0 deletions src/component/CreateTeam.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.create-button-team {
background-color: #890aad; /* Button background color */
padding: 10px;
margin: 20px;
color: #fff;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
font-size: 15px;
width: 35%;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using percentages for layout widths can lead to unpredictable behavior on different devices. Please be aware of this or consider using a more stable approach like flexbox.

align-items: center;
}

/* Style for the buttons on hover */
.create-button-team:hover {
background-color: #4c095d;
}
4 changes: 2 additions & 2 deletions src/component/CreateTeam.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../index.css';
import './CreateTeam.css';
import { apiPath } from '../api';

const CreateTeam = ({ setTeamsDatabase }) => {
Expand Down Expand Up @@ -32,7 +32,7 @@ const CreateTeam = ({ setTeamsDatabase }) => {
}
};
return (
<button className="create-button" onClick={handleCreateTeam}>Create Team</button>
<button className="create-button-team" onClick={handleCreateTeam}>Create Team</button>
);
};

Expand Down
50 changes: 50 additions & 0 deletions src/component/SubmitTeam.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.submitTeam-container {
display: flex;
/* justify-content: center; */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

padding: 10px 0px;
margin: 10px 0px;
}

/* Style for the label */
.submitTeam-container label {
font-size: 20px;
font-weight: bold;
text-align: center;
padding-right: 10px;
padding-top: 2px;
text-shadow: none;
}

/* Style for the input field */
.submitTeam-container input[type="text"] {
box-sizing: border-box;
width: 45%;
border: 2px solid ;
border-radius: 15px;
border-color: #007bff;
text-align: center;
font-size: 15px;
}

/* Style for the buttons */
.submitTeam-container button {
background-color: #007bff; /* Button background color */
padding: 10px;
margin-left: 10px;
color: #fff;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
font-size: 15px;
width: 20%;
}

/* Style for the buttons on hover */
.submitTeam-container button:hover {
background-color: #04376d; /* Darker background color on hover */
}

.dark .submitTeam-container label {
color: cornsilk;;
}
2 changes: 1 addition & 1 deletion src/component/SubmitTeam.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import '../index.css';
import './SubmitTeam.css';
// use this format if fetching
import { apiPath } from '../api';
// fetch(apiPath('/teams'))
Expand Down
Binary file added src/img/home/imgBg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/home/imgTop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/day.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/logo-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/logo-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/img/navbar/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/night.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/search-b.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/navbar/search-w.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 13 additions & 91 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
Expand All @@ -12,101 +14,21 @@ code {
monospace;
}

/* Style for the h2 heading */
.top-Header h2{
font-family: 'EB Garamond', serif; /* Use a serif font for a classical feel */
font-size: 40px; /* Adjust the font size for mobile */
font-weight: bold; /* Make the text bold */
color: #0f0b0b; /* Text color */
text-align: center; /* Center align the text */
text-shadow: 5px 5px 5px grey;
margin: 0px; /* Reduce the bottom margin for mobile */
padding-top: 80px; /* Reduce the padding below the border line for mobile */
padding-bottom: 20px; /* Reduce the padding below the border line for mobile */
}

.submitTeam-container {
display: flex;
justify-content: center;
padding: 10px 0px;
margin: 10px 0px;
}

/* Style for the label */
.submitTeam-container label {
font-size: 20px;
font-weight: bold;
text-align: center;
padding-right: 10px;
padding-top: 2px;
text-shadow: none;
}

/* Style for the input field */
.submitTeam-container input[type="text"] {
box-sizing: border-box;
width: 25%;
border: 2px solid ;
border-radius: 15px;
border-color: #007bff;
text-align: center;
font-size: 15px;
/* Defalut color for light theme */
.App {
width: 100vw;
height: 100vh;
background: #131111;
transition: 0.5s;
background-image: url("./img/home/imgBg.jpg");
background-size: 100vw;
}

/* Style for the buttons */
.submitTeam-container button {
background-color: #007bff; /* Button background color */
padding: 10px;
margin-left: 10px;
color: #fff;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
font-size: 15px;
width: 10%;
/* Dark theme color */
.App.dark {
background: #222;
}

/* Style for the buttons on hover */
.submitTeam-container button:hover {
background-color: #04376d; /* Darker background color on hover */
}

.create-button {
background-color: #078d14; /* Button background color */
padding: 10px;
margin-right: 40px;
color: #fff;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
font-size: 15px;
width: 10%;
align-items: center;
}

/* Style for the buttons on hover */
.create-button:hover {
background-color: #044627;
}

/* Navbar Styling */
.header {
width: 100%;
height: 40px;
background: #b9d3de;
position: sticky;
top: 0;
left: 0;
padding : 20px 0px;
}

.container {
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
padding-bottom: 16px;
padding-left: 20px;
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
// import './index.css';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it

import App from './App';
import reportWebVitals from './reportWebVitals';

Expand Down
68 changes: 68 additions & 0 deletions src/pages/Home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Style for the h2 heading */
.mainSection {
display: flex;
justify-content: space-around;
align-items: center;
}

.top-Header {
padding: 2rem;
width: 40%;
}

.top-Header h2 {
font-family: 'EB Garamond', serif;
font-size: 40px;
font-weight: bold;
color: #0f0b0b;
text-align:left;
text-shadow: 5px 5px 5px #808080;
margin: 0px;
padding-left: 10rem;
}

.top-Header p {
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif, 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 1.2rem;
margin: 1rem 0;
}

.top-Header .create-container{
display: flex;
justify-content: space-around;
align-items: center;
padding: 0;
margin: 0;
}

.imgContainer {
width: 50%;
}

.imgContainer img{
width: 90%;
display: block;
padding: 2.5rem;

}

.dark .top-Header h2{
color: #f7f3cc;
text-shadow: 2px 2px 2px #eff192;

}

.dark .top-Header p {
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif, 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 1.2rem;
margin: 1rem 0;
color: cornsilk;
}


.dark .imgContainer img{
width: 90%;
margin: 0 0;
display: block;
padding: 2.5rem;
}