Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dhairyagothi/StationGuide i…
Browse files Browse the repository at this point in the history
…nto new_branch_%
  • Loading branch information
haseebzaki-07 committed Oct 15, 2024
2 parents 6dcc667 + be9574b commit 4297280
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 51 deletions.
124 changes: 73 additions & 51 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
z-index: 99999999;

}

@media (max-width : 768px) {
.circle{
display: none;
}
}


.chatbot-container {
Expand Down Expand Up @@ -253,58 +259,74 @@ <h3>Saarthi</h3>
</script>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script>
// Coordinates for the cursor
const coords = { x: 0, y: 0 };
const circles = document.querySelectorAll(".circle");

// Colors for the circles
const colors = [
"#ffb56b", "#fdaf69", "#f89d63", "#f59761", "#ef865e", "#ec805d",
"#e36e5c", "#df685c", "#d5585c", "#d1525c", "#c5415d", "#c03b5d",
"#b22c5e", "#ac265e", "#9c155f", "#950f5f", "#830060", "#7c0060",
"#680060", "#60005f", "#48005f", "#3d005e"
];

// Assign colors and initial position to each circle
<script>
// Coordinates for the cursor
const coords = { x: 0, y: 0 };
const circles = document.querySelectorAll(".circle");

// Colors for the circles
const colors = [
"#6bb5ff", "#69b1fd", "#63a3f8", "#619bf5", "#5e89ef", "#5d82ec",
"#5c6ee3", "#5c68df", "#5c58d5", "#5c52d1", "#5d41c5", "#5d3bc0",
"#5e2cb2", "#5e26ac", "#5f159c", "#5f0f95", "#600083", "#60007c",
"#600068", "#5f0060", "#5f0048", "#5e003d"
];

// Assign colors, initial position, and size to each circle
circles.forEach(function (circle, index) {
circle.x = 0;
circle.y = 0;
circle.style.backgroundColor = colors[index % colors.length];
circle.style.position = 'absolute';
circle.style.borderRadius = '50%';
circle.style.width = `${5 + (index * 2)}px`; // Smaller circle sizes
circle.style.height = `${5 + (index * 2)}px`;
circle.style.opacity = `${(circles.length - index) / circles.length}`; // Fading effect
});

// Update the coordinates when the mouse moves
window.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
});

// Easing function to make the animation smoother
function lerp(start, end, t) {
return start * (1 - t) + end * t;
}

// Animation function to move the circles with a trailing effect
function animateCircles() {
let x = coords.x;
let y = coords.y;

circles.forEach(function (circle, index) {
circle.x = 0;
circle.y = 0;
circle.style.backgroundColor = colors[index % colors.length];
});

// Update the coordinates when the mouse moves
window.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
const nextCircle = circles[index + 1] || circles[0];

// Apply easing for smoother movements
circle.x = lerp(circle.x, x, 0.4); // Adjusted for quicker reaction
circle.y = lerp(circle.y, y, 0.4);

// Positioning the circle closer to the cursor
circle.style.left = circle.x - circle.offsetWidth / 2 + "px";
circle.style.top = circle.y - circle.offsetHeight / 2 + "px";

// Scale down each circle progressively to create depth
circle.style.transform = `scale(${(circles.length - index) / circles.length})`;

// Update position for the next circle, adjusted for closer proximity
x += (nextCircle.x - x) * 0.2; // Smaller multiplier for tighter following
y += (nextCircle.y - y) * 0.2;
});

// Animation function to move the circles
function animateCircles() {
let x = coords.x;
let y = coords.y;

circles.forEach(function (circle, index) {
// Update the position and scale of each circle
circle.style.left = x - 12 + "px";
circle.style.top = y - 12 + "px";
circle.style.scale = (circles.length - index) / circles.length;

circle.x = x;
circle.y = y;

// Get the next circle in the sequence
const nextCircle = circles[index + 1] || circles[0];
x += (nextCircle.x - x) * 0.3;
y += (nextCircle.y - y) * 0.3;
});

// Repeat the animation
requestAnimationFrame(animateCircles);
}

// Start the animation
animateCircles();
</script>

// Repeat the animation
requestAnimationFrame(animateCircles);
}

// Start the animation
animateCircles();
</script>


</body>
</html>
144 changes: 144 additions & 0 deletions frontend/src/Pages/stations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,152 @@ const RailwayStations = () => {
navigate("/"); // Navigates to the home page
};

// const stations = [
// { name: "Agartala Railway Station (AGTL)", state: "Tripura" },
// { name: "Agra Cantonment (AGC)", state: "Uttar Pradesh" },
// { name: "Ahmedabad Junction (ADI)", state: "Gujarat" },
// { name: "Ahmednagar (ANG)", state: "Maharashtra" },
// { name: "Aizawl (AZS)", state: "Mizoram" },
// { name: "Ajmer Junction (AII)", state: "Rajasthan" },
// { name: "Akola Junction (AK)", state: "Maharashtra" },
// { name: "Alappuzha (ALLP)", state: "Kerala" },
// { name: "Aligarh Junction (ALJN)", state: "Uttar Pradesh" },
// { name: "Allahabad Junction (Prayagraj)", state: "Uttar Pradesh" },
// { name: "Almora (ALM)", state: "Uttarakhand" },
// { name: "Ambala Cantonment (UMB)", state: "Haryana" },
// { name: "Ambarnath (ABH)", state: "Maharashtra" },
// { name: "Amritsar Junction (ASR)", state: "Punjab" },
// { name: "Anand Junction (ANND)", state: "Gujarat" },
// { name: "Anand Vihar Terminal (ANVT)", state: "Delhi" },
// { name: "Anantnag (ANT)", state: "Jammu and Kashmir" },
// { name: "Angul (ANGL)", state: "Odisha" },
// { name: "Ankleshwar Junction (AKV)", state: "Gujarat" },
// { name: "Arakkonam Junction (AK)", state: "Tamil Nadu" },
// { name: "Aurangabad (ABD)", state: "Maharastra" },
// { name: "Ayodhya (AY)", state: "Uttar Pradesh" },
// { name: "Bangalore City Railway Station (SBC)", state: "Karnataka" },
// { name: "Bareilly Junction (BE)", state: "Uttar Pradesh" },
// { name: "Bhopal Junction (BPL)", state: "Madhya Pradesh" },
// { name: "Bhubaneswar Railway Station (BBS)", state: "Odisha" },
// { name: "Bhilai Nagar (BIA)", state: "Chhattisgarh" },
// { name: "Bikaner Junction (BNK)", state: "Rajasthan" },
// { name: "Bilaspur Junction (BSP)", state: "Chhattisgarh" },
// { name: "Bokaro Steel City (BKSC)", state: "Jharkhand" },
// { name: "Bangalore Cantt (BNC)", state: "Karnataka" },
// { name: "Bangalore East (BNCE)", state: "Karnataka" },
// { name: "Bangalore South (BNCS)", state: "Karnataka" },
// { name: "Bangalore West (BNCW)", state: "Karnataka" },
// { name: "Balurghat Junction (BGQ)", state: "West Bengal" },
// { name: "Belgaum (BGM)", state: "Karnataka" },
// { name: "Bhuj Junction (BHJ)", state: "Gujarat" },
// { name: "Baroda (BRC)", state: "Gujarat" },
// { name: "Bikaner City (BNK)", state: "Rajasthan" },
// { name: "Bokaro Town (BKOT)", state: "Jharkhand" },
// { name: "Chandigarh Junction (CDG)", state: "Chandigarh" },
// { name: "Chennai Central (MAS)", state: "Tamil Nadu" },
// { name: "Chennai Egmore (EMU)", state: "Tamil Nadu" },
// { name: "Chennai Park (CPK)", state: "Tamil Nadu" },
// { name: "Chennai Port (CPT)", state: "Tamil Nadu" },
// { name: "Chennai Tambaram (TBM)", state: "Tamil Nadu" },
// { name: "Chitradurga (CDT)", state: "Karnataka" },
// { name: "Chittaranjan (CRJ)", state: "West Bengal" },
// { name: "Coimbatore Junction (CBE)", state: "Tamil Nadu" },
// { name: "Cochin Ernakulam Junction (ERS)", state: "Kerala" },
// { name: "Cooch Behar Junction (COB)", state: "West Bengal" },
// { name: "Coonoor (ONR)", state: "Tamil Nadu" },
// { name: "Dabhoi Junction (DB)", state: "Gujarat" },
// { name: "Darbhanga Junction (DBG)", state: "Bihar" },
// { name: "Dadar Western (DDR)", state: "Maharashtra" },
// { name: "Darjeeling (DJ)", state: "West Bengal" },
// { name: "Dharwad Junction (DWR)", state: "Karnataka" },
// { name: "Dharmavaram (DMM)", state: "Andhra Pradesh" },
// { name: "Delhi Junction (DLI)", state: "Delhi" },
// { name: "Delhi Cantt (DEC)", state: "Delhi" },
// { name: "Delhi Sarai Rohilla (DEE)", state: "Delhi" },
// { name: "Delhi Anand Vihar (ANVR)", state: "Delhi" },
// { name: "Delhi Rajdhani (NDLS)", state: "Delhi" },
// { name: "Dhanbad Junction (DHN)", state: "Jharkhand" },
// { name: "Dhanera Junction (DHR)", state: "Gujarat" },
// { name: "Dibrugarh Junction (DBR)", state: "Assam" },
// { name: "Dibrugarh Town (DBRT)", state: "Assam" },
// { name: "Dibrugarh Station(DBRG)", state: "Assam" },
// { name: "Dharamshala Junction ", state: "Himachal Pradesh" },
// { name: "Dharamshala Railway Station (DHM)", state: "Himachal Pradesh" },
// { name: "Ernakulam Junction (ERK)", state: "Kerala" },
// { name: "Gwalior Junction (GWL)", state: "Madhya Pradesh" },
// { name: "Gurgaon Junction (GGN)", state: "Haryana" },
// { name: "Guwahati Junction (GHY)", state: "Assam" },
// { name: "Gaya Junction (GAYA)", state: "Bihar" },
// { name: "Howrah Junction (HWH)", state: "West Bengal" },
// { name: "Hubli Junction (UBL)", state: "Karnataka" },
// { name: "Hyderabad Deccan (HYB)", state: "Telangana" },
// { name: "Hazaribagh Junction (HZB)", state: "Jharkhand" },
// { name: "Hazart Nizamuddin (NZM)", state: "Delhi" },
// { name: "Indore Junction (INDB)", state: "Madhya Pradesh" },
// { name: "Itarsi Junction (ET)", state: "Madhya Pradesh" },
// { name: "Jabalpur Junction (JBP)", state: "Madhya Pradesh" },
// { name: "Jaipur Junction (JP)", state: "Rajasthan" },
// { name: "Jalandhar City (JUC)", state: "Punjab" },
// { name: "Jammu Tawi (JAT)", state: "Jammu and Kashmir" },
// { name: "Jodhpur Junction (JOD)", state: "Rajasthan" },
// { name: "Kanpur Central (CNB)", state: "Uttar Pradesh" },
// { name: "Kalyan Junction (KYN)", state: "Maharashtra" },
// { name: "Kolkata Chitpur (Howrah)", state: "West Bengal" },
// { name: "Kharagpur Junction (KGP)", state: "West Bengal" },
// { name: "Kota Junction (KOTA)", state: "Rajasthan" },
// { name: "Lucknow Charbagh (LKO)", state: "Uttar Pradesh" },
// { name: "Ludhiana Junction (LDH)", state: "Punjab" },
// { name: "Madurai Junction (MDU)", state: "Tamil Nadu" },
// { name: "Mangalore Junction (MAJN)", state: "Karnataka" },
// { name: "Mumbai Central (MMCT)", state: "Maharashtra" },
// {
// name: "Mumbai CST (Chhatrapati Shivaji Maharaj Terminus)",
// state: "Maharashtra",
// },
// { name: "Mysore Junction (MYS)", state: "Karnataka" },
// { name: "Mathura Junction (MTJ)", state: "Uttar Pradesh" },
// { name: "Nagpur Junction (NGP)", state: "Maharashtra" },
// { name: "Nanded Junction (NED)", state: "Maharashtra" },
// { name: "New Delhi Railway Station (NDLS)", state: "Delhi" },
// { name: "Patna Junction (PNBE)", state: "Bihar" },
// { name: "Pune Junction (PUNE)", state: "Maharashtra" },
// { name: "Patiala Junction (PTA)", state: "Punjab" },
// { name: "Panvel Junction (PNVL)", state: "Maharashtra" },
// { name: "Panki Railway Station (PNK)", state: "Uttar Pradesh" },
// { name: "Panipat Junction (PNP)", state: "Haryana" },
// { name: "Quilon Junction (QLN)", state: "Kerala" },
// { name: "Ranchi Junction (RNC)", state: "Jharkhand" },
// { name: "Rajkot Junction (RJT)", state: "Gujarat" },
// { name: "Rourkela Junction (ROU)", state: "Odisha" },
// { name: "Rohtak Junction (ROK)", state: "Haryana" },
// { name: "Rewari Junction (RE)", state: "Haryana" },
// { name: "Secunderabad Junction (SC)", state: "Telangana" },
// { name: "Siliguri Junction (SGUJ)", state: "West Bengal" },
// { name: "Sonebhadra (SBP)", state: "Uttar Pradesh" },
// { name: "Surat Junction (ST)", state: "Gujarat" },
// { name: "Thiruvananthapuram Central (TVC)", state: "Kerala" },
// { name: "Trivandrum Central (TVC)", state: "Kerala" },
// { name: "Tirupati Railway Station (TPTY)", state: "Andhra Pradesh" },
// { name: "Thanjavur Junction (TJ)", state: "Tamil Nadu" },
// { name: "Udaipur City (UDZ)", state: "Rajasthan" },
// { name: "Ujjain Junction (UJN)", state: "Madhya Pradesh" },
// { name: "Vadodara Junction (BRC)", state: "Gujarat" },
// { name: "Varanasi Junction (VNS)", state: "Uttar Pradesh" },
// { name: "Vellore Cantt (VLCY)", state: "Tamil Nadu" },
// { name: "Vijayawada Junction (BZA)", state: "Andhra Pradesh" },
// { name: "Visakhapatnam Junction (VSKP)", state: "Andhra Pradesh" },
// { name: "West Bengal Howrah (HWH)", state: "West Bengal" },
// { name: "Wayanad (WY)", state: "Kerala" },
// { name: "Warangal (WL)", state: "Telangana" },
// { name: "Yeshvantpur Junction (YPR)", state: "Karnataka" },
// { name: "Yelahanka Junction (YNK)", state: "Karnataka" },
// { name: "Ziyadpur Junction (ZYP)", state: "Uttar Pradesh" }, // Replace "Unknown" with the correct state if known
// // Add more stations as needed
// ];

const [stations, setStations] = useState(allStations);


const zones = [
["All", "All"],
["ECOR", "EAST COAST RAILWAY"],
Expand Down

0 comments on commit 4297280

Please sign in to comment.