Skip to content

Commit

Permalink
'coursepages'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanshika-73 committed May 20, 2024
1 parent c5f45df commit 81b3f61
Show file tree
Hide file tree
Showing 29 changed files with 1,015 additions and 35 deletions.
37 changes: 36 additions & 1 deletion components/Curriculum/SubjCard.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
import styles from "@styles/scss/subjcard.module.scss";
import Link from "next/link";
import Avatar from '@mui/material/Avatar';
// import InitialsAvatar from /'react-initials-avatar';
// import 'react-initials-avatar/lib/ReactInitialsAvatar.css';


function stringToColor(string) {
let hash = 0;
let i;

/* eslint-disable no-bitwise */
for (i = 0; i < string.length; i += 1) {
hash = string.charCodeAt(i) + ((hash << 5) - hash);
}

let color = '#';

for (i = 0; i < 3; i += 1) {
const value = (hash >> (i * 8)) & 0xff;
color += `00${value.toString(16)}`.slice(-2);
}
/* eslint-enable no-bitwise */

return color;
}

function stringAvatar(name) {
return {
sx: {
bgcolor: stringToColor(name),
},
children: `${name.split(' ')[0][0]}${name.split(' ')[0][1]}`,
};
}
const SubjCard = ({ details }) => {

return (
<Link href={details.linkToPage} passHref>
<div className={styles.subject}>
{/* <Image loading="lazy"></Image> */}
<div style={{display:"flex",justifyContent:"center",alignItems:"center", margin:'15px 0',padding:"10px 10px"}}>
<Avatar {...stringAvatar(details.name)} />
</div>
<span className={styles.name}>{details.name}</span>
</div>
</Link>
Expand Down
6 changes: 3 additions & 3 deletions components/common/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ const Navbar = () => {
onClick={() => setDropdown(false)}
className={styles.dropdownLink}
>
B.Tech
B.Tech/B.E
</a>
</Link>
</li>
<li>
<Link href='/'>
<Link href='/courses/mbbs'>
<a
onClick={() => setDropdown(false)}
className={styles.dropdownLink}
>
BE
MBBS
</a>
</Link>
</li>
Expand Down
3 changes: 2 additions & 1 deletion data/semData.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

export const firstYearSems = [
{
name: null,
subjects: [
{
name: "Applied Mathematics 1",
slug: "applied-mathematics-1",
img: null,
// img:( ),
linkToPage: "/courses/btech/first-year/applied-mathematics-1",
},
{
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/material": "^5.15.18",
"aos": "^2.3.4",
"axios": "^0.27.2",
"bcryptjs": "^2.4.3",
Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions pages/courses/btech/ChemicalEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Chemical Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
68 changes: 68 additions & 0 deletions pages/courses/btech/CivilEngineering/[subject].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import Subject from "components/Curriculum/Subject";
import { getSubjectPages } from "data/semData";

export const getStaticPaths = async () => {
const paths = [
{
params: {
subject: "applied-mathematics-1",
},
},
{
params: {
subject: "applied-chemistry",
},
},
{
params: {
subject: "thermo-dynamics",
},
},
{
params: {
subject: "electrical-engineering",
},
},
{
params: {
subject: "environmental-studies",
},
},
{
params: {
subject: "applied-chemistry-lab",
},
},
{
params: {
subject: "computer-programming-lab",
},
},
];

return {
paths,
fallback: false,
};
};

export const getStaticProps = async (context) => {
let subject = context.params.subject;
const data = getSubjectPages(subject);

if (data == null || data == undefined) {
return { notFound: true };
}

return { props: { data } };
};

const GeneralSubject = ({ data }) => {
return (
<>
<Subject data={data} />
</>
);
};

export default GeneralSubject;
50 changes: 50 additions & 0 deletions pages/courses/btech/CivilEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Civil Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
68 changes: 68 additions & 0 deletions pages/courses/btech/ComputerEngineering/[subject].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import Subject from "components/Curriculum/Subject";
import { getSubjectPages } from "data/semData";

export const getStaticPaths = async () => {
const paths = [
{
params: {
subject: "applied-mathematics-1",
},
},
{
params: {
subject: "applied-chemistry",
},
},
{
params: {
subject: "thermo-dynamics",
},
},
{
params: {
subject: "electrical-engineering",
},
},
{
params: {
subject: "environmental-studies",
},
},
{
params: {
subject: "applied-chemistry-lab",
},
},
{
params: {
subject: "computer-programming-lab",
},
},
];

return {
paths,
fallback: false,
};
};

export const getStaticProps = async (context) => {
let subject = context.params.subject;
const data = getSubjectPages(subject);

if (data == null || data == undefined) {
return { notFound: true };
}

return { props: { data } };
};

const GeneralSubject = ({ data }) => {
return (
<>
<Subject data={data} />
</>
);
};

export default GeneralSubject;
50 changes: 50 additions & 0 deletions pages/courses/btech/ComputerEngineering/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Footer from "components/common/Footer";
import Header from "components/common/Header/Header";
import Sems from "components/Curriculum/Sems";
import { firstYearSems } from "data/semData";
import styles from '@styles/Home.module.css';
const ComputerEngineering = () => {
return (
<div>
<Header image="/images/blog/blog_bg.svg" text="Computer Engineering" />
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>First Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* second yr */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Second Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* third Year*/}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Third Year</h2>
/</div>
<Sems data={firstYearSems} />
{/* fourth */}
<div
data-aos='fade-up'
className={styles.ourserv}
id={styles.ourserv}
>
<h2>Fourth Year</h2>
/</div>
<Sems data={firstYearSems} />
<Footer />
</div>
);
};

export default ComputerEngineering;
Loading

0 comments on commit 81b3f61

Please sign in to comment.