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

Made login buttons #38

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 8 additions & 4 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ function App() {
const programs = [CGSC, CPSC, ECON, HIST];
const strPrograms = JSON.stringify(programs);
localStorage.setItem("programList", strPrograms);



return (
<div>
<Routes>
<Route path="/" element={auth ? <Navigate to="/graduation"/> : <Navigate to="/login"/>}/>
{/* <Route path="/" element={auth ? <Navigate to="/graduation"/> : <Navigate to="/login"/>}/>
<Route path="/login" element={auth ? <Navigate to="/graduation"/> : <Login/>}/>

<Route path="/graduation" element={auth ? <Graduation/> : <Navigate to="/login"/>}/>
<Route path="/courses" element={auth ? <Courses/> : <Navigate to="/login"/>}/>
<Route path="/majors" element={auth ? <Majors/> : <Navigate to="/login"/>}/>
<Route path="/majors" element={auth ? <Majors/> : <Navigate to="/login"/>}/> */}
<Route path="/" element={<Navigate to="/login"/>}/>
<Route path="/login" element={<Login />}/>

<Route path="/graduation" element={<Graduation/>}/>
<Route path="/courses" element={<Courses/>}/>
<Route path="/majors" element={<Majors/>}/>
</Routes>
</div>
);
Expand Down
Binary file added frontend/src/commons/images/reallycoolguy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions frontend/src/pages/Login/Login.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.centerDiv {
min-height: 100vh;
text-align: center;
max-width: 1000px;
margin-left: auto;
margin-right: auto;
justify-content: center;
align-items: center;
padding: 1rem;
display: flex;
flex-wrap: wrap;
}

.featureListStyle {
list-style: none;
display: flex;
flex-direction: column;
gap: .5rem;
margin: 0;
padding: 0;
}

.featureItemStyle {
font-weight: 500;
transition: transform .3s;
cursor: default;
text-align: left;
}

.featureItemStyle:hover {
transform: translateX(7px);
}

.loginButtons {
display: flex;
margin-left: auto;
margin-right: auto;
margin-top: 3px;
justify-content: start;
justify-content: center;
}

.btn {
padding: 8px 24px;
border-radius: 10px;
font-weight: 500;
color: black;
background-color: lightblue;
transition:
transform 0.3s,
filter 0.3s;
margin-top: 8px;
}

.btn:hover {
text-decoration: none;
transform: translateY(-5px);
filter: brightness(90%);
}
59 changes: 47 additions & 12 deletions frontend/src/pages/Login/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,62 @@

import React, { useState } from "react";
import navStyles from "./../../navbar/NavBar.module.css";
import logo from "./../../commons/images/ma_logo.png";
import { Link } from "react-router-dom";
import styles from "./Login.module.css";

import navStyles from "../../navbar/NavBar.module.css";
import logo from "../../commons/images/ma_logo.png";
import loginPageImage from "../../commons/images/reallycoolguy.jpg";

function NavBar() {
return(
return (
<div className={navStyles.NavBar}>
<div style={{ marginLeft: "20px" }}>
<img src={logo} alt="" style={{ width: "150px", height: "auto", marginRight: "10px" }}/>
<img
src={logo}
alt=""
style={{ width: "150px", height: "auto", marginRight: "10px" }}
/>
</div>
{/* <PageLinks />
<MeDropdown /> */}
</div>
);
}


function Login(){
return(
function Login() {
return (
<div>
<NavBar/>

<NavBar />
<div className={styles.centerDiv}>
<div style={{width: "450px"}}>
<h1>The best place to explore and plan your major at Yale</h1>
<ul className={styles.featureListStyle}>
<li className={styles.featureItemStyle}>Explore all 80+ majors at Yale</li>
<li className={styles.featureItemStyle}>Check all your distributional requirements are satisfied</li>
<li className={styles.featureItemStyle}>Plan out all your courses in the traditional four-year plan</li>
<li className={styles.featureItemStyle}>Look at this really cool guy to the right</li>
</ul>
<div className={styles.loginButtons}>
{/* <a
href={`${API_ENDPOINT}/api/auth/cas?redirect=${window.location.origin}/catalog`}
className={clsx(styles.btn, styles.login, 'me-2')}
>
Login with CAS
</a> */}
<Link to="/graduation" className={styles.btn} style={{marginRight: "8px"}}>
Login with CAS
</Link>
<Link to="/courses" className={styles.btn} style={{marginRight: "8px"}}>
About Us
</Link>
<Link to="/majors" className={styles.btn}>
Guest
</Link>
</div>
</div>
<img alt="Landing page" src={loginPageImage} width="450"/>
</div>
</div>
)
);
}

export default Login;

Loading