Skip to content

Commit 98cad04

Browse files
committed
final
1 parent 102f796 commit 98cad04

File tree

5 files changed

+35
-24
lines changed

5 files changed

+35
-24
lines changed

public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2525
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet" />
2626
<link rel="stylesheet" href="../src/App.css">
27-
<title>Department of Computer Science and Engineering</title>
27+
<title>NITJ</title>
2828
</head>
2929

3030
<body className="scrollbar scroll-smooth">

src/App.js

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
import './App.css';
22
import AppRouter from './AppRouter';
33
function App() {
4-
4+
const departments={
5+
"it":"Information Technology",
6+
"cse":"Computer Science and Engineering",
7+
"bt":"Bio Technology",
8+
"ce":"Civil Engineering",
9+
"ch":"Chemical Engineering",
10+
"ece":"Electronics And Communication Engineering",
11+
"ee":"Electrical And Electronics Engineering",
12+
"ice":"Instrumentation And Control Engineering",
13+
"me":"Mechanical Engineering",
14+
"ipe":"Industrial And Production Enginnering",
15+
"math":"Mathematics",
16+
"phy":"Physics",
17+
"tt":"Textile Technology",
18+
"hum":"Humaniyies",
19+
"cy":"Chemistry"
20+
}
21+
const arr= window.location.pathname.split('/');
22+
arr.forEach((ele,i)=>{
23+
if(ele==="dept"){
24+
document.title= departments[arr[i+1]];
25+
}
26+
})
527
return (
628
<>
729
<AppRouter/>

src/components/Imagesroll.js

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
import React, { useEffect, useState } from 'react'
2-
import first from './Img/homepage.jpg'
3-
import sec from './Img/003.jpg'
4-
import third from './Img/02.jpeg'
5-
import four from './Img/002.jpg'
6-
import five from './Img/002.png'
7-
import six from './Img/03.jpeg'
8-
import { useLocation } from 'react-router-dom'
2+
import { useParams } from 'react-router-dom'
3+
import useFetch from '../hooks/useFetch'
94
function Test() {
10-
const image = [
11-
first,
12-
sec,
13-
third,
14-
four,
15-
five,
16-
six
17-
]
18-
const dept=useLocation().pathname.split('/')[2];
5+
const dept=useParams()?.dept;
6+
const image =useFetch(`/dept/${dept}/Images`)?.data?.Images;
197
const departments={
208
"it":"Information Technology",
219
"cse":"Computer Science and Engineering",
@@ -34,9 +22,10 @@ function Test() {
3422
"cy":"Chemistry"
3523
}
3624
const [value, setValue] = useState(0);
25+
3726
useEffect(() => {
3827
const interval = setInterval(() => {
39-
setValue(() => ((value === 5 ? 0 : value + 1)));
28+
setValue(() => ((value === (image? image.length-1:-1) ? 0 : value + 1)));
4029
}, 6000);
4130
return () => clearInterval(interval);
4231
}, [value])
@@ -45,7 +34,7 @@ function Test() {
4534
<div className="mt-0 relative">
4635
<div className="relative w-full overflow-hidden">
4736
<div className='relative bg-gradient-to-b from-accent to-transparent bg-cover bg-center w-full items-center transition-all justify-center'>
48-
<img src={image[value]} className='w-screen aspect-video sm:h-[450px] block align-middle' alt="" />
37+
<img src={image? image[value]?.link:""} className='w-screen aspect-video sm:h-[450px] block align-middle' alt="" />
4938
<div className='absolute bg-gradient-to-b from-accent to-transparent bg-cover bg-center flex flex-col w-full h-fit bottom-0 items-center justify-center '>
5039
<div className="flex text-2xl text-center sm:text-3xl m-2 mb-1 font-bold text-white">
5140
<span className='hidden md:flex'>Department of {departments[dept]}</span>
@@ -56,8 +45,8 @@ function Test() {
5645
</h2>
5746
</div>
5847
<div className='top-0 absolute w-full h-full flex items-center justify-between p-2'>
59-
<button className='w-5 h-5 active:translate-y-1' onClick={()=>setValue(() => ((value === 0 ? 5 : value - 1)))}><svg xmlns='http://www.w3.org/2000/svg' fill='#fff' viewBox='0 0 8 8'><path d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/></svg></button>
60-
<button className='w-5 h-5 active:translate-y-1' onClick={()=>setValue(() => ((value === 5 ? 0 : value + 1)))}><svg xmlns='http://www.w3.org/2000/svg' fill='#fff' viewBox='0 0 8 8'><path d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z' /></svg></button>
48+
<button className='w-5 h-5 active:translate-y-1' onClick={()=>setValue(() => ((value === 0 ? (image?image?.length-1:-1) : value - 1)))}><svg xmlns='http://www.w3.org/2000/svg' fill='#fff' viewBox='0 0 8 8'><path d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/></svg></button>
49+
<button className='w-5 h-5 active:translate-y-1' onClick={()=>setValue(() => ((value ===(image?image?.length-1:-1) ? 0 : value + 1)))}><svg xmlns='http://www.w3.org/2000/svg' fill='#fff' viewBox='0 0 8 8'><path d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z' /></svg></button>
6150
</div>
6251
</div>
6352
</div>

src/pages/Consultancy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useFetch from '../hooks/useFetch'
55
import {useParams } from 'react-router-dom'
66

77
function Consultancy() {
8-
const tablehead = ['Sr. No', "Name of Faculty (Chief Consultant)", "Client Organization", "Title of Consultancy of Project", "Amount Received (in Rupees)","Amount Received (in words)"]
8+
const tablehead = ['Sr No', "Name of Faculty (Chief Consultant)", "Client Organization", "Title of Consultancy of Project", "Amount Received (in Rupees)","Amount Received (in words)"]
99
// const data = [{
1010
// 1:'1',
1111
// 2:'Dr. J.K. Ratan',

src/pages/Projects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useFetch from '../hooks/useFetch'
55
import { useParams } from 'react-router-dom'
66

77
function Projects() {
8-
const tablehead = ['Sr. No', "Project Title", "Year of sanction", "Funding Agency", "Sanction Amount(Rs. In lac)"]
8+
const tablehead = ['Sr No', "Project Title", "Year of sanction", "Funding Agency", "Sanction Amount"]
99
const {data} = useFetch(`/dept/${useParams()?.dept}/Projects`)
1010
return (
1111
<div className='w-[98%] rounded-[9px] border border-[rgba(0,105,140,0.2)] p-4 mx-1 xl:mx-3 my-[60px] pt-[54px] place-items-center'>

0 commit comments

Comments
 (0)