diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 18b9140..5d3b3b3 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ # ─── DATABASE CONNECTION CONFIGURATION ─── spring.datasource.url=jdbc:postgresql://localhost:5432/rit_freshers_hub?sslmode=disable spring.datasource.username=postgres -spring.datasource.password=${DB_PASSWORD:jouganxd1011} +spring.datasource.password=${DB_PASSWORD:Amudiesh22@.} # ─── JPA / HIBERNATE SETTINGS ─── spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect diff --git a/public/campus-map.jpg b/public/campus-map.jpg deleted file mode 100644 index b0339af..0000000 Binary files a/public/campus-map.jpg and /dev/null differ diff --git a/public/map.png b/public/map.png new file mode 100644 index 0000000..3450135 Binary files /dev/null and b/public/map.png differ diff --git a/public/video/RIT Video.mp4 b/public/video/RIT Video.mp4 deleted file mode 100644 index fdd0fde..0000000 Binary files a/public/video/RIT Video.mp4 and /dev/null differ diff --git a/public/video/RIT Video.webm b/public/video/RIT Video.webm new file mode 100644 index 0000000..7a05640 Binary files /dev/null and b/public/video/RIT Video.webm differ diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index a8cf7c5..4ea9673 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -19,6 +19,24 @@ export default function Navbar() { setIsMobileOpen(false); }, [location.pathname]); + const checkIsActive = (linkPath: string) => { + const [pathName, searchString] = linkPath.split('?'); + if (location.pathname !== pathName) return false; + + if (pathName === '/notes') { + const params = new URLSearchParams(location.search); + const hasToolkit = params.has('toolkit') || params.get('section') === 'toolkit'; + + if (searchString) { + return hasToolkit; + } else { + return !hasToolkit; + } + } + + return true; + }; + return ( <> {NAV_LINKS.map((link) => { - const isActive = location.pathname === link.path; + const isActive = checkIsActive(link.path); return (
{NAV_LINKS.map((link) => { - const isActive = location.pathname === link.path; + const isActive = checkIsActive(link.path); return ( {/* Header */} -
+
diff --git a/src/pages/Campus/Campus.tsx b/src/pages/Campus/Campus.tsx index 8ee2ebe..ea2b4b8 100644 --- a/src/pages/Campus/Campus.tsx +++ b/src/pages/Campus/Campus.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useRef } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ChevronRight, MapPin, ZoomIn, ZoomOut, Maximize2, Minimize2, @@ -32,25 +32,25 @@ const BLUEPRINT_LEGEND = [ ]; const LOCATION_SPOTS: LocationSpot[] = [ - { name: 'Girls Hostel', x: 8.5, y: 12.0, category: 'Hostel / Mess', desc: 'Residential Quarter for Women', area: 'Top Left' }, - { name: 'Playground', x: 32.0, y: 24.0, category: 'Amenity', desc: 'Main Sports & Athletic Field', area: 'Top Left' }, - { name: 'Canteen', x: 64.0, y: 14.0, category: 'Amenity', desc: 'Food Court & Refreshments', area: 'North Center' }, - { name: 'Statue', x: 63.0, y: 25.5, category: 'Amenity', desc: 'Landmark Monument', area: 'North Center' }, - { name: 'Boys Mess', x: 87.0, y: 9.5, category: 'Amenity', desc: 'Ground Floor Dining', area: 'Top Right' }, - { name: 'Staff Mess', x: 87.0, y: 18.5, category: 'Amenity', desc: 'First Floor Dining', area: 'Top Right' }, - { name: 'C Block', x: 87.0, y: 42.0, category: 'C Block', desc: 'Labs, Classrooms, Auditorium & Staff Rooms', area: 'East Block' }, - { name: 'Steve Jobs Block', x: 8.5, y: 39.0, category: 'Admin / Facility', desc: 'Auditorium, Labs & Staff Rooms', area: 'West Wing' }, - { name: 'Girls Mess', x: 8.5, y: 53.0, category: 'Amenity', desc: 'Dedicated Dining Hall for Women', area: 'West Wing' }, - { name: 'EPL Lab', x: 8.5, y: 67.0, category: 'Lab / Academic', desc: 'Engineering Practices Laboratory', area: 'South West' }, - { name: 'B Block', x: 33.0, y: 51.0, category: 'B Block', desc: 'Labs, Classrooms & Faculty Rooms', area: 'Central West' }, - { name: 'Hut', x: 63.0, y: 41.0, category: 'Amenity', desc: 'Student Discussion & Rest Area', area: 'Central Green' }, - { name: 'A Block', x: 70.0, y: 65.0, category: 'A Block', desc: 'Labs, Classrooms, Faculty Rooms, Principal Room & Exam Cell', area: 'Central East' }, - { name: 'RSB Block', x: 24.0, y: 80.0, category: 'Amenity', desc: 'Library, Auditorium & Accounts Room', area: 'South West' }, - { name: 'Side Parking', x: 6.5, y: 83.0, category: 'Parking Area', desc: 'Visitor & Staff Parking Zone', area: 'South West' }, - { name: 'Arcade', x: 43.5, y: 72.0, category: 'Amenity', desc: 'Student Hub & Stores', area: 'South Central' }, - { name: 'Security Booth', x: 45.8, y: 88.5, category: 'Amenity', desc: 'Main Gate Security Checkpoint', area: 'South Entrance' }, - { name: 'Parking Area', x: 73.5, y: 85.5, category: 'Parking Area', desc: 'Two-Wheeler & Four-Wheeler Parking', area: 'South East' }, - { name: 'Main Entrance', x: 50.5, y: 95.5, category: 'Amenity', desc: 'Primary Campus Security Gate', area: 'South Entrance' }, + { name: 'Girls Hostel', x: 8.2, y: 12.0, category: 'Hostel / Mess', desc: 'Residential Quarter for Women', area: 'Top Left' }, + { name: 'Playground', x: 32.5, y: 19.5, category: 'Amenity', desc: 'Main Sports & Athletic Field', area: 'Top Left' }, + { name: 'Canteen', x: 63.5, y: 13.5, category: 'Amenity', desc: 'Food Court & Refreshments', area: 'North Center' }, + { name: 'Statue', x: 61.0, y: 26.0, category: 'Amenity', desc: 'Landmark Monument', area: 'North Center' }, + { name: 'Boys Mess', x: 87.8, y: 10.5, category: 'Amenity', desc: 'Ground Floor Dining', area: 'Top Right' }, + { name: 'Staff Mess', x: 87.8, y: 22.0, category: 'Amenity', desc: 'First Floor Dining', area: 'Top Right' }, + { name: 'C Block', x: 87.8, y: 41.0, category: 'C Block', desc: 'Labs, Classrooms, Auditorium & Staff Rooms', area: 'East Block' }, + { name: 'Steve Jobs Block', x: 8.1, y: 38.5, category: 'Admin / Facility', desc: 'Auditorium, Labs & Staff Rooms', area: 'West Wing' }, + { name: 'Girls Mess', x: 8.1, y: 53.0, category: 'Amenity', desc: 'Dedicated Dining Hall for Women', area: 'West Wing' }, + { name: 'EPL Lab', x: 8.1, y: 65.5, category: 'Lab / Academic', desc: 'Engineering Practices Laboratory', area: 'South West' }, + { name: 'B Block', x: 32.5, y: 55.0, category: 'B Block', desc: 'Labs, Classrooms & Faculty Rooms', area: 'Central West' }, + { name: 'Hut', x: 62.7, y: 42.5, category: 'Amenity', desc: 'Student Discussion & Rest Area', area: 'Central Green' }, + { name: 'A Block', x: 70.3, y: 67.0, category: 'A Block', desc: 'Labs, Classrooms, Faculty Rooms, Principal Room & Exam Cell', area: 'Central East' }, + { name: 'RSB Block', x: 24.0, y: 81.5, category: 'Amenity', desc: 'Library, Auditorium & Accounts Room', area: 'South West' }, + { name: 'Side Parking', x: 5.5, y: 85.5, category: 'Parking Area', desc: 'Visitor & Staff Parking Zone', area: 'South West' }, + { name: 'Arcade', x: 41.5, y: 72.8, category: 'Amenity', desc: 'Student Hub & Stores', area: 'South Central' }, + { name: 'Security Booth', x: 45.9, y: 88.5, category: 'Amenity', desc: 'Main Gate Security Checkpoint', area: 'South Entrance' }, + { name: 'Parking Area', x: 73.0, y: 86.0, category: 'Parking Area', desc: 'Two-Wheeler & Four-Wheeler Parking', area: 'South East' }, + { name: 'Main Entrance', x: 51.8, y: 92.5, category: 'Amenity', desc: 'Primary Campus Security Gate', area: 'South Entrance' }, ]; const CATEGORY_MAP_SPOTS: Record = { @@ -64,6 +64,14 @@ const CATEGORY_MAP_SPOTS: Record = { }; export default function Campus() { + const mapRef = useRef(null); + + const scrollToMap = () => { + setTimeout(() => { + mapRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }, 100); + }; + // Interactive Map State const [zoomLevel, setZoomLevel] = useState(1); const [isFullscreen, setIsFullscreen] = useState(false); @@ -71,7 +79,7 @@ export default function Campus() { const [activeCategory, setActiveCategory] = useState(null); const [selectedFacility, setSelectedFacility] = useState(null); - const currentMapSrc = '/campus-map.jpg'; + const currentMapSrc = '/map.png'; const handleZoomIn = () => setZoomLevel((prev) => Math.min(prev + 0.25, 2.5)); const handleZoomOut = () => setZoomLevel((prev) => Math.max(prev - 0.25, 0.75)); @@ -80,7 +88,7 @@ export default function Campus() { const handleDownload = () => { const link = document.createElement('a'); link.href = currentMapSrc; - link.download = 'RIT_Campus_Blueprint.jpg'; + link.download = 'RIT_Campus_Blueprint.png'; document.body.appendChild(link); link.click(); document.body.removeChild(link); @@ -92,7 +100,7 @@ export default function Campus() { } else { setActiveCategory(catId); setSelectedFacility(null); - setZoomLevel(1.1); + scrollToMap(); } }; @@ -155,7 +163,7 @@ export default function Campus() {
{/* Map Viewer Header Bar */} -
+
@@ -223,7 +231,7 @@ export default function Campus() { )} -
{spot.name}
+
{spot.name}
); @@ -289,7 +297,7 @@ export default function Campus() { {BLUEPRINT_LEGEND.map((item) => { const isActive = activeLegend === item.id; return ( - @@ -315,7 +323,7 @@ export default function Campus() { const isSelected = selectedFacility?.name === facility.name; const isHighlighted = highlightedSpotNames.has(facility.name); return ( - { if (isSelected) setSelectedFacility(null); else { setSelectedFacility(facility); setActiveCategory(null); } }} className={`text-left p-4 rounded-2xl border transition-all cursor-pointer ${isSelected ? 'border-[#F97316] bg-orange-500 text-white shadow-lg ring-2 ring-orange-400/40' : isHighlighted ? 'border-[#F97316] bg-orange-50/90 shadow-md' : 'border-[#E5E7EB] bg-[#F8FAFC] hover:bg-white hover:border-orange-200 hover:shadow-xs'}`}> + { if (isSelected) setSelectedFacility(null); else { setSelectedFacility(facility); setActiveCategory(null); scrollToMap(); } }} className={`text-left p-4 rounded-2xl border transition-all cursor-pointer ${isSelected ? 'border-[#F97316] bg-orange-500 text-white shadow-lg ring-2 ring-orange-400/40' : isHighlighted ? 'border-[#F97316] bg-orange-50/90 shadow-md' : 'border-[#E5E7EB] bg-[#F8FAFC] hover:bg-white hover:border-orange-200 hover:shadow-xs'}`}>
{facility.name} {facility.area} @@ -348,7 +356,7 @@ export default function Campus() {
setSelectedFacility(spot)}>
-
{spot.name}
+
{spot.name}
); diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index 9c747c2..806146b 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -34,6 +34,7 @@ export default function Home() { willChange: 'transform' }} > + {/* Dark Overlay (40-50%) */} diff --git a/src/pages/LeetcodeLeaderboard/LeetcodeLeaderboard.tsx b/src/pages/LeetcodeLeaderboard/LeetcodeLeaderboard.tsx index a79e438..4765f0a 100644 --- a/src/pages/LeetcodeLeaderboard/LeetcodeLeaderboard.tsx +++ b/src/pages/LeetcodeLeaderboard/LeetcodeLeaderboard.tsx @@ -125,7 +125,7 @@ export default function LeetcodeLeaderboard() { const topProfile = profiles.length > 0 ? profiles[0] : null; return ( -
+
{/* Toast Notification */} {toastMessage && ( @@ -133,7 +133,7 @@ export default function LeetcodeLeaderboard() { initial={{ opacity: 0, y: -20 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: -20 }} - className="fixed top-6 right-6 z-50 px-5 py-3 rounded-xl bg-slate-800/90 border border-slate-700 backdrop-blur-md text-white font-medium shadow-2xl flex items-center gap-2" + className="fixed top-6 right-6 z-50 px-5 py-3 rounded-xl bg-white border border-[#E5E7EB] backdrop-blur-md text-[#1E293B] font-semibold shadow-2xl flex items-center gap-2" > {toastMessage} @@ -142,20 +142,20 @@ export default function LeetcodeLeaderboard() {
{/* Banner Header */} -
-
-
+
+
+
-
+
RIT LeetCode Arena
-

- Campus LeetCode Leaderboard +

+ Campus LeetCode Leaderboard

-

+

Track top problem solvers across departments. Automatically updated every 24 hours with rate-limited, spaced background sync.

@@ -163,7 +163,7 @@ export default function LeetcodeLeaderboard() {
{/* Quick Metrics Bar */} -
-
- - #1 Top Solver +
+
+ + #1 Top Solver -

+

{topProfile ? `${topProfile.studentName}` : 'N/A'}

-

+

{topProfile ? `${topProfile.totalSolved} Problems Solved` : ''}

-
- - Total Campus Solved +
+ + Total Campus Solved -

+

{totalCampusSolved.toLocaleString()}

-

Problems across all coders

+

Problems across all coders

-
- - Active Coders +
+ + Active Coders -

+

{profiles.length}

-

Registered RIT coders

+

Registered RIT coders

-
- - Sync Frequency +
+ + Sync Frequency -

+

Every 24 Hours

-

3s spaced rate-limiting

+

3s spaced rate-limiting

{/* Search & Filter Controls */} -
+
setSearchQuery(e.target.value)} - className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-slate-950/60 border border-slate-800 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-amber-500/50 transition-colors" + className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-[#F8FAFC] border border-[#E2E8F0] text-sm text-[#1E293B] placeholder-slate-400 focus:outline-none focus:border-[#F97316] transition-colors" />
@@ -244,10 +244,10 @@ export default function LeetcodeLeaderboard() { setSelectedYear(e.target.value)} - className="bg-slate-950/60 border border-slate-800 rounded-xl px-3 py-2 text-xs font-medium text-slate-300 focus:outline-none focus:border-amber-500/50" + className="bg-[#F8FAFC] border border-[#E2E8F0] rounded-xl px-3 py-2 text-xs font-medium text-slate-700 focus:outline-none focus:border-[#F97316]" > {YEARS.map((y) => ( - ))} @@ -269,20 +269,20 @@ export default function LeetcodeLeaderboard() {
{/* Leaderboard Table */} -
+
{loading ? ( -
- +
+

Fetching LeetCode rankings...

) : filteredProfiles.length === 0 ? ( -
- -

No coders found

+
+ +

No coders found

Be the first to register your LeetCode handle!

@@ -290,7 +290,7 @@ export default function LeetcodeLeaderboard() { ) : ( <> {/* Mobile Card View (Small Screens) */} -
+
{filteredProfiles.map((p, index) => { const rank = index + 1; const total = p.totalSolved || 1; @@ -304,7 +304,7 @@ export default function LeetcodeLeaderboard() { initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: index * 0.03 }} - className="p-4 space-y-3 bg-slate-900/60" + className="p-4 space-y-3 bg-white" >
@@ -315,36 +315,36 @@ export default function LeetcodeLeaderboard() { ) : rank === 3 ? ( 🥉 ) : ( - + #{rank} )}
-

{p.studentName}

+

{p.studentName}

@{p.leetcodeUsername}

-

{p.totalSolved}

-

Solved

+

{p.totalSolved}

+

Solved

-
+
- + {p.department} - {p.year} + {p.year}
LeetCode Profile @@ -352,12 +352,12 @@ export default function LeetcodeLeaderboard() { {/* Progress Bar */}
-
- Easy: {p.easySolved} - Med: {p.mediumSolved} - Hard: {p.hardSolved} +
+ Easy: {p.easySolved} + Med: {p.mediumSolved} + Hard: {p.hardSolved}
-
+
@@ -370,9 +370,9 @@ export default function LeetcodeLeaderboard() { {/* Desktop Table View (Medium Screens & Up) */}
- +
- + @@ -382,7 +382,7 @@ export default function LeetcodeLeaderboard() { - + {filteredProfiles.map((p, index) => { const rank = index + 1; const total = p.totalSolved || 1; @@ -396,31 +396,31 @@ export default function LeetcodeLeaderboard() { initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: index * 0.03 }} - className="hover:bg-slate-800/40 transition-colors group" + className="hover:bg-[#FFF7ED]/50 transition-colors group" > {/* Rank */} {/* Student Info */} {/* Dept & Year */} - {/* Total Solved */} @@ -447,12 +447,12 @@ export default function LeetcodeLeaderboard() { {/* Problem Breakdown Bars */} @@ -489,7 +489,7 @@ export default function LeetcodeLeaderboard() { href={`https://leetcode.com/u/${p.leetcodeUsername}`} target="_blank" rel="noopener noreferrer" - className="inline-flex items-center justify-center w-8 h-8 rounded-lg bg-slate-800 hover:bg-amber-500/20 text-slate-400 hover:text-amber-400 border border-slate-700/60 transition-colors" + className="inline-flex items-center justify-center w-8 h-8 rounded-lg bg-[#F8FAFC] hover:bg-[#FFF7ED] text-slate-500 hover:text-[#F97316] border border-[#E2E8F0] transition-colors" title="View on LeetCode" > @@ -509,33 +509,33 @@ export default function LeetcodeLeaderboard() { {/* Registration Modal */} {showModal && ( -
+
-
+
-

Register LeetCode Handle

+

Register LeetCode Handle

Join the RIT campus coding rankings

-
-
-
Rank Student Dept & YearProfile
{rank === 1 ? ( -
+
🥇
) : rank === 2 ? ( -
+
🥈
) : rank === 3 ? ( -
+
🥉
) : ( - #{rank} + #{rank} )}
-

+

{p.studentName}

@@ -430,16 +430,16 @@ export default function LeetcodeLeaderboard() {

- + + {p.department} - {p.year} + {p.year} - + {p.totalSolved}
-
- Easy: {p.easySolved} - Med: {p.mediumSolved} - Hard: {p.hardSolved} +
+ Easy: {p.easySolved} + Med: {p.mediumSolved} + Hard: {p.hardSolved}
-
+
{p.ranking > 0 ? ( - + #{p.ranking.toLocaleString()} ) : ( - - + - )}