diff --git a/public/pyqs/1stYear/1sem.pdf b/public/pyqs/1stYear/1sem.pdf new file mode 100644 index 0000000..d055796 Binary files /dev/null and b/public/pyqs/1stYear/1sem.pdf differ diff --git a/public/pyqs/1stYear/Nodejs Notes.pdf b/public/pyqs/1stYear/Nodejs Notes.pdf new file mode 100644 index 0000000..97b9517 Binary files /dev/null and b/public/pyqs/1stYear/Nodejs Notes.pdf differ diff --git a/public/pyqs/2ndYear/3rdsem.pdf b/public/pyqs/2ndYear/3rdsem.pdf new file mode 100644 index 0000000..d055796 Binary files /dev/null and b/public/pyqs/2ndYear/3rdsem.pdf differ diff --git a/public/pyqs/3rdYear/5thsem.pdf b/public/pyqs/3rdYear/5thsem.pdf new file mode 100644 index 0000000..d055796 Binary files /dev/null and b/public/pyqs/3rdYear/5thsem.pdf differ diff --git a/public/pyqs/4thYear/7thsem.pdf b/public/pyqs/4thYear/7thsem.pdf new file mode 100644 index 0000000..d055796 Binary files /dev/null and b/public/pyqs/4thYear/7thsem.pdf differ diff --git a/src/components/page3/1Year.js b/src/components/page3/1Year.js index b5259c8..92e1822 100644 --- a/src/components/page3/1Year.js +++ b/src/components/page3/1Year.js @@ -50,7 +50,7 @@ function fstYear() { - +

PYQ

diff --git a/src/components/page3/2Year.js b/src/components/page3/2Year.js index 0354ef4..575218a 100644 --- a/src/components/page3/2Year.js +++ b/src/components/page3/2Year.js @@ -42,14 +42,14 @@ function sndYear() {
- +

Timetable

- +

PYQ

diff --git a/src/components/page3/3Year.js b/src/components/page3/3Year.js index a8a34da..27322ad 100644 --- a/src/components/page3/3Year.js +++ b/src/components/page3/3Year.js @@ -52,7 +52,7 @@ function TrdYear() {
- +

PYQ

diff --git a/src/components/page4/Pyq.css b/src/components/page4/Pyq.css new file mode 100644 index 0000000..cf0759e --- /dev/null +++ b/src/components/page4/Pyq.css @@ -0,0 +1,151 @@ +html, body { + height: 100%; + margin: 0; + display: flex; + flex-direction: column; +} + +.page-container { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +.container-pyq { + text-align: center; + margin: 20px; + flex: 1; +} + +.year-heading { + font-size: 20px; + margin-bottom: 20px; +} + +.semester-selection { + display: flex; + justify-content: center; + gap: 20px; + margin-bottom: 20px; +} + +.semester-btn { + padding: 10px 20px; + font-size: 16px; + cursor: pointer; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 5px; + transition: background-color 0.3s ease; +} + +.semester-btn:hover { + background-color: #45a049; +} + +.file-item { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; +} + +.download-btn { + padding: 5px 10px; + font-size: 14px; + cursor: pointer; + background-color: #008CBA; + color: white; + border: none; + border-radius: 3px; + transition: background-color 0.3s ease; +} + +.download-btn:hover { + background-color: #007bb5; +} + +.back-btn { + padding: 10px 20px; + font-size: 16px; + cursor: pointer; + background-color: #f44336; + color: white; + border: none; + border-radius: 5px; + transition: background-color 0.3s ease; + margin-top: 20px; +} + +.back-btn:hover { + background-color: #e53935; +} + +.pyq-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 20px; +} + +.subjects-container { + display: flex; + gap: 20px; + flex-wrap: wrap; +} + +.subject-box { + border: 1px solid #ccc; + padding: 10px; + border-radius: 5px; + flex: 1; + min-width: 45%; +} + +.subject-title { + margin-bottom: 10px; +} + +@media (max-width: 1200px) { + .subject-box { + min-width: 100%; + } +} + +@media (max-width: 768px) { + .semester-selection { + flex-direction: column; + align-items: center; + } + + .semester-btn { + width: 100%; + margin-bottom: 10px; + } + + .subjects-container { + flex-direction: column; + gap: 15px; + } + + .subject-box { + min-width: 100%; + } +} + +@media (max-width: 600px) { + .subjects-container { + flex-direction: column; + gap: 10px; + } + + .subject-box { + min-width: 100%; + } +} + +.footer { + margin-top: auto; +} diff --git a/src/components/page4/pyq.js b/src/components/page4/pyq.js index c0d78b2..25481fe 100644 --- a/src/components/page4/pyq.js +++ b/src/components/page4/pyq.js @@ -1,13 +1,143 @@ -import React from 'react' -import ComingSoon from '../../pages/cs.js'; +import React, { useState } from 'react'; +import { useParams } from 'react-router-dom'; +import Header from "../../pages/header"; +import Footer from "../../pages/footer"; +import './Pyq.css'; + +function Pyq() { + const yearFiles = [ + { + year: '1st', + oddSemesters: { + subjects: [ + { name: 'Mathematics', files: ['1sem_mathematics.pdf', 'Nodejs Notes.pdf'] }, + { name: 'Physics', files: ['1sem_physics.pdf'] } + ] + }, + evenSemesters: { + subjects: [ + { name: 'Chemistry', files: ['2sem_chemistry.pdf'] }, + { name: 'Biology', files: ['2sem_biology.pdf'] } + ] + } + }, + { + year: '2nd', + oddSemesters: { + subjects: [ + { name: 'Computer Science', files: ['3rdsem.pdf'] } + ] + }, + evenSemesters: { + subjects: [ + { name: 'Electronics', files: ['4thsem_electronics.pdf'] } + ] + } + }, + { + year: '3rd', + oddSemesters: { + subjects: [ + { name: 'Data Structures', files: ['5thsem.pdf'] } + ] + }, + evenSemesters: { + subjects: [ + { name: 'Operating Systems', files: ['6thsem_operating_systems.pdf', 'os 23-24.pdf'] }, + { name: 'Networks', files: ['6thsem_networks.pdf'] } + ] + } + }, + { + year: '4th', + oddSemesters: { + subjects: [ + { name: 'Software Engineering', files: ['7thsem_software_engineering.pdf'] } + ] + }, + evenSemesters: { + subjects: [ + { name: 'Machine Learning', files: ['8thsem_machine_learning.pdf'] } + ] + } + } + ]; + + // Function to handle file download + const downloadFile = (filePath) => { + const link = document.createElement('a'); + link.href = `${process.env.PUBLIC_URL}/${filePath}`; + const file = filePath.split('/').pop(); + link.setAttribute('download', file); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }; + + const handleDownload = (filePath) => { + downloadFile(filePath); + }; + + const { id } = useParams(); + const yearItem = yearFiles.find((item) => item.year === id); + const [selectedSemester, setSelectedSemester] = useState(null); -function pyq() { return ( -
- - +
+
+
+

Download Previous Year Questions

+ {yearItem &&

{yearItem.year} Year

} +
+
+ {!selectedSemester ? ( +
+ + +
+ ) : ( + yearItem ? ( +
+
+ {selectedSemester === 'odd' ? yearItem.oddSemesters.subjects.map((subject, subjIndex) => ( +
+

{subject.name}

+
    + {subject.files.map((file, fileIndex) => ( +
  • + {file} + +
  • + ))} +
+
+ )) : yearItem.evenSemesters.subjects.map((subject, subjIndex) => ( +
+

{subject.name}

+
    + {subject.files.map((file, fileIndex) => ( +
  • + {file} + +
  • + ))} +
+
+ ))} +
+ + +
+ ) : ( +

Year data not found.

+ ) + )} +
+
+
+
- ) + ); } -export default pyq +export default Pyq; diff --git a/src/index.js b/src/index.js index 71d1f5b..987f79b 100644 --- a/src/index.js +++ b/src/index.js @@ -78,7 +78,7 @@ const router = createBrowserRouter([ element: }, { - path: "pyq", + path: "pyq/:id", element: }, {