Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7d90091
Began html&css
Al3afifi Feb 10, 2022
60832eb
Continued working, adding buttons
Al3afifi Feb 11, 2022
0c589ac
completed experimenting with html
Al3afifi Feb 12, 2022
4f0357f
completed most of the css
Al3afifi Feb 15, 2022
851062c
finished the cart of the website
Al3afifi Feb 15, 2022
1e8b8b8
setting up react
Al3afifi Feb 18, 2022
8a89d37
finished react testing
Al3afifi Feb 20, 2022
eb4518f
Merge branch 'main' into Alafifi-Branch
Al3afifi Feb 25, 2022
d57e9ff
made button and began popup
Al3afifi Feb 27, 2022
90e6da1
balanced out the navbar
Al3afifi Feb 28, 2022
be2319d
tiny alterations
Al3afifi Feb 28, 2022
158e3da
Finished up settings tab
Al3afifi Feb 28, 2022
b08cc8d
deleted my practice files
Al3afifi Feb 28, 2022
15779be
removed testing darkmode
Al3afifi Feb 28, 2022
11a0cb8
Update .eslintrc.json
Al3afifi Feb 28, 2022
883c837
Settings description
Al3afifi Mar 1, 2022
2bc41bf
auto adjusting for smaller screens
Al3afifi Mar 1, 2022
46251a7
new dark mode button
Al3afifi Mar 3, 2022
ba92e87
new dark mode button
Al3afifi Mar 3, 2022
4e45f66
dark/lightmode button works now
Al3afifi Mar 8, 2022
5c401b0
hid away the classes page
Al3afifi Mar 8, 2022
df66bce
Merge branch 'main' of github.com:rpi-crisis/crisis into Alafifi-Cris…
TrevorBrunette Mar 13, 2022
881065e
Resolve merge conflicts from main. Added settings to state and change…
TrevorBrunette Mar 13, 2022
ea98a0f
Fixed styles, centered NavBar, and adjusted logo.
TrevorBrunette Mar 13, 2022
6abf044
now opens a new link when clicking on the title
Al3afifi Mar 15, 2022
3c9c1af
working on specific class page
Al3afifi Mar 18, 2022
0ec6af2
Merge branch 'main' into Alafifi-Branch
Al3afifi Mar 22, 2022
aeb82f5
updated to the main
Al3afifi Mar 22, 2022
9fb7c89
Classes result page displays title
Al3afifi Mar 22, 2022
b2e01c2
just quick updates and all
Al3afifi Mar 25, 2022
14dcf2c
Merge branch 'main' into Alafifi-Branch
Al3afifi Mar 29, 2022
bff27bb
finally checks and finds the class
Al3afifi Mar 29, 2022
42ce3bc
prints out class and description and transfers
Al3afifi Mar 30, 2022
83a2679
just more working around with look of classes page
Al3afifi Mar 31, 2022
40247de
new files for separating the output
Al3afifi Apr 5, 2022
2d601ce
rerouting all the info to a separate file for classes
Al3afifi Apr 6, 2022
5bf7226
more messing around with the class page
Al3afifi Apr 10, 2022
9e8f207
Merge branch 'main' into Alafifi-Branch
Al3afifi Apr 10, 2022
7ada7bb
related classes, class details, and right sidebar
Al3afifi Apr 11, 2022
e263a1f
better formatting for classes page
Al3afifi Apr 11, 2022
c10d68f
little more formatting
Al3afifi Apr 14, 2022
3c707d1
more formatting of classes page
Al3afifi Apr 26, 2022
99c3f55
comments
Al3afifi Apr 26, 2022
abe9f59
more comments
Al3afifi Apr 26, 2022
f78f884
more comments
Al3afifi Apr 26, 2022
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
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function App() {
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/about" element={<AboutPage />} />
<Route path="/classes" element={<ClassesPage />} />
<Route path="/class/*" element={<ClassesPage />} />
<Route path="*" element={<h1>Error 404: Page not found</h1>}/>
</Routes>
</Router>
Expand Down
19 changes: 18 additions & 1 deletion src/components/class/class.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@
}

.body-title {
left: 15vw;
text-align: left;
width: 70%;
width: 70vw;
}

#class-description {
Expand Down Expand Up @@ -146,3 +147,19 @@
transform: scale(1.2);
--icon-color: var(--highlight-color);
}

.classRedirect{
color: var(--accent-color);
padding: 2%;
margin: 4%;
width: 40%;
border-radius: 0.5em;
}

.classRedirect:hover{
background-color: rgba(0, 0, 0, .5);
}

.classRedirectTitle{
font-weight: bold;
}
19 changes: 7 additions & 12 deletions src/components/class/class.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FC, useState, useEffect } from "react";
import { Link } from "react-router-dom";
import "./class.css";

/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
Expand Down Expand Up @@ -41,18 +42,12 @@ const Class: FC<{data: any}> = ({data}) => {
<div id="class-description">
{data.description}
</div>
<div className="body-title">Transfers</div>
<div id="transfers">
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
{data.transfer.length > 0 ? data.transfer.map((el: any, pos: number) => (
<div id="class-header" key={pos}>
<div>{el.title}</div>
<div>{el.id}</div>
<div>{el.school}</div>
<div>{el.location}</div>
</div>
)) : <div>No Transfers</div>}
</div>
{/* feel free to get rid of this part and make it direct transfer from little class box to website
I did this for convenience and liked the smootheness lol */}
<a href={"/class/" + data.department + data.id_num} className="classRedirect">
HEAD OVER TO THE NEW PAGE FOR
<div className="classRedirectTitle"> [{data.title}] </div>
</a>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/settings/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
inset: 0;
}


.settings-exit {
position: absolute;
right: 0.5em;
Expand Down
157 changes: 157 additions & 0 deletions src/pages/classes/classes.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,161 @@
justify-content: flex-start;
font-size: calc(10px + 2vmin);
color: var(--header-color);
}

.whole-body{
display: flex;
flex-direction: row;
margin-top: 1em;
justify-content: space-around;
}

.course-titles{
width: 100%;
display: flex;
flex-flow: row;
justify-content: center;
margin-top: 0.5em;
font-size: 1.05em;
gap: 5%;
}

.course-title-items{
/* min-width: 20vw; */
max-width: 25vw;
}

.left-body {
display: flex;
flex-flow: column wrap;
justify-content: left;
align-items: center;
height: 80%;
margin-top: 1em;
flex-grow: 3;
}

.right-body {
display: flex;
flex-flow: column wrap;
justify-content: right;
align-items: center;
height: 80%;
margin-top: 1em;
flex-grow: 1;
}

.body-title {
left: 15;
text-align: left;
width: 70%;
}

.description-title{
width: 60vw;
}

.transferlistTitle{
width: 60vw;
}

.transferlistTitle:hover{
background-color: rgba(0, 0, 0, .5);
}

.arrow {
border: solid var(--accent-color);
border-width: 0 0.2em 0.2em 0;
display: inline-block;
padding: 0.2em;
transition: 0.5s;
transform: rotate(-45deg);
justify-content: end;
}

.arrow:hover{
transform: rotate(45deg);
}

.transferList{
width: 60vw;
height: 35%;
max-height: 35vh;
overflow: scroll;
overflow-x: hidden;
padding: 0.5em;
border-radius: 0.5em;
color: var(--text-color);
border: solid var(--highlight-color);
text-align: left;
font-size: 0.8rem;
}

.sectionlistTitle{
width: 20vw;
}

.sectionsList{
width: 20vw;
height: 35%;
max-height: 35vh;
overflow: scroll;
overflow-x: hidden;
padding: 0.5em;
border-radius: 0.5em;
color: var(--text-color);
border: solid var(--highlight-color);
text-align: left;
font-size: 0.8rem;
}

.class-header {
width: 100%;
display: flex;
flex-flow: row;
justify-content: flex-start;
margin-top: 0.5em;
font-size: 1.05em;
}

.class-header>* {
width: 20%;
margin: auto;
}

.class-header>*:first-child{
width: 40%
}

.class-description {
width: 60vw;
height: 35%;
max-height: 35vh;
overflow: auto;
overflow-x: hidden;
padding: 0.5em;
border-radius: 0.5em;
color: var(--text-color);
border: solid var(--highlight-color);
text-align: left;
text-indent: 2em;
font-size: 0.8em;
}

.right-sidebox{
display: block;
width: 20vw;
height: 35%;
overflow: hidden;
overflow-x: auto;
padding: 0.5em;
border-radius: 0.5em;
color: var(--text-color);
border: solid var(--highlight-color);
text-align: left;
font-size: 0.8em;
}

.req-title{

}
102 changes: 57 additions & 45 deletions src/pages/classes/classes.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,67 @@
import React, { FC /*, useState, useEffect */ } from "react";
import React, { FC, useState } from "react";
import "./classes.css";

// import { CourseSearcher } from "../../scripts/fuzzy-search";
import "../../components/class/class.css";

import NavBar from "../../components/navbar/navbar";
// import SearchBar from "../../components/search/search";
import Pages from "../pageList";
// import Class from "../../components/class/class";
// import { Course } from "../../types";
import Class from "../../components/class/class";
import { CourseSearcher } from "../../scripts/fuzzy-search";
import { useAppSelector } from "../../store";
import { Transfer } from "../../types";
import ClassesInfo from "./classesComps/classesInfo";

// interface InputState {
// results: Course[];
// }
//
// const searcher = new CourseSearcher();
const searcher = new CourseSearcher();

const ClassesPage: FC = () => {

// const [state, setState] = useState<InputState>({results:[]});
//
// const [searchbar_content, content_update] = useState<string>("");
//
// const searchQuery = (query: string): void => {
// if(query === "") {
// setState({results: []});
// return;
// }
// const results = searcher.search(query).slice(0,7);
// console.log(results);
// setState({results: results});
// };
//
// const call_search = React.useCallback((value: string): void => {
// searchQuery(value);
// }, []);
//
// useEffect(() => {
// const timeOutId = setTimeout(() => call_search(searchbar_content),200);
// return () => clearTimeout(timeOutId);
// },[searchbar_content,call_search]);

return (
<div className="App">
<header className="App-header">
<NavBar pages={Pages("Classes")}/>
<h3>Enter the department you want</h3>
{/*<SearchBar content_update={content_update}/>*/}
{/*{state.results.map((el,pos) => {return <Class key={pos} data={el}/>;})}*/}
</header>
</div>
);
};

const pathname = window.location.pathname;
const classCode = pathname.substring(7);
const classDept = classCode.substring(0,4).toUpperCase();
const classNum = classCode.substring(4);

const { courses } = useAppSelector(state => state.courses);

searcher.update(Object.values(courses));
const results = searcher.search(classCode);

// fuzzy search not the fastest nor best however, it was only solution i could find :(

if(classCode.length != 8){
return (
<div className="App">
<header className="App-header">
<NavBar pages={Pages("Classes")}/>
<h3>ERROR 404: PAGE NOT FOUND</h3>
invalid class code
</header>
</div>
);
}
else if(results[0].id == classDept + "-" + classNum){

return (
<div className="App">
<header className="App-header">
<NavBar pages={Pages("Classes")}/>
<div style={{width: "100%"}}>
<ClassesInfo course={results[0]}/>
</div>
</header>
</div>
);
}
else{
return (
<div className="App">
<header className="App-header">
<NavBar pages={Pages("Classes")}/>
<h3>No class found</h3>
Did you mean any of these:
{results.splice(0,5).map((el,pos) => {return <Class key={pos} data={el}/>;})}
</header>
</div>
);
}
};
export default ClassesPage;
Loading