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

coursepages #645

Open
wants to merge 2 commits into
base: develop
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion components/Curriculum/SubjCard.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
import styles from "@styles/scss/subjcard.module.scss";
import Link from "next/link";
import Avatar from '@mui/material/Avatar';


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:( ),
Copy link
Member

Choose a reason for hiding this comment

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

why?

Copy link
Author

Choose a reason for hiding this comment

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

because I have used Initials Avatar for the subjects.

linkToPage: "/courses/btech/first-year/applied-mathematics-1",
},
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@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
2 changes: 1 addition & 1 deletion pages/courses/bcom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Header from "components/common/Header/Header";
import styles from "@styles/Btech.module.css";
import Footer from "components/common/Footer";

export default function BTech() {
export default function BCom() {
const image = "/images/btech/top_bg.jpg";
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion pages/courses/bsc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Header from "components/common/Header/Header";
import styles from "@styles/Btech.module.css";
import Footer from "components/common/Footer";

export default function BTech() {
export default function BSc() {
const image = "/images/btech/top_bg.jpg";
return (
<>
Expand Down
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 ChemicalEngineering = () => {
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 ChemicalEngineering;
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 CivilEngineering = () => {
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 CivilEngineering;
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