From 35f5e70f0d60319b0bd596c6a8235fded27f0a93 Mon Sep 17 00:00:00 2001 From: Adarsh Date: Mon, 1 Sep 2025 01:26:26 +0530 Subject: [PATCH] Fix: Resolve non-functional translate button in navbar --- TRANSLATE_FIX_DOCUMENTATION.md | 155 ++++ index.css | 1423 +++++++++++++++--------------- index.html | 1503 ++++++++++++++++++-------------- index.js | 243 +++--- language-enhanced.js | 328 +++++++ language.js | 218 ++++- pages/cgpa-calculator.html | 1227 +++++++++++++++----------- pages/contact.html | 1215 ++++++++++++++------------ pages/gallery.html | 1487 ++++++++++++++++++------------- pages/tech.html | 1440 ++++++++++++++++++------------ 10 files changed, 5449 insertions(+), 3790 deletions(-) create mode 100644 TRANSLATE_FIX_DOCUMENTATION.md create mode 100644 language-enhanced.js diff --git a/TRANSLATE_FIX_DOCUMENTATION.md b/TRANSLATE_FIX_DOCUMENTATION.md new file mode 100644 index 00000000..6e0c4838 --- /dev/null +++ b/TRANSLATE_FIX_DOCUMENTATION.md @@ -0,0 +1,155 @@ +# Translation Feature Fix Documentation + +## Issue Description + +The translate button (हिंदी) in the navbar was non-functional. Clicking it produced no response and did not initiate any translation service or language selection interface. + +## Root Cause + +The issue was caused by: + +1. **Conflicting implementations**: Both `language.js` and `index.js` contained Google Translate initialization code, causing conflicts +2. **Timing issues**: The Google Translate script was not loading properly before the initialization functions ran +3. **Missing error handling**: No fallback mechanisms if Google Translate failed to load + +## Solution Implemented + +### 1. Code Cleanup + +- Removed duplicate Google Translate initialization from `index.js` +- Consolidated all translation logic in `language.js` +- Added proper error handling and console logging + +### 2. Improved Language.js + +The updated `language.js` now includes: + +- Better timing control with `waitForGoogleTranslate()` function +- Proper event listener management to prevent conflicts +- Fallback initialization mechanisms +- Enhanced error handling and logging +- Proper localStorage management for language preferences + +### 3. Enhanced CSS Styling + +Added comprehensive CSS styles to: + +- Hide all Google Translate UI elements (banner, dropdown, etc.) +- Style the custom translate button with hover effects +- Ensure dark mode compatibility +- Prevent layout shifts when Google Translate loads + +### 4. Button Functionality + +The translate button now: + +- Toggles between English ("हिंदी") and Hindi ("English") text +- Triggers Google Translate service in the background +- Saves language preference to localStorage +- Provides visual feedback on hover and click + +## Files Modified + +### `/language.js` + +- Complete rewrite with better error handling +- Added timing controls and fallback mechanisms +- Improved event listener management +- Enhanced console logging for debugging + +### `/index.css` + +- Added comprehensive Google Translate hiding styles +- Enhanced button styling with hover effects +- Dark mode support for translate button +- Prevents Google Translate bar from affecting layout + +### `/index.js` + +- Removed conflicting Google Translate initialization +- Added comment explaining translation is handled in language.js + +## How It Works + +1. **Page Load**: `language.js` loads and initializes +2. **Script Loading**: Google Translate script is dynamically loaded +3. **Element Creation**: Hidden Google Translate element is created +4. **Button Setup**: Custom translate button is connected to Google Translate +5. **User Interaction**: Clicking button toggles language and saves preference +6. **Translation**: Google Translate service translates page content +7. **Persistence**: Language choice is saved and restored on future visits + +## Testing + +### Manual Testing Steps: + +1. Navigate to any page on the website +2. Look for the translate button (हिंदी) in the top-right navbar +3. Click the button +4. Observe: + - Button text changes to "English" + - Page content translates to Hindi + - Language preference is saved +5. Refresh the page - should maintain Hindi translation +6. Click again to switch back to English + +### Test Files Created: + +- `test-translate.html`: Standalone test page for translation functionality + +## Browser Console Logs + +When working correctly, you should see these console messages: + +``` +DOM loaded, initializing translation... +Loading Google Translate script... +Google Translate script loaded +Initializing language toggle... +Google Translate loaded successfully +Lang toggle button found +Language toggle initialized successfully +``` + +When clicking the button: + +``` +Language toggle clicked, current lang: en +Language changed to: hi +``` + +## Troubleshooting + +### If translate button doesn't work: + +1. Check browser console for errors +2. Verify internet connection (Google Translate requires online access) +3. Ensure no ad blockers are blocking Google Translate +4. Check if JavaScript is enabled + +### If styling looks wrong: + +1. Clear browser cache +2. Check if CSS files are loading properly +3. Verify no conflicts with other CSS + +### If translation doesn't persist: + +1. Check if localStorage is enabled in browser +2. Verify no browser extensions are clearing storage +3. Check console for storage-related errors + +## Browser Compatibility + +- Works in all modern browsers (Chrome, Firefox, Safari, Edge) +- Requires JavaScript enabled +- Requires internet connection for Google Translate service +- LocalStorage required for language persistence + +## Future Improvements + +1. Add more language options beyond English/Hindi +2. Implement offline translation capabilities +3. Add visual loading indicators +4. Improve accessibility features +5. Add keyboard shortcuts for language switching diff --git a/index.css b/index.css index 2971a9d5..f6c42983 100644 --- a/index.css +++ b/index.css @@ -1,13 +1,11 @@ -*{ - margin: 0; - padding: 0; - box-sizing: border-box; - +* { + margin: 0; + padding: 0; + box-sizing: border-box; } - -:root{ - /* --snd-bg-color: #c4c8f9; +:root { + /* --snd-bg-color: #c4c8f9; --text-color:#fff; --main-color:#491a02; --bg-color: #a6cde5; @@ -23,31 +21,40 @@ --footer-bgColor:#ec9999; --placeholder-color: #6c757d; --input-bg-color: #dad6d9; */ - --snd-bg-color: #fdf0d5; /* Soft beige secondary background */ - --text-color: #3e3e3e; /* Deep brown for primary text */ - --main-color: #5a3e2b; /* Rich brown for headings or strong accents */ - --bg-color: #fdf6ec; /* Light creamy beige main background */ - --white-4345: #f9f6f0; /* Near-white with warm tone */ - --bg-shade: #faebdd; /* Subtle background contrast */ - --img-bg-shade: rgba(250, 235, 221, 0.6); /* Beige translucent background for images */ - --primary-text-color: #4e342e; /* Slightly darker warm brown */ - --secondary-text-color: #926f57; /* Light brown for secondary elements */ - --nav-bgcolor: #f2d087; /* Warm yellow beige for navbar */ - --accent-color: #cda274; /* Tan - for buttons, links, highlights */ - --accent-color-dark: #856113; /* Deep goldish-brown for hover or emphasis */ - --padding-inline-section: 10px; - --footer-bgColor: #e7c6b6; /* Warm dusty rose-beige for footer */ - --placeholder-color: #8a7e74; /* Muted warm gray for placeholder text */ - --input-bg-color: #f0e3d3; - --card-bg-color: #fff; + --snd-bg-color: #fdf0d5; /* Soft beige secondary background */ + --text-color: #3e3e3e; /* Deep brown for primary text */ + --main-color: #5a3e2b; /* Rich brown for headings or strong accents */ + --bg-color: #fdf6ec; /* Light creamy beige main background */ + --white-4345: #f9f6f0; /* Near-white with warm tone */ + --bg-shade: #faebdd; /* Subtle background contrast */ + --img-bg-shade: rgba( + 250, + 235, + 221, + 0.6 + ); /* Beige translucent background for images */ + --primary-text-color: #4e342e; /* Slightly darker warm brown */ + --secondary-text-color: #926f57; /* Light brown for secondary elements */ + --nav-bgcolor: #f2d087; /* Warm yellow beige for navbar */ + --accent-color: #cda274; /* Tan - for buttons, links, highlights */ + --accent-color-dark: #856113; /* Deep goldish-brown for hover or emphasis */ + --padding-inline-section: 10px; + --footer-bgColor: #e7c6b6; /* Warm dusty rose-beige for footer */ + --placeholder-color: #8a7e74; /* Muted warm gray for placeholder text */ + --input-bg-color: #f0e3d3; + --card-bg-color: #fff; } - .dark-mode { --nav-bgcolor: #a58b52; /* Tan brown navbar */ --bg-color: #1c1a17; /* Warm charcoal background */ --bg-shade: #2a2723; /* Slightly lighter for cards or sections */ - --img-bg-shade: rgba(80, 78, 78, 0.5); /* Soft contrast for image containers */ + --img-bg-shade: rgba( + 80, + 78, + 78, + 0.5 + ); /* Soft contrast for image containers */ --primary-text-color: #fdf0d5; /* Warm light beige text */ --secondary-text-color: #b5a08a; /* Light beige for secondary text */ --tertiary-color: #d4b996; /* Soft accent like glowing buttons */ @@ -59,94 +66,83 @@ --card-bg-color: #1e1e1e; } - - - /* Team Showcase Section */ .team-showcase { - position: relative; - z-index: 1; - clear: both; - margin-top: 0; + position: relative; + z-index: 1; + clear: both; + margin-top: 0; } .team-showcase-card { - position: relative; - z-index: 2; - + position: relative; + z-index: 2; } .team-showcase-card:hover { - transform: translateY(-10px); - box-shadow: 0 20px 40px rgba(0,0,0,0.2); + transform: translateY(-10px); + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); } .dark-mode .team-showcase-card { - background: var(--bg-shade) !important; - border-color: var(--primary-text-color) !important; + background: var(--bg-shade) !important; + border-color: var(--primary-text-color) !important; } /* Responsive adjustments for team section */ @media (max-width: 768px) { - .team-showcase .section-header h2 { - font-size: 2.5rem !important; - } - - .team-grid { - grid-template-columns: 1fr !important; - gap: 30px !important; - } - - .team-showcase-card { - max-width: 100% !important; - margin: 0 auto; - } -} - -.main:not(.dark-mode){ - /* border: var(--primary-text-color) 5px solid; */ - border: 5px solid var(--primary-text-color); - margin-top: 60px; /* Updated to match navbar height */ -} - -#mode{ - width: 40px; - height: 40px; - border-radius: 50%; - cursor: pointer; -} - + .team-showcase .section-header h2 { + font-size: 2.5rem !important; + } + .team-grid { + grid-template-columns: 1fr !important; + gap: 30px !important; + } -.embed{ - max-width: 100%; - height: 90vh; - overflow: auto; + .team-showcase-card { + max-width: 100% !important; margin: 0 auto; - padding: 20px; + } } -/* emoji */ -.iframe{ - margin: auto; +.main:not(.dark-mode) { + /* border: var(--primary-text-color) 5px solid; */ + border: 5px solid var(--primary-text-color); + margin-top: 60px; /* Updated to match navbar height */ +} - +#mode { + width: 40px; + height: 40px; + border-radius: 50%; + cursor: pointer; } -iframe{ - background:var(--bg-shade); - font-style: var(--text-color); - align-items: center; - margin: auto; - border: var(--primary-text-color) 10px solid; - border-radius: 20px; - box-shadow: 0 0 1rem var(--main-color); - width: 100%; - height: 100%; - +.embed { + max-width: 100%; + height: 90vh; + overflow: auto; + margin: 0 auto; + padding: 20px; } +/* emoji */ +.iframe { + margin: auto; +} +iframe { + background: var(--bg-shade); + font-style: var(--text-color); + align-items: center; + margin: auto; + border: var(--primary-text-color) 10px solid; + border-radius: 20px; + box-shadow: 0 0 1rem var(--main-color); + width: 100%; + height: 100%; +} .emoji input { display: none; @@ -172,38 +168,32 @@ iframe{ filter: grayscale(0%); } - /* emoji end */ - /* feedback form */ - -.form{ - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - text-align: center; - padding: 20px; - margin-bottom: 80px; - background-color: var(--background-color); - border-radius: 20px; - +.form { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + text-align: center; + padding: 20px; + margin-bottom: 80px; + background-color: var(--background-color); + border-radius: 20px; } -.form span{ - font-size: large; - font-weight: bold; - +.form span { + font-size: large; + font-weight: bold; } - -.form-heading{ - color: var(--primary-text-color) ; - font-size: 1.8rem; - margin-top: 7%; - margin-bottom: 7%; +.form-heading { + color: var(--primary-text-color); + font-size: 1.8rem; + margin-top: 7%; + margin-bottom: 7%; } .form input[type="text"], @@ -212,48 +202,44 @@ iframe{ .form input[type="number"], .form input[type="date"], .form select, -.form textarea{ - - width:60%; - background-color: var(--input-bg-color); - margin: 0.3rem 0; - text-align: center; - padding: 10px 15px; - border-radius: 15px; - border: 3px solid var(--main-color); - box-shadow: 0 0 1rem var(--main-color);; - color: var(--primary-text-color); - font-family: 'Poppins', sans-serif; - font-size: 1rem; - transition: all 0.3s ease; - - +.form textarea { + width: 60%; + background-color: var(--input-bg-color); + margin: 0.3rem 0; + text-align: center; + padding: 10px 15px; + border-radius: 15px; + border: 3px solid var(--main-color); + box-shadow: 0 0 1rem var(--main-color); + color: var(--primary-text-color); + font-family: "Poppins", sans-serif; + font-size: 1rem; + transition: all 0.3s ease; } .form input[type="submit"], .form button[type="submit"] { - background-color: var(--accent-color); - color: var(--white-4345); - border: none; - padding: 10px 30px; - border-radius: 15px; - font-size: 1.1rem; - font-weight: bold; - cursor: pointer; - box-shadow: 0 0 1rem var(--main-color); - transition: 0.3s ease all; - margin-top: 20px; - font-family: 'Poppins', sans-serif; + background-color: var(--accent-color); + color: var(--white-4345); + border: none; + padding: 10px 30px; + border-radius: 15px; + font-size: 1.1rem; + font-weight: bold; + cursor: pointer; + box-shadow: 0 0 1rem var(--main-color); + transition: 0.3s ease all; + margin-top: 20px; + font-family: "Poppins", sans-serif; } .form input[type="submit"]:hover, .form button[type="submit"]:hover { - background-color: var(--accent-color-dark); - box-shadow: 0 0 1.5rem var(--accent-color-dark); - transform: scale(1.03); + background-color: var(--accent-color-dark); + box-shadow: 0 0 1.5rem var(--accent-color-dark); + transform: scale(1.03); } - .form select { appearance: none; -webkit-appearance: none; @@ -267,7 +253,7 @@ iframe{ border: 3px solid var(--main-color); border-radius: 15px; font-size: 1rem; - font-family: 'Poppins', sans-serif; + font-family: "Poppins", sans-serif; box-shadow: 0 0 1.2rem var(--main-color); cursor: pointer; transition: all 0.3s ease; @@ -288,8 +274,6 @@ iframe{ height: 40px; } - - /* Override for dark mode */ .dark-mode .form input[type="text"], .dark-mode .form input[type="email"], @@ -298,35 +282,34 @@ iframe{ .dark-mode .form input[type="date"], .dark-mode .form select, .dark-mode .form textarea { - background-color: var(--input-bg-color); - box-shadow: 0 0 2rem #1e1f20; - color: #f1f1f1 !important; - border: 3px solid var(--accent-color-dark); + background-color: var(--input-bg-color); + box-shadow: 0 0 2rem #1e1f20; + color: #f1f1f1 !important; + border: 3px solid var(--accent-color-dark); } - /* Placeholder styling */ .form input::placeholder, .form textarea::placeholder { - color: var(--placeholder-color); - opacity: 1; /* BETTER OPACITY */ - font-weight: bold; + color: var(--placeholder-color); + opacity: 1; /* BETTER OPACITY */ + font-weight: bold; } /* For select dropdown placeholder */ .form select:invalid { - color: var(--placeholder-color); + color: var(--placeholder-color); } /* Dark mode dropdown styling */ .dark-mode .form select { - color: white !important; - background-color: var(--input-bg-color); + color: white !important; + background-color: var(--input-bg-color); } /* Dark mode dropdown options */ .dark-mode .form select option { - color: white; - background-color: #495057; + color: white; + background-color: #495057; } /* ::placeholder{ @@ -338,78 +321,66 @@ iframe{ .form input[type="email"]:hover, .form input[type="password"]:hover, .form input[type="number"]:hover, -.form input[type="date"]:hover -.form textarea:hover{ - font-weight: bold; - border-radius: 10px; - background-color: #e6eef4; - color: var(--primary-text-color); - box-shadow: 0 0 1rem var(--main-color); - border: 3px solid rgb(25, 11, 11); - - +.form input[type="date"]:hover .form textarea:hover { + font-weight: bold; + border-radius: 10px; + background-color: #e6eef4; + color: var(--primary-text-color); + box-shadow: 0 0 1rem var(--main-color); + border: 3px solid rgb(25, 11, 11); } -.form textarea{ - width:60%; - background-color: var(--input-bg-color); - margin: 0.5%; - text-align: center; - height:50%; - padding: 10px; - border-radius: 20px; - border: 3px solid rgb(107, 7, 7); - box-shadow: 0 0 2rem var(--main-color); - color: var(--primary-text-color); +.form textarea { + width: 60%; + background-color: var(--input-bg-color); + margin: 0.5%; + text-align: center; + height: 50%; + padding: 10px; + border-radius: 20px; + border: 3px solid rgb(107, 7, 7); + box-shadow: 0 0 2rem var(--main-color); + color: var(--primary-text-color); } -.form textarea:hover{ - background-color: #cbe4f3; - border: 3px solid rgb(25, 11, 11); - - +.form textarea:hover { + background-color: #cbe4f3; + border: 3px solid rgb(25, 11, 11); } - -.form-card{ - width: 30rem; - height: auto; - margin: 1rem; - background-color: var(--white-4345); - border-radius: 40px; - border: 2px solid var(--accent-color); - box-shadow: 0 0 1rem var(--main-color); - text-align: center; - transition: transform 0.3s ease; - +.form-card { + width: 30rem; + height: auto; + margin: 1rem; + background-color: var(--white-4345); + border-radius: 40px; + border: 2px solid var(--accent-color); + box-shadow: 0 0 1rem var(--main-color); + text-align: center; + transition: transform 0.3s ease; } .form-card:hover { - transform: scale(1.02); - box-shadow: 0 0 1.2rem var(--accent-color-dark); + transform: scale(1.02); + box-shadow: 0 0 1.2rem var(--accent-color-dark); } -.form-flex{ - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - width: 100%; - - - +.form-flex { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + width: 100%; } /* google form end*/ - -body{ - font-family: "Raleway", sans-serif; - color: var(--primary-text-color); - /* padding-left: 10px; +body { + font-family: "Raleway", sans-serif; + color: var(--primary-text-color); + /* padding-left: 10px; padding-right: 10px; */ } -/* pop up */ - +/* pop up */ /* .popup { position: fixed; @@ -442,62 +413,61 @@ body{ position: relative; } */ .popup { - position: fixed; - top: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.3); /* Overlay stays dark for contrast */ - display: grid; - place-content: center; - opacity: 0; - pointer-events: none; - transition: 200ms ease-in-out opacity; - z-index: 999; /* To ensure it's above everything */ + position: fixed; + top: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.3); /* Overlay stays dark for contrast */ + display: grid; + place-content: center; + opacity: 0; + pointer-events: none; + transition: 200ms ease-in-out opacity; + z-index: 999; /* To ensure it's above everything */ } .popup-content { - width: clamp(300px, 80vw, 700px); /* Adjusted for responsiveness */ - background-color: var(--white-4345); /* Warm beige background */ - padding: clamp(1rem, 5vw, 2rem); - box-shadow: 0 0 0.8rem var(--main-color); /* Soft brown shadow */ - border-radius: 3em; - opacity: 0; - cursor: pointer; - transform: translateY(20%); - transition: 200ms ease-in-out opacity, - 200ms ease-in-out transform; - position: relative; - color: var(--primary-text-color); + width: clamp(300px, 80vw, 700px); /* Adjusted for responsiveness */ + background-color: var(--white-4345); /* Warm beige background */ + padding: clamp(1rem, 5vw, 2rem); + box-shadow: 0 0 0.8rem var(--main-color); /* Soft brown shadow */ + border-radius: 3em; + opacity: 0; + cursor: pointer; + transform: translateY(20%); + transition: + 200ms ease-in-out opacity, + 200ms ease-in-out transform; + position: relative; + color: var(--primary-text-color); } .popup-content:hover { - transform: translateY(10px); - box-shadow: - 0 0 8px var(--accent-color), - 0 0 12px var(--accent-color-dark), - 0 0 15px rgba(133, 97, 19, 0.5); + transform: translateY(10px); + box-shadow: + 0 0 8px var(--accent-color), + 0 0 12px var(--accent-color-dark), + 0 0 15px rgba(133, 97, 19, 0.5); } +.popup-content-card { + box-shadow: 0 0 10px 0px; + transition: transform 1.2s; + width: fit-content; -.popup-content-card{ - box-shadow: 0 0 10px 0px ; - transition: transform 1.2s; - width: fit-content; - - overflow: hidden; - box-sizing:content-box; + overflow: hidden; + box-sizing: content-box; } - .popup h3 { - position:absolute; - top: 2rem; - right: 25rem; - line-height: 1; - cursor: pointer; - user-select: none; + position: absolute; + top: 2rem; + right: 25rem; + line-height: 1; + cursor: pointer; + user-select: none; } .popup h3:active { - transform: scale(.9); + transform: scale(0.9); } /* .popup h4{ @@ -506,98 +476,93 @@ body{ color: #5864e9; } */ .popup h4 { - text-align: center; - color: var(--main-color); /* Rich brown */ - text-shadow: 1px 1px 2px var(--accent-color-dark); /* Soft warm shadow */ - margin-bottom: 1rem; + text-align: center; + color: var(--main-color); /* Rich brown */ + text-shadow: 1px 1px 2px var(--accent-color-dark); /* Soft warm shadow */ + margin-bottom: 1rem; } - .showPopup { - opacity: 1; - transform: translateY(0); - pointer-events: all; + opacity: 1; + transform: translateY(0); + pointer-events: all; } /* pop up end */ -h1{ - font-size: 3rem; +h1 { + font-size: 3rem; } -h2{ - font-size: 2rem; +h2 { + font-size: 2rem; } -h3{ - font-size: 1.5rem; +h3 { + font-size: 1.5rem; } -p{ - font-family: 'Poppins',sans-serif; - font-size: 1.25rem; - color: var(--secondary-text-color); - line-height: 1.8rem; - +p { + font-family: "Poppins", sans-serif; + font-size: 1.25rem; + color: var(--secondary-text-color); + line-height: 1.8rem; } -a{ - text-decoration: none; - display: inline-block; +a { + text-decoration: none; + display: inline-block; } -.container{ -margin-inline: auto; -padding-inline: var(--padding-inline-section); - - +.container { + margin-inline: auto; + padding-inline: var(--padding-inline-section); } -.primary-button{ - background-color: var(--accent-color); - border-radius: 6px; - font-weight: 700; - color: white; - padding: 12px 24px ; - box-shadow:0 0 2px var(--secondary-text-color) ; - transition: all 0.3s ease; +.primary-button { + background-color: var(--accent-color); + border-radius: 6px; + font-weight: 700; + color: white; + padding: 12px 24px; + box-shadow: 0 0 2px var(--secondary-text-color); + transition: all 0.3s ease; } -.primary-button{ - background-color: var(--accent-color-dark); +.primary-button { + background-color: var(--accent-color-dark); } -.flex{ - display: flex; - align-items: center; +.flex { + display: flex; + align-items: center; } - nav { - padding: 5px 15px; - background-color: var(--nav-bgcolor); - height: 60px; /* Reduced height for less spacing */ - display: flex; - align-items: center; - justify-content: space-between; - border: 2px solid var(--primary-text-color); /* Reduced border */ - z-index: 1000; - position: fixed; - top: 0; - left: 0; - right: 0; - box-shadow: 0 2px 8px rgba(0,0,0,0.1); - font-family: 'Segoe UI', sans-serif; + padding: 5px 15px; + background-color: var(--nav-bgcolor); + height: 60px; /* Reduced height for less spacing */ + display: flex; + align-items: center; + justify-content: space-between; + border: 2px solid var(--primary-text-color); /* Reduced border */ + z-index: 1000; + position: fixed; + top: 0; + left: 0; + right: 0; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + font-family: "Segoe UI", sans-serif; } /* Navbar container styling */ nav .nav-first, nav .nav-end { - display: flex; - align-items: center; - gap: 15px; + display: flex; + align-items: center; + gap: 15px; } nav .nav-first { - flex-shrink: 0; + flex-shrink: 0; } nav .nav-end { - flex-shrink: 0; - margin-left: auto; + flex-shrink: 0; + margin-left: auto; } /* Left side: back button + logo */ @@ -615,289 +580,274 @@ nav .nav-end { } nav ul { - margin: 0; - padding: 0; - color: var(--primary-text-color); - list-style: none; - display: flex; - align-items: center; - justify-content: center; - gap: 2px; /* Reduced gap */ + margin: 0; + padding: 0; + color: var(--primary-text-color); + list-style: none; + display: flex; + align-items: center; + justify-content: center; + gap: 2px; /* Reduced gap */ } nav ul li a { - text-decoration: none; - position: relative; - color: var(--primary-text-color); - margin: 0 4px; /* Reduced margin */ - font-size: 15px; /* Slightly smaller font */ - letter-spacing: 0.3px; - font-weight: 600; - padding: 8px 12px; /* Reduced padding */ - transition: all 0.3s ease; - border-radius: 6px; - white-space: nowrap; + text-decoration: none; + position: relative; + color: var(--primary-text-color); + margin: 0 4px; /* Reduced margin */ + font-size: 15px; /* Slightly smaller font */ + letter-spacing: 0.3px; + font-weight: 600; + padding: 8px 12px; /* Reduced padding */ + transition: all 0.3s ease; + border-radius: 6px; + white-space: nowrap; } /* Active tab styling */ nav ul li a#active, nav ul li a.active { - background-color: var(--accent-color); - color: var(--white-4345); - border: 1px solid var(--accent-color-dark); + background-color: var(--accent-color); + color: var(--white-4345); + border: 1px solid var(--accent-color-dark); } /* Hover effects */ nav ul li a:hover { - background-color: var(--accent-color); - border-radius: 8px; - border: 1px solid var(--accent-color-dark); - color: var(--white-4345); - transform: translateY(-1px); + background-color: var(--accent-color); + border-radius: 8px; + border: 1px solid var(--accent-color-dark); + color: var(--white-4345); + transform: translateY(-1px); } .nav-link:hover, .nav-link.active { - background-color: var(--accent-color-dark); - color: var(--white-4345); + background-color: var(--accent-color-dark); + color: var(--white-4345); } nav .logo { - font-size: 22px; /* Reduced logo size */ - color: var(--main-color); - font-weight: 600; - font-family: "Cinzel",serif; - text-decoration: none; - flex-shrink: 0; /* Prevent logo from shrinking */ + font-size: 22px; /* Reduced logo size */ + color: var(--main-color); + font-weight: 600; + font-family: "Cinzel", serif; + text-decoration: none; + flex-shrink: 0; /* Prevent logo from shrinking */ } nav .logo a { - text-decoration: none; - color: inherit; + text-decoration: none; + color: inherit; } nav #mitra { - margin: 0; - padding: 0; - color: var(--main-color); + margin: 0; + padding: 0; + color: var(--main-color); } nav .menu-btn { flex-grow: 1; } - - - /* Mode toggle button */ nav #mode { - width: 28px; /* Reduced size */ - height: 28px; - cursor: pointer; - transition: transform 0.3s ease; - flex-shrink: 0; + width: 28px; /* Reduced size */ + height: 28px; + cursor: pointer; + transition: transform 0.3s ease; + flex-shrink: 0; } nav #mode:hover { - transform: scale(1.1); + transform: scale(1.1); } /* Back button styling */ nav .back-button { - background: var(--accent-color); - border: 1px solid var(--accent-color-dark); - border-radius: 6px; - padding: 6px 10px; - cursor: pointer; - transition: all 0.3s ease; - color: var(--main-color); - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - width: 40px; - height: 35px; + background: var(--accent-color); + border: 1px solid var(--accent-color-dark); + border-radius: 6px; + padding: 6px 10px; + cursor: pointer; + transition: all 0.3s ease; + color: var(--main-color); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + width: 40px; + height: 35px; } nav .back-button:hover { - background: var(--accent-color-dark); - color: var(--white-4345); - transform: translateX(-2px); + background: var(--accent-color-dark); + color: var(--white-4345); + transform: translateX(-2px); } nav .back-button i { - font-size: 16px; + font-size: 16px; } - -section{ - padding: 20px var(--padding-inline-section) 50px; /* Reduced top padding */ - background: var(--bg-shade); - - +section { + padding: 20px var(--padding-inline-section) 50px; /* Reduced top padding */ + background: var(--bg-shade); } -.main-page{ - margin-top: 0; /* Remove margin since .main already has it */ - justify-content: center; - gap: 50px; - padding-bottom: 5%; - - +.main-page { + margin-top: 0; /* Remove margin since .main already has it */ + justify-content: center; + gap: 50px; + padding-bottom: 5%; } /* Additional mobile responsive fixes for main content */ @media (max-width: 1000px) { - section { - padding-top: 20px; /* Reduce section padding on mobile */ - } + section { + padding-top: 20px; /* Reduce section padding on mobile */ + } } @media (max-width: 450px) { - section { - padding-top: 15px; /* Further reduce padding on very small screens */ - } + section { + padding-top: 15px; /* Further reduce padding on very small screens */ + } } -.header-left{ - max-width: 40vw; +.header-left { + max-width: 40vw; } -.header-left h1{ - margin-top: 20px; +.header-left h1 { + margin-top: 20px; } -.header-right img{ - width: 100%; /* bigger than before, try 15–20% */ +.header-right img { + width: 100%; /* bigger than before, try 15–20% */ height: auto; border-radius: 50%; object-fit: cover; display: block; - margin-left: 1rem; /* pushes it away from the extreme left */ - max-width: 400px; /* keeps it from becoming *too* big on wide screens */ - min-width: 120px; + margin-left: 1rem; /* pushes it away from the extreme left */ + max-width: 400px; /* keeps it from becoming *too* big on wide screens */ + min-width: 120px; } -.get-started-btn{ - margin-top: 20px; - transition: all 0.3s ease; - +.get-started-btn { + margin-top: 20px; + transition: all 0.3s ease; } - - .get-started-btn:hover { - transform: translateY(-3px); /* Smooth upward lift */ - background-color: var(--accent-color-dark); /* Warm brown hover */ - color: var(--white-4345); /* Light text on hover */ - transition: all 0.3s ease; + transform: translateY(-3px); /* Smooth upward lift */ + background-color: var(--accent-color-dark); /* Warm brown hover */ + color: var(--white-4345); /* Light text on hover */ + transition: all 0.3s ease; } #click { - display: none; + display: none; } .container1 { - display: flex; - gap: 40px; - margin: 60px; - justify-content: space-around; - align-items: stretch; - background-color: var(--bg-shade); /* Beige background */ - flex-wrap: wrap; - padding: 20px; - box-sizing: border-box; - border-radius: 15px; + display: flex; + gap: 40px; + margin: 60px; + justify-content: space-around; + align-items: stretch; + background-color: var(--bg-shade); /* Beige background */ + flex-wrap: wrap; + padding: 20px; + box-sizing: border-box; + border-radius: 15px; } .card { - background-color: var(--card-bg-color); /* Light beige */ - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); - border-radius: 20px; - border: 3px solid var(--accent-color); /* Warm brown border */ - transition: transform 0.3s ease; - height: auto; - overflow: hidden; - box-sizing: border-box; - padding: 10px; - display: flex; - flex-direction: column; - justify-content: space-between; - width:25%; + background-color: var(--card-bg-color); /* Light beige */ + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + border-radius: 20px; + border: 3px solid var(--accent-color); /* Warm brown border */ + transition: transform 0.3s ease; + height: auto; + overflow: hidden; + box-sizing: border-box; + padding: 10px; + display: flex; + flex-direction: column; + justify-content: space-between; + width: 25%; } .card-body { - display: flex; - flex-direction: column; - justify-content: space-between; - flex-grow: 1; - padding: 10px; + display: flex; + flex-direction: column; + justify-content: space-between; + flex-grow: 1; + padding: 10px; } .card a:hover { - background: var(--main-color); /* Bright brown/pink tone */ - color: var(--white-4345); /* Light beige text */ - box-shadow: 0 0 0.8rem var(--main-color); + background: var(--main-color); /* Bright brown/pink tone */ + color: var(--white-4345); /* Light beige text */ + box-shadow: 0 0 0.8rem var(--main-color); } .card-title { - font-size: 1.5rem; - font-weight: bold; - color: var(--primary-text-color); /* Usually dark brown */ - margin-bottom: 10px; + font-size: 1.5rem; + font-weight: bold; + color: var(--primary-text-color); /* Usually dark brown */ + margin-bottom: 10px; } .card-text { - font-size: 1rem; - color: var(--secondary-text-color); /* Softer brown */ - line-height: 1.5; - flex-grow: 1; - margin-bottom: 15px; + font-size: 1rem; + color: var(--secondary-text-color); /* Softer brown */ + line-height: 1.5; + flex-grow: 1; + margin-bottom: 15px; } .btn-outline-primary:hover { - background: var(--main-color); - color: var(--white-4345); - box-shadow: 0 0 0.8rem var(--main-color); + background: var(--main-color); + color: var(--white-4345); + box-shadow: 0 0 0.8rem var(--main-color); } - .service { - background: var(--bg-shade); /* Consistent light beige section */ - padding: 0 20px; + background: var(--bg-shade); /* Consistent light beige section */ + padding: 0 20px; } -.para{ - color: var(--primary-text-color); - font-weight: bold; - align-items: center; - text-align:justify; - padding: 10px 20px; - margin: 30px; +.para { + color: var(--primary-text-color); + font-weight: bold; + align-items: center; + text-align: justify; + padding: 10px 20px; + margin: 30px; } -.announcement-list{ - color: var(--primary-text-color); - font-weight: bold; - align-items: center; - text-align:justify; - padding: 0px 5px 0 50px; +.announcement-list { + color: var(--primary-text-color); + font-weight: bold; + align-items: center; + text-align: justify; + padding: 0px 5px 0 50px; } -.user-experience{ - - padding: 0px 0 0 30px; +.user-experience { + padding: 0px 0 0 30px; } .user-experience > p { - padding: 0px 0 0 30px; + padding: 0px 0 0 30px; } -.para span{ - color:#cf8133; +.para span { + color: #cf8133; } -.service-heading{ - text-align: center; - margin-bottom: 5%; - text-decoration: dashed; - list-style:lower-latin; - font-family: "Cinzel", serif; - padding-bottom: 3%; - - +.service-heading { + text-align: center; + margin-bottom: 5%; + text-decoration: dashed; + list-style: lower-latin; + font-family: "Cinzel", serif; + padding-bottom: 3%; } /* Main Calculator Section */ /* Dark Mode Support */ @@ -981,7 +931,7 @@ body.dark-mode .hero-section .btn:hover { color: #ffffff; } -.main{ +.main { background-color: #faebdd; } .calculator-box { @@ -1017,12 +967,12 @@ body.dark-mode .hero-section .btn:hover { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); } #calculator.py-5 { -background-color: #e0c89b; + background-color: #e0c89b; } /* Subject Input Rows */ #subject-container .row, #cgpa-container .row { - background-color:#faebdd; + background-color: #faebdd; border-radius: 10px; padding: 15px; margin-bottom: 15px; @@ -1092,16 +1042,16 @@ background-color: #e0c89b; font-size: 1.4rem; color: #3c2f1f; font-weight: 600; - background-color:#e0c89b; + background-color: #e0c89b; padding: 10px; border-radius: 8px; display: inline-block; } /* Hero Section Tweaks */ -.hero-section h1{ - color: #100f0f; -margin-bottom: 5%; +.hero-section h1 { + color: #100f0f; + margin-bottom: 5%; } .hero-section p { color: #100f0f; @@ -1116,7 +1066,7 @@ margin-bottom: 5%; background-color: #d2b376; color: #291c0b; } -.hero-section{ +.hero-section { background-color: #faebdd; } .hero-section h3 { @@ -1155,70 +1105,75 @@ margin-bottom: 5%; height: auto; } - /* Gallery Image Hover Effect Styles */ /* Scale the entire card on hover */ .card:hover { - transform: translateY(-4px) scale(1.01); /* Added scale(1.05) to existing transform */ - box-shadow: 0 0 15px var(--accent-color-dark), - 0 0 20px rgba(0, 0, 0, 0.3); - z-index: 5; /* Ensure hovered card appears above others */ - transition: all 0.3s ease; + transform: translateY(-4px) scale(1.01); /* Added scale(1.05) to existing transform */ + box-shadow: + 0 0 15px var(--accent-color-dark), + 0 0 20px rgba(0, 0, 0, 0.3); + z-index: 5; /* Ensure hovered card appears above others */ + transition: all 0.3s ease; } /* Scale the image itself on hover */ .card-img-top { - transition: transform 0.3s ease; + transition: transform 0.3s ease; } .card:hover .card-img-top { - transform: scale(1); /* Scale image slightly larger on hover */ + transform: scale(1); /* Scale image slightly larger on hover */ } /* Ensure the overlay text appears smoothly */ .card .effect-text { - position: absolute; - top: 15px; - right: 15px; - bottom: 15px; - left: 15px; - display: flex; - align-items: center; - justify-content: center; - text-align: center; - background: var(--img-bg-shade); - overflow: hidden; - transition: all 0.3s ease; /* Smoother transition */ - opacity: 0; - border: 2px solid var(--primary-text-color); - border-radius: 15px; /* Match card border radius */ + position: absolute; + top: 15px; + right: 15px; + bottom: 15px; + left: 15px; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + background: var(--img-bg-shade); + overflow: hidden; + transition: all 0.3s ease; /* Smoother transition */ + opacity: 0; + border: 2px solid var(--primary-text-color); + border-radius: 15px; /* Match card border radius */ } /* Make text more visible on hover */ .card:hover .effect-text { - opacity: 1; - background: rgba(250, 235, 221, 0.9); /* Slightly more opaque for better text visibility */ + opacity: 1; + background: rgba( + 250, + 235, + 221, + 0.9 + ); /* Slightly more opaque for better text visibility */ } /* Enhance text styling */ .card .effect-text .inner p { - color: var(--primary-text-color); - font-weight: bold; - font-size: 1rem; - line-height: 1.4; - padding: 10px; - text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); + color: var(--primary-text-color); + font-weight: bold; + font-size: 1rem; + line-height: 1.4; + padding: 10px; + text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); } body.dark-mode .card .effect-text .inner p { - color: var(--primary-text-color); - font-weight: bold; - font-size: 1rem; - line-height: 1.4; - padding: 10px; - background: transparent; - text-shadow: 1px 1px 3px rgba(0,0,0,1); /* add shadow for readability */ + color: var(--primary-text-color); + font-weight: bold; + font-size: 1rem; + line-height: 1.4; + padding: 10px; + background: transparent; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 1); /* add shadow for readability */ } .facility-container { @@ -1228,23 +1183,23 @@ body.dark-mode .card .effect-text .inner p { margin-top: 30px; } -.para1{ - color: var(--primary-text-color); - font-weight: bold; - align-items: center; - text-align:justify; - padding: 10px; - margin: 30px; +.para1 { + color: var(--primary-text-color); + font-weight: bold; + align-items: center; + text-align: justify; + padding: 10px; + margin: 30px; } .facility-card { display: flex; - background-color:#faebdd; + background-color: #faebdd; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); transition: transform 0.3s ease; - border-style:solid; + border-style: solid; border-color: #dfc2b3; } @@ -1311,101 +1266,95 @@ body.dark-mode .facility-card p { } } - .icon { - height: 90px; - width: 90px; - background-color: var(--accent-color); - margin: 40px auto 30px; - text-align: center; - font-size: 28px; - color: var(--white); - border-radius: 20px; - border-bottom-right-radius: 0; - position: relative; - transition: all 0.3s ease; - border: .2rem solid var(--text-color); - + height: 90px; + width: 90px; + background-color: var(--accent-color); + margin: 40px auto 30px; + text-align: center; + font-size: 28px; + color: var(--white); + border-radius: 20px; + border-bottom-right-radius: 0; + position: relative; + transition: all 0.3s ease; + border: 0.2rem solid var(--text-color); } -.icon img{ - height: 78px; - width: 78px; - - mix-blend-mode:multiply; - -} +.icon img { + height: 78px; + width: 78px; -.name{ - text-align: center; - color: var(--primary-text-color); - font-family: "Cinzel", serif; + mix-blend-mode: multiply; } -.icon i{ - margin-top: 35%; - - +.name { + text-align: center; + color: var(--primary-text-color); + font-family: "Cinzel", serif; } +.icon i { + margin-top: 35%; +} .about { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - text-align: center; - padding: 20px; - margin-bottom: 0px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + text-align: center; + padding: 20px; + margin-bottom: 0px; } .about-flex { - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - width: 100%; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + width: 100%; } .About-card { - width: 15rem; - min-height: 470px; - margin: 1rem; - padding: 1rem; - display: flex; - flex-direction: column; - justify-content: space-between; - background-color: #cab5af; - border-radius: 40px; - border-bottom-right-radius: 0; - border: 2px solid white; - box-shadow: 0 0 1rem var(--main-color); - text-align: center; - transition: transform 0.3s ease; + width: 15rem; + min-height: 470px; + margin: 1rem; + padding: 1rem; + display: flex; + flex-direction: column; + justify-content: space-between; + background-color: #cab5af; + border-radius: 40px; + border-bottom-right-radius: 0; + border: 2px solid white; + box-shadow: 0 0 1rem var(--main-color); + text-align: center; + transition: transform 0.3s ease; } -.About-card:hover{ - transform: scale(1.03); - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); +.About-card:hover { + transform: scale(1.03); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); } -.About-card a{ - margin-top: auto; - padding: 10px,20px; - color: var(--snd-bg-color); - border-radius: 10px; - font-weight: bold; - text-decoration: none; - transition: background-color 0.3 ease; +.About-card a { + margin-top: auto; + padding: 10px, 20px; + color: var(--snd-bg-color); + border-radius: 10px; + font-weight: bold; + text-decoration: none; + transition: background-color 0.3 ease; } -.About-card a:hover{ - background: #8c6723; - color: #fff; - box-shadow: 0 0 1rem var(--main-color); +.About-card a:hover { + background: #8c6723; + color: #fff; + box-shadow: 0 0 1rem var(--main-color); } -#about h4{ +#about h4 { font-size: 1.8rem; font-weight: bold; padding-top: 1.5rem; @@ -1416,22 +1365,24 @@ body.dark-mode .facility-card p { height: 40px; } /*card width adjust on the small screen */ -@media screen and (max-width : 768px){ -.About-card{ +@media screen and (max-width: 768px) { + .About-card { width: 90%; min-height: auto; + } } -} -#btn{ -margin-bottom: 20px; -border-radius: 2em; -border: 2px solid white; -background-color: #6b4f1d; -color: white; -padding: 12px 24px; -font-weight: bold; -font-size: 1rem; -transition: background-color 0.4s ease, transform 0.2 ease; +#btn { + margin-bottom: 20px; + border-radius: 2em; + border: 2px solid white; + background-color: #6b4f1d; + color: white; + padding: 12px 24px; + font-weight: bold; + font-size: 1rem; + transition: + background-color 0.4s ease, + transform 0.2 ease; } .footer-section { background-color: var(--footer-bgColor); @@ -1440,7 +1391,6 @@ transition: background-color 0.4s ease, transform 0.2 ease; border-top: 5px solid var(--primary-text-color); } - .contact-heading { text-align: center; color: var(--primary-text-color); @@ -1458,10 +1408,9 @@ transition: background-color 0.4s ease, transform 0.2 ease; } .contact-item { - flex: 1 1 0; + flex: 1 1 0; min-width: 220px; max-width: 100%; - } .contact-item { background-color: #fdf6ec; /* Light mode background */ @@ -1470,10 +1419,11 @@ transition: background-color 0.4s ease, transform 0.2 ease; box-shadow: 0 2px 8px rgba(205, 162, 116, 0.08); padding: 18px; /* margin-bottom: 18px; */ - transition: background 0.3s, color 0.3s; - box-sizing: border-box; - overflow:hidden; - + transition: + background 0.3s, + color 0.3s; + box-sizing: border-box; + overflow: hidden; } body.dark-mode .contact-item { @@ -1483,7 +1433,6 @@ body.dark-mode .contact-item { } body.dark-mode .contact-link i { color: var(--accent-color); /* Lighter accent for dark mode */ - } .contact-link { display: flex; @@ -1493,9 +1442,9 @@ body.dark-mode .contact-link i { text-align: center; border-radius: 10px; transition: 0.3s ease; - + box-sizing: border-box; - height:100%; + height: 100%; } .contact-link i { @@ -1576,13 +1525,13 @@ footer .copyright { nav { padding: 8px 15px; } - + nav ul li a { font-size: 15px; padding: 8px 12px; margin: 0 5px; } - + nav .logo { font-size: 26px; } @@ -1593,11 +1542,11 @@ footer .copyright { nav { padding: 8px 12px; } - + nav .logo { font-size: 22px; } - + nav #mode { width: 30px; height: 30px; @@ -1609,19 +1558,15 @@ footer .copyright { height: 55px; /* Compact mobile navbar */ padding: 5px 12px; } - + .main:not(.dark-mode) { margin-top: 55px; } - + nav .logo { font-size: 18px; } - - - - nav ul { position: fixed; top: 55px; @@ -1635,17 +1580,17 @@ footer .copyright { z-index: 999; padding-top: 20px; overflow-y: auto; - box-shadow: 0 2px 10px rgba(0,0,0,0.2); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + } + nav { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem 1rem; + background-color: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + font-family: sans-serif; } -nav { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0.5rem 1rem; - background-color: #fff; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); - font-family: sans-serif; -} nav ul li { margin: 15px 0; @@ -1671,14 +1616,12 @@ nav { border: 1px solid var(--accent-color-dark); } - - - #click:checked~ul { + #click:checked ~ ul { left: 0%; height: 70%; overflow-y: auto; } - + nav #mode { width: 24px; height: 24px; @@ -1748,7 +1691,7 @@ nav { } p { - font-size: 1.0rem; + font-size: 1rem; } .about { @@ -1820,33 +1763,32 @@ nav { height: 50px; /* Even more compact for small screens */ padding: 3px 8px; } - + .main:not(.dark-mode) { margin-top: 50px; } - + nav .logo { font-size: 16px; } - nav ul { top: 50px; height: calc(100vh - 50px); padding-top: 15px; } - + nav ul li a { font-size: 14px; padding: 10px 15px; width: 80%; } - + nav #mode { width: 22px; height: 22px; } - + p { width: fit-content; } @@ -1861,7 +1803,6 @@ nav { margin-bottom: 10px; } - .header-right img { width: 100%; margin-left: 0%; @@ -2017,16 +1958,83 @@ nav { .goog-te-gadget-icon, .goog-te-menu-value span, #google_translate_element { - display: none !important; - } - #lang-toggle{ - margin-right: 1vh; - } + display: none !important; +} +#lang-toggle { + margin-right: 1vh; +} body { - top: 0px !important; + top: 0px !important; } -#lang-toggle{ - padding:5px 10px; cursor:pointer; border:none; background:#333; color:#fff; border-radius:5px; +#lang-toggle { + padding: 8px 16px; + cursor: pointer; + border: 2px solid var(--accent-color); + background: var(--accent-color); + color: var(--primary-text-color); + border-radius: 8px; + font-weight: 600; + font-size: 14px; + transition: all 0.3s ease; + font-family: "Poppins", sans-serif; +} + +#lang-toggle:hover { + background: var(--accent-color-dark); + border-color: var(--accent-color-dark); + color: var(--white-4345); + transform: translateY(-1px); +} + +/* Google Translate styles - hide unwanted elements */ +#google_translate_element { + display: none !important; +} + +.goog-te-gadget { + display: none !important; +} + +.goog-te-combo { + display: none !important; +} + +.goog-te-banner-frame { + display: none !important; +} + +.goog-te-menu-frame { + display: none !important; +} + +.skiptranslate { + display: none !important; +} + +/* Hide the Google Translate bar that appears at the top */ +body > .skiptranslate { + display: none !important; +} + +body.translated-ltr { + top: 0px !important; +} + +body.translated-rtl { + top: 0px !important; +} + +/* Dark mode styles for lang-toggle */ +.dark-mode #lang-toggle { + background: var(--accent-color); + border-color: var(--accent-color); + color: var(--primary-text-color); +} + +.dark-mode #lang-toggle:hover { + background: var(--accent-color-dark); + border-color: var(--accent-color-dark); + color: var(--white-4345); } /* Tabs container */ @@ -2043,7 +2051,9 @@ body.dark-mode .nav-tabs .nav-link { margin-right: 6px; padding: 0.5rem 1.2rem; font-weight: 600; - transition: background-color 0.3s, color 0.3s; + transition: + background-color 0.3s, + color 0.3s; box-shadow: none !important; } @@ -2053,7 +2063,7 @@ body.dark-mode .nav-tabs .nav-link.active { color: var(--main-color) !important; font-weight: 700; border-bottom: 2.5px solid var(--main-color) !important; - box-shadow: 0 4px 10px var(--accent-color-dark)40 !important; /* subtle shadow */ + box-shadow: 0 4px 10px var(--accent-color-dark) 40 !important; /* subtle shadow */ } /* Hover and focus */ @@ -2081,39 +2091,38 @@ body.dark-mode .reset-icon:hover { /* SGPA Result box contrast fix for dark mode */ body.dark-mode #result, body.dark-mode #cgpa-result { - background-color: #bb995c !important; /* Use your gold accent for strong contrast */ - color: #191717 !important; /* Very dark brown/black for clear numbers */ + background-color: #bb995c !important; /* Use your gold accent for strong contrast */ + color: #191717 !important; /* Very dark brown/black for clear numbers */ font-weight: 700; border-radius: 10px; box-shadow: 0 2px 8px #85611333; } - .result-box { - background-color: #f8f9fa; - border: 2px solid #dee2e6; - border-radius: 10px; - padding: 20px; - margin-top: 20px; + background-color: #f8f9fa; + border: 2px solid #dee2e6; + border-radius: 10px; + padding: 20px; + margin-top: 20px; } .result-box h4 { - color: #495057; - margin-bottom: 20px; + color: #495057; + margin-bottom: 20px; } .result-box .h3 { - font-weight: bold; - margin: 10px 0; + font-weight: bold; + margin: 10px 0; } /* Dark mode support */ body.dark-mode .result-box { - background-color: #2b2b2b; - border-color: #444; + background-color: #2b2b2b; + border-color: #444; } body.dark-mode .result-box h4, body.dark-mode .result-box h5 { - color: #e0e0e0; + color: #e0e0e0; } diff --git a/index.html b/index.html index 6a35a8ea..b0c00a82 100644 --- a/index.html +++ b/index.html @@ -1,735 +1,884 @@ - + - - - - - - - nitra mitra - - - - - - - + + + + nitra mitra + + + + + + + - + - - - + + + + href="https://fonts.googleapis.com/css2?family=Alex+Brush&family=Lora:ital,wght@0,400..700;1,400..700&family=Pacifico&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" + rel="stylesheet" + /> - - - - - - - + + + + + + + + - - - - - - + + -
-
+
- - -
-
-
-

Welcome to Nitra Mitra

-

Your ultimate platform for academic resources, campus updates, and - community - connection at NITRA Technical Campus.

- My Services -
- -
- student image -
-
-
- - -
-

Services

-

Welcome to Nitra Mitra, your ultimate platform for NITRA - Technical - Campus, Ghaziabad. We offer a comprehensive suite of resources, from academic - materials to - event updates, designed to enhance your learning experience. Explore our latest - features, - download - exclusive content, and stay connected with campus activities. Don't miss out on - valuable - resources—download or view them directly on Nitra Mitra today! We value your - feedback; - please fill - out our feedback form to help us improve and serve you better. Visit - Nitra - Mitra now! +

+
+
+

Welcome to Nitra Mitra

+

+ Your ultimate platform for academic resources, campus updates, and + community connection at NITRA Technical Campus.

-

Browse our comprehensive offerings below:

-
- -
- Illustration representing academic resources -
-

Resources

-

Get all resources for BTECH Students.

- Open -
-
-
- Game section -
-

Games

-

Multiple games plays.

- Play Now -
-
- -
- gallery -
-

Gallery

-

View all events memories here.

- Open -
-
-
- infrastructure -
-

Infrastructure

-

View all events memories here.

- Open -
+ My Services +
+ +
+ student image +
+
+
+ + +
+

Services

+

+ Welcome to Nitra Mitra, your ultimate platform for + NITRA Technical Campus, Ghaziabad. We offer a + comprehensive suite of resources, from academic materials to + event updates, designed to enhance your learning experience. + Explore our latest features, download exclusive content, and + stay connected with campus activities. Don't miss out on + valuable resources—download or view them directly on + Nitra Mitra today! We value your feedback; please fill + out our feedback form to help us improve and + serve you better. Visit Nitra Mitra now! +

+

+ Browse our comprehensive offerings below: +

+
+
+ Illustration representing academic resources +
+

Resources

+

+ Get all resources for BTECH Students. +

+ Open + +
+
+
+ Game section +
+

Games

+

Multiple games plays.

+ Play Now +
+
+ +
+ gallery +
+

Gallery

+

View all events memories here.

+ Open +
+
+
+ infrastructure +
+

Infrastructure

+

View all events memories here.

+ Open +
+
+ +
+ CGPA Calculator +
+

CGPA/SGPA Calculator

+

+ Calculate your semester SGPA & overall CGPA. +

+ Calculate Now +
+
+ +
+ Placement Updates +
+

Placement Cell Updates

+

+ Stay updated with company drives, interviews, and + shortlists. +

+ View Updates +
+
+ +
+ student assistant +
+

Student Assistant

+

+ AI-powered chatbot for academic help. +

+ Chat Now +
+
+ +
+ ai summary tool +
+

AI Summary Tool

+

+ Smart text & file summarization with notes enhancement. +

+ Summarize Now +
+
+ +
+ Syllabus +
+

Syllabus

+

+ Access the latest syllabus for your courses. +

+ View Syllabus +
+
+
+
+
+

+ Announcement Section +

+ +

+ Your essential hub for all campus updates from + Nitra Technical Campus! The + Announcement Section on Nitra Mitra features key + information to keep you fully informed, such as: +

+
    +
  • + Upcoming Events & Academic Deadlines: Stay on top of all + academic deadlines and exciting campus events. +
  • +
  • + Examination Schedules & Important Notices: Get timely updates + on exams, circulars, and crucial announcements. +
  • +
  • + Campus Activities & Cultural Events: Discover and participate + in various clubs, societies, and cultural celebrations. +
  • +
  • + Sports Competitions & Student Achievements: Follow + inter-college sports action and celebrate the accomplishments of + your peers. +
  • +
+

+ Check frequently to stay connected and never miss a key update! +

+ +
+ + +
+
+ +
+

User Experience

+

+ The user experience on our platform has been overwhelmingly positive, + with praise for: +

+
    +
  • + Ease of Use & Comprehensive Resources: Seamless access to + materials, including notes, announcements, and event + updates. +
  • +
  • + Intuitive Layout: Easily find important information, from + academic resources to campus activities. +
  • +
  • + One-Stop Platform: Users have highlighted how + Nitra Mitra serves as a one-stop platform that enhances + their college experience by keeping them informed and connected. +
  • +
  • + Mobile-Friendly Design: Access resources anytime, anywhere. +
  • +
+ +

+ Overall, Nitra Mitra has become an essential tool for + students at Nitra Technical Campus, offering a + streamlined and user-friendly experience. +

+
+ +
+
+ + + + +
+

About us

+

Our Mission

+

+ At Nitra Mitra, our core mission is to empower students + of NITRA Technical Campus and AKTU by + transforming their academic journey. We strive to be the ultimate, + user-friendly platform that simplifies access to a comprehensive suite + of essential resources, from meticulously compiled notes and previous + semester question papers to timely event updates and career guidance. + Our goal is to equip every student with the tools they need to excel, + making their college experience smoother and more successful. +

+

Who We Are

+

+ Nitra Mitra is more than just a platform; it's a + student-driven initiative born from a deep understanding of academic + challenges. We are a collaborative community focused on simplifying + college life through innovative solutions and relevant content, built + with a strong emphasis on user-friendly design and accessibility. It + is proudly developed by Vaibhav Babele and + Ghanshyam Prajapati, dedicated students of + NITRA Technical Campus. Their vision and hard work have + been instrumental in tailoring Nitra Mitra to meet the + specific needs of students, ensuring it provides tangible academic + value. +

+

Our Commitment

+

+ At Nitra Mitra, our dedication extends beyond just + providing resources; we are deeply committed to the continuous + enhancement of this platform. We pledge to tirelessly work towards + serving the academic community of NITRA Technical Campus, + striving to evolve and adapt to student needs. Our commitment is to + consistently deliver updated, relevant content and innovative features + that empower students with the essential tools required to excel in + their studies and thrive in their educational journey. Your success is + our driving force. +

+

About AKTU

+

+ Dr. A.P.J. Abdul Kalam Technical University (AKTU) stands as a + prominent public collegiate university located in Uttar Pradesh, + India. It serves as a major affiliating body for numerous engineering, + technology, and management colleges across the state. + Nitra Mitra is specifically designed to cater to the + academic and informational needs of students who are affiliated with + AKTU, providing tailored resources and updates to support their + educational journey. +

+
+ + +
+

Feedback Form

+ +

+ Your feedback is invaluable for shaping Nitra Mitra into + the best platform for the + NITRA Technical Campus community. We invite you to use + the form below to share your details and experiences regarding the + website's navigation, content, design, and functionality. Your + specific input directly guides our enhancements, helping us create a + more user-friendly and engaging resource tailored to your academic + journey. +

+
+
+
+

Feedback

+
+

+

+

+

+

+

+

+ +

+ +
+
Rate The Website
+ + + + + + + + + + + + + + +
-
- CGPA Calculator -
-

CGPA/SGPA Calculator

-

Calculate your semester SGPA & overall CGPA.

- Calculate Now -
-
+
+
-
- Placement Updates -
-

Placement Cell Updates

-

Stay updated with company drives, interviews, and shortlists. -

- View Updates -
+

+ + +
-
-
-

Announcement Section

- -

Your essential hub for all campus updates from Nitra Technical Campus! - The - Announcement Section on Nitra Mitra features key information to keep you fully - informed, - such as: -

-
    -
  • Upcoming Events & Academic Deadlines: Stay on top of all academic deadlines and - exciting - campus events. -
  • -
  • Examination Schedules & Important Notices: Get timely updates on exams, circulars, - and - crucial - announcements.
  • -
  • Campus Activities & Cultural Events: Discover and participate in various clubs, - societies, - and cultural - celebrations.
  • -
  • Sports Competitions & Student Achievements: Follow inter-college sports action and - celebrate - the - accomplishments of your peers.
  • -
-

Check frequently to stay connected and never miss a key update!

- -
- - -
-
- -
-

User Experience

-

The user experience on our platform has been overwhelmingly positive, with praise - for:

-
    -
  • Ease of Use & Comprehensive Resources: Seamless access to materials, including - notes, - announcements, and event updates.
  • -
  • Intuitive Layout: Easily find important information, from academic resources to - campus - activities.
  • -
  • One-Stop Platform: Users have highlighted how Nitra Mitra serves as a - one-stop - platform that - enhances their college experience by keeping them informed and connected.
  • -
  • Mobile-Friendly Design: Access resources anytime, anywhere.
  • -
- -

Overall, Nitra Mitra has become an essential tool for students at - Nitra - Technical Campus, offering a streamlined and user-friendly experience. -

-
- -
+ -
- - - - -
-

About us

-

Our Mission

-

- At Nitra Mitra, our core mission is to empower students of NITRA Technical - Campus and - AKTU by transforming their academic journey. We strive to be the ultimate, - user-friendly - platform - that simplifies access to a comprehensive suite of essential resources, from meticulously - compiled notes - and - previous semester question papers to timely event updates and career guidance. Our goal is to - equip - every - student with the tools they need to excel, making their college experience smoother and more - successful. -

-

Who We Are

-

- Nitra Mitra is more than just a platform; it's a student-driven initiative born - from a deep - understanding of academic challenges. We are a collaborative community focused on simplifying - college - life - through innovative solutions and relevant content, built with a strong emphasis on user-friendly - design - and - accessibility. - It is proudly developed by Vaibhav Babele and Ghanshyam Prajapati, - dedicated - students - of NITRA Technical Campus. Their vision and hard work have been instrumental in - tailoring - Nitra Mitra to meet the specific needs of students, ensuring it provides tangible - academic - value. -

-

Our Commitment

-

- At Nitra Mitra, our dedication extends beyond just providing resources; we are - deeply - committed to - the continuous enhancement of this platform. We pledge to tirelessly work towards serving the - academic - community - of NITRA Technical Campus, striving to evolve and adapt to student needs. Our - commitment is - to - consistently deliver updated, relevant content and innovative features that empower students - with the - essential - tools required to excel in their studies and thrive in their educational journey. Your success - is our - driving - force. +

+
+
+

Meet Our Team

+

+ Dedicated developers working together to create the best + educational platform for NITRA students.

-

About AKTU

-

Dr. A.P.J. Abdul Kalam Technical University (AKTU) stands - as a - prominent - public collegiate university located in Uttar Pradesh, India. It serves as a major affiliating - body for - numerous - engineering, technology, and management colleges across the state. Nitra Mitra is - specifically - designed to cater to the academic and informational needs of students who are affiliated with - AKTU, - providing - tailored resources and updates to support their educational journey. -

-
- - -
-

Feedback Form

- -

Your feedback is invaluable for shaping Nitra Mitra into the best - platform for - the - NITRA Technical Campus community. - We invite you to use the form below to share your details and experiences regarding the - website's - navigation, - content, design, and functionality. - Your specific input directly guides our enhancements, helping us create a more user-friendly and - engaging - resource tailored to your academic journey. -

-
- -
-
-

Feedback

-
-

-

-

-

-

-

-

- -

- - -
-
Rate The Website
- - - - - - - - - - - - - - - -
- -

- -

-
- - - -
-
-
-

Total Visitors

- - +
+ +
+ +
+
+ Vaibhav Babele +
+ +

Vaibhav Babele

+

Lead Developer & Founder

+ +

+ Computer Science Engineering student passionate about creating + educational platforms for students. +

+
-
- - - - - - - - -
-
-
-

Meet Our Team -

-

- Dedicated developers working together to create the best educational platform for NITRA - students. -

-
- -
- -
-
- Vaibhav Babele -
- -

Vaibhav - - Babele

-

- Lead Developer & Founder

- -

- Computer Science Engineering student passionate about creating educational platforms - for - - students. -

- -
- - -
-
- Ghanshyam Prajapati -
- -

Ghanshyam - - Prajapati

-

- Co-Developer

-

- Dedicated developer contributing to the platform's growth and student experience - enhancement. -

- -
- - -
-
- -
-

- Development Team

-

- Contributors & Maintainers

-

- A growing community of student developers working together to improve the platform. -

- -
-
+ +
+
+ Ghanshyam Prajapati +
+ +

Ghanshyam Prajapati

+

Co-Developer

+

+ Dedicated developer contributing to the platform's growth and + student experience enhancement. +

+
-
- - - - - - - - -
+ + + + + + + +
+ + + Email +

nitramitra@gmail.com

+
+
+
+ + + Address +

Sanjay Nagar, Ghaziabad, India

+
+
+ + +
+ + + + +
+ + + + + + - - - - - - - - - + + - - - \ No newline at end of file + + diff --git a/index.js b/index.js index b03bb0c7..7c61de05 100644 --- a/index.js +++ b/index.js @@ -1,179 +1,136 @@ // ===== Navbar & Scroll Handling ===== -const element = document.getElementById('scroll-hide'); +const element = document.getElementById("scroll-hide"); const load = document.getElementById("onload"); function checkWindowSize() { - if (!element) return; - - if (window.innerWidth < 1000) { - window.addEventListener('scroll', function () { - if (window.scrollY > 10) { - element.style.display = 'none'; - } - }); - } else { - element.style.display = 'flex'; - } + if (!element) return; + + if (window.innerWidth < 1000) { + window.addEventListener("scroll", function () { + if (window.scrollY > 10) { + element.style.display = "none"; + } + }); + } else { + element.style.display = "flex"; + } } -window.addEventListener('load', checkWindowSize); -window.addEventListener('resize', checkWindowSize); +window.addEventListener("load", checkWindowSize); +window.addEventListener("resize", checkWindowSize); // ===== Back Button Function ===== function goBack() { - if (window.history.length > 1) { - window.history.back(); - } else { - window.location.href = '/'; - } + if (window.history.length > 1) { + window.history.back(); + } else { + window.location.href = "/"; + } } // ===== Dark Mode Toggle ===== let darkModeInitialized = false; function initDarkMode() { - // Prevent multiple initializations - if (darkModeInitialized) return; - - const mode = document.getElementById("mode"); - - if (!mode) { - console.error('Mode element not found!'); - return; - } - - // Initialize dark mode state - const isDark = localStorage.getItem('mode') === 'true'; - document.body.classList.toggle('dark-mode', isDark); - + // Prevent multiple initializations + if (darkModeInitialized) return; + + const mode = document.getElementById("mode"); + + if (!mode) { + console.error("Mode element not found!"); + return; + } + + // Initialize dark mode state + const isDark = localStorage.getItem("mode") === "true"; + document.body.classList.toggle("dark-mode", isDark); + + updateModeIcon(mode); + + // Remove any existing event listeners + mode.onclick = null; + + // Add click event listener + mode.addEventListener("click", function () { + const wasDarkmode = localStorage.getItem("mode") === "true"; + const newMode = !wasDarkmode; + localStorage.setItem("mode", newMode); + document.body.classList.toggle("dark-mode", newMode); updateModeIcon(mode); - - // Remove any existing event listeners - mode.onclick = null; - - // Add click event listener - mode.addEventListener('click', function () { - const wasDarkmode = localStorage.getItem('mode') === 'true'; - const newMode = !wasDarkmode; - localStorage.setItem('mode', newMode); - document.body.classList.toggle("dark-mode", newMode); - updateModeIcon(mode); - console.log('Theme toggled to:', newMode ? 'dark' : 'light'); - }); - - darkModeInitialized = true; - console.log('Dark mode toggle initialized successfully'); + console.log("Theme toggled to:", newMode ? "dark" : "light"); + }); + + darkModeInitialized = true; + console.log("Dark mode toggle initialized successfully"); } function updateModeIcon(mode) { - if (!mode) return; - - const path = window.location.pathname; - const isDeepPage = ['/summary', '/assistant', '/pr-contribution', '/certificate'].some(subpath => - path.includes('/pages' + subpath) - ); - - let imgPathPrefix = ''; - if (isDeepPage) { - imgPathPrefix = '../../images/'; - } else if (path.includes('/pages') || path.includes('/games')) { - imgPathPrefix = '../images/'; - } else { - imgPathPrefix = 'images/'; - } - - mode.src = document.body.classList.contains("dark-mode") ? imgPathPrefix + "sun.png" : imgPathPrefix + "moon.png"; + if (!mode) return; + + const path = window.location.pathname; + const isDeepPage = [ + "/summary", + "/assistant", + "/pr-contribution", + "/certificate", + ].some((subpath) => path.includes("/pages" + subpath)); + + let imgPathPrefix = ""; + if (isDeepPage) { + imgPathPrefix = "../../images/"; + } else if (path.includes("/pages") || path.includes("/games")) { + imgPathPrefix = "../images/"; + } else { + imgPathPrefix = "images/"; + } + + mode.src = document.body.classList.contains("dark-mode") + ? imgPathPrefix + "sun.png" + : imgPathPrefix + "moon.png"; } // Test function for debugging (can be called from browser console) function testThemeToggle() { - const mode = document.getElementById("mode"); - console.log('Mode element:', mode); - console.log('Current dark mode state:', document.body.classList.contains('dark-mode')); - console.log('LocalStorage mode:', localStorage.getItem('mode')); - - if (mode) { - mode.click(); - } else { - console.error('Mode element not found!'); - } + const mode = document.getElementById("mode"); + console.log("Mode element:", mode); + console.log( + "Current dark mode state:", + document.body.classList.contains("dark-mode") + ); + console.log("LocalStorage mode:", localStorage.getItem("mode")); + + if (mode) { + mode.click(); + } else { + console.error("Mode element not found!"); + } } // Initialize dark mode when DOM is ready -document.addEventListener('DOMContentLoaded', function() { - // Small delay to ensure all elements are loaded - setTimeout(initDarkMode, 100); +document.addEventListener("DOMContentLoaded", function () { + // Small delay to ensure all elements are loaded + setTimeout(initDarkMode, 100); }); // Also try on window load as backup -window.addEventListener('load', function() { - if (!darkModeInitialized) { - initDarkMode(); - } +window.addEventListener("load", function () { + if (!darkModeInitialized) { + initDarkMode(); + } }); // ===== Copyright Year ===== document.addEventListener("DOMContentLoaded", function () { - const year = new Date().getFullYear(); - const copyright = document.getElementById("copyright"); - if (copyright) { - copyright.textContent = `© ${year} nitramitra | All Rights Reserved`; - } -}); - -// ===== Google Translate Toggle ===== -function googleTranslateElementInit() { - new google.translate.TranslateElement({ - pageLanguage: 'en', - includedLanguages: 'en,hi', - layout: google.translate.TranslateElement.InlineLayout.SIMPLE - }, 'google_translate_element'); -} - -// Dynamically load Google Translate script once -if (!document.querySelector('script[src*="translate.google.com"]')) { - const translateScript = document.createElement('script'); - translateScript.src = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; - document.body.appendChild(translateScript); -} - -function waitForTranslate(callback) { - const interval = setInterval(() => { - const select = document.querySelector(".goog-te-combo"); - if (select) { - clearInterval(interval); - callback(select); - } - }, 500); -} - -function initLanguageToggle() { - const langToggle = document.getElementById("lang-toggle"); - if (!langToggle) return; - - waitForTranslate((select) => { - // Apply saved language immediately - const savedLang = localStorage.getItem("lang") || "en"; - select.value = savedLang; - select.dispatchEvent(new Event("change")); - langToggle.innerText = savedLang === "en" ? "हिंदी" : "English"; - - // Toggle click - langToggle.addEventListener("click", function () { - const newLang = select.value === "en" ? "hi" : "en"; - select.value = newLang; - select.dispatchEvent(new Event("change")); - langToggle.innerText = newLang === "en" ? "हिंदी" : "English"; - localStorage.setItem("lang", newLang); - }); - }); -} - -// Run language toggle initialization -document.addEventListener("DOMContentLoaded", function() { - setTimeout(initLanguageToggle, 200); + const year = new Date().getFullYear(); + const copyright = document.getElementById("copyright"); + if (copyright) { + copyright.textContent = `© ${year} nitramitra | All Rights Reserved`; + } }); +// ===== Google Translate functionality is handled in language.js ===== +// This section has been moved to language.js to avoid conflicts document.addEventListener("DOMContentLoaded", () => { const sections = document.querySelectorAll("section[id]"); @@ -182,7 +139,7 @@ document.addEventListener("DOMContentLoaded", () => { window.addEventListener("scroll", () => { let current = ""; - sections.forEach(section => { + sections.forEach((section) => { const sectionTop = section.offsetTop - 100; // adjust offset for header const sectionHeight = section.clientHeight; @@ -191,7 +148,7 @@ document.addEventListener("DOMContentLoaded", () => { } }); - navLinks.forEach(link => { + navLinks.forEach((link) => { link.classList.remove("active"); if (link.getAttribute("href") === `#${current}`) { link.classList.add("active"); diff --git a/language-enhanced.js b/language-enhanced.js new file mode 100644 index 00000000..2e75c6d3 --- /dev/null +++ b/language-enhanced.js @@ -0,0 +1,328 @@ +/* eslint-disable quotes */ +// Enhanced Translation System with Fallback +// This provides both Google Translate integration and a fallback translation system + +// Basic Hindi translations for common elements +const basicTranslations = { + // Navigation and UI + "Welcome to Nitra Mitra": "नित्रा मित्र में आपका स्वागत है", + "Your ultimate platform for academic resources": + "शैक्षणिक संसाधनों के लिए आपका अंतिम मंच", + Services: "सेवाएं", + Resources: "संसाधन", + Games: "खेल", + Gallery: "गैलरी", + "Contact Us": "संपर्क करें", + "About us": "हमारे बारे में", + "My Services": "मेरी सेवाएं", + "Feedback Form": "फीडबैक फॉर्म", + Infrastructure: "अवसंरचना", + "CGPA/SGPA Calculator": "सीजीपीए/एसजीपीए कैलकुलेटर", + "Student Assistant": "छात्र सहायक", + "AI Summary Tool": "एआई सारांश उपकरण", + Syllabus: "पाठ्यक्रम", + + // Common phrases + "Get all resources for BTECH Students": + "बीटेक छात्रों के लिए सभी संसाधन प्राप्त करें", + "Multiple games plays": "कई खेल खेले जाते हैं", + "View all events memories here": "यहां सभी कार्यक्रमों की यादें देखें", + "Calculate your semester SGPA & overall CGPA": + "अपना सेमेस्टर एसजीपीए और समग्र सीजीपीए की गणना करें", + "AI-powered chatbot for academic help": + "शैक्षणिक सहायता के लिए एआई-संचालित चैटबॉट", + "Smart text & file summarization": "स्मार्ट टेक्स्ट और फ़ाइल सारांश", + "Access the latest syllabus for your courses": + "अपने पाठ्यक्रमों के लिए नवीनतम पाठ्यक्रम तक पहुंचें", + + // Buttons and actions + Open: "खोलें", + "Play Now": "अभी खेलें", + "Calculate Now": "अभी गणना करें", + "Chat Now": "अभी चैट करें", + "Summarize Now": "अभी सारांश बनाएं", + "View Syllabus": "पाठ्यक्रम देखें", + "View Updates": "अपडेट देखें", + + // About section + "Our Mission": "हमारा मिशन", + "Who We Are": "हम कौन हैं", + "Our Commitment": "हमारी प्रतिबद्धता", +}; + +// Store original content for restoration +let originalContent = new Map(); +let isTranslated = false; + +function saveOriginalContent() { + if (originalContent.size === 0) { + // Save all text content + const textElements = document.querySelectorAll( + "h1, h2, h3, h4, h5, h6, p, span, a, button, li" + ); + textElements.forEach((element, index) => { + if (element.textContent.trim() && !element.querySelector("*")) { + originalContent.set(`element_${index}`, { + element: element, + originalText: element.textContent.trim(), + }); + } + }); + console.log("Saved original content for", originalContent.size, "elements"); + } +} + +function translateToHindi() { + console.log("Translating to Hindi using fallback system..."); + saveOriginalContent(); + + originalContent.forEach((data) => { + const { element, originalText } = data; + const translation = basicTranslations[originalText]; + if (translation) { + element.textContent = translation; + } + }); + + isTranslated = true; + console.log("Translation to Hindi completed"); +} + +function translateToEnglish() { + console.log("Restoring English content..."); + + originalContent.forEach((data) => { + const { element, originalText } = data; + element.textContent = originalText; + }); + + isTranslated = false; + console.log("Restoration to English completed"); +} + +// Enhanced Google Translate with fallback +function googleTranslateElementInit() { + console.log("googleTranslateElementInit called"); + try { + new google.translate.TranslateElement( + { + pageLanguage: "en", + includedLanguages: "en,hi", + autoDisplay: false, + layout: google.translate.TranslateElement.InlineLayout.SIMPLE, + }, + "google_translate_element" + ); + console.log("Google Translate element created successfully"); + } catch (error) { + console.error("Error creating Google Translate element:", error); + console.log("Will use fallback translation system"); + initializeFallbackTranslation(); + } +} + +function initializeFallbackTranslation() { + console.log("Initializing fallback translation system"); + + const langToggle = document.getElementById("lang-toggle"); + if (!langToggle) { + console.error("Language toggle button not found"); + return; + } + + // Get current language from localStorage or default to English + let currentLang = localStorage.getItem("lang") || "en"; + console.log("Current language from storage:", currentLang); + + // Set initial state + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + + if (currentLang === "hi") { + setTimeout(() => translateToHindi(), 100); + } + + // Remove any existing click handlers + langToggle.onclick = null; + + // Add click handler for language toggle + langToggle.addEventListener("click", function (e) { + e.preventDefault(); + console.log( + "Fallback translation - Language toggle clicked! Current lang:", + currentLang + ); + + // Toggle language + currentLang = currentLang === "en" ? "hi" : "en"; + console.log("Switching to language:", currentLang); + + // Apply translation + if (currentLang === "hi") { + translateToHindi(); + } else { + translateToEnglish(); + } + + // Update button text + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + console.log("Button text updated to:", langToggle.textContent); + + // Save to localStorage + localStorage.setItem("lang", currentLang); + console.log("Language saved to localStorage:", currentLang); + }); + + console.log("Fallback translation system initialized successfully"); +} + +function waitForGoogleTranslate(callback, maxAttempts = 20) { + let attempts = 0; + console.log("Waiting for Google Translate dropdown..."); + + const checkInterval = setInterval(() => { + const select = document.querySelector(".goog-te-combo"); + attempts++; + console.log(`Attempt ${attempts}: Looking for .goog-te-combo`); + + if (select) { + clearInterval(checkInterval); + console.log("Google Translate dropdown found!"); + callback(select); + } else if (attempts >= maxAttempts) { + clearInterval(checkInterval); + console.error("Google Translate failed to load, using fallback system"); + initializeFallbackTranslation(); + } + }, 500); +} + +function initializeLanguageToggle() { + console.log("Initializing language toggle..."); + + waitForGoogleTranslate((select) => { + console.log( + "Google Translate loaded successfully, select element:", + select + ); + + const langToggle = document.getElementById("lang-toggle"); + if (!langToggle) { + console.error("Language toggle button not found"); + return; + } + + console.log("Language toggle button found:", langToggle); + + // Get current language from localStorage or default to English + let currentLang = localStorage.getItem("lang") || "en"; + console.log("Current language from storage:", currentLang); + + // Set initial language + select.value = currentLang; + select.dispatchEvent(new Event("change")); + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + + console.log("Initial language set, button text:", langToggle.textContent); + + // Remove any existing click handlers + langToggle.onclick = null; + + // Add click handler for language toggle + langToggle.addEventListener("click", function (e) { + e.preventDefault(); + console.log( + "Google Translate - Language toggle clicked! Current lang:", + currentLang + ); + + // Toggle language + currentLang = currentLang === "en" ? "hi" : "en"; + console.log("Switching to language:", currentLang); + + // Update Google Translate + console.log("Setting dropdown value to:", currentLang); + select.value = currentLang; + select.dispatchEvent(new Event("change")); + + // Update button text + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + console.log("Button text updated to:", langToggle.textContent); + + // Save to localStorage + localStorage.setItem("lang", currentLang); + console.log("Language saved to localStorage:", currentLang); + }); + + console.log("Google Translate language toggle initialized successfully"); + }); +} + +// Load Google Translate script with error handling +function loadGoogleTranslateScript() { + if (document.querySelector('script[src*="translate.google.com"]')) { + console.log("Google Translate script already loaded"); + return; + } + + console.log("Loading Google Translate script..."); + const translateScript = document.createElement("script"); + translateScript.src = + "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; + + translateScript.onload = function () { + console.log("Google Translate script loaded successfully"); + }; + + translateScript.onerror = function () { + console.error("Failed to load Google Translate script - using fallback"); + setTimeout(initializeFallbackTranslation, 1000); + }; + + document.head.appendChild(translateScript); + + // Timeout fallback in case Google Translate doesn't respond + setTimeout(() => { + const select = document.querySelector(".goog-te-combo"); + if (!select) { + console.log("Google Translate timeout - switching to fallback"); + initializeFallbackTranslation(); + } + }, 5000); +} + +// Initialize when DOM is ready +document.addEventListener("DOMContentLoaded", function () { + console.log("DOM loaded, initializing translation..."); + + // Check if we have internet connection + if (navigator.onLine) { + console.log("Internet connection detected, trying Google Translate"); + loadGoogleTranslateScript(); + + // Give time for the script to load before initializing + setTimeout(() => { + console.log("Starting language toggle initialization..."); + initializeLanguageToggle(); + }, 2000); + } else { + console.log("No internet connection, using fallback translation"); + setTimeout(initializeFallbackTranslation, 1000); + } +}); + +// Fallback initialization +window.addEventListener("load", function () { + console.log("Window load event triggered"); + setTimeout(() => { + const langToggle = document.getElementById("lang-toggle"); + if ( + langToggle && + !langToggle.onclick && + !langToggle.getAttribute("data-initialized") + ) { + console.log("Final fallback initialization triggered"); + initializeFallbackTranslation(); + langToggle.setAttribute("data-initialized", "true"); + } + }, 3000); +}); diff --git a/language.js b/language.js index a5845ae2..cf738a47 100644 --- a/language.js +++ b/language.js @@ -1,54 +1,184 @@ // Prevent Google from using its cookies/auto-detect -var gtCookie = document.cookie.split(';').filter(c => c.includes('googtrans')); +var gtCookie = document.cookie + .split(";") + .filter((c) => c.includes("googtrans")); if (gtCookie.length) { - document.cookie = 'googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; + document.cookie = + "googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; } function googleTranslateElementInit() { - new google.translate.TranslateElement({ - pageLanguage: 'en', // force English - includedLanguages: 'en,hi', // only allow English and Hindi - autoDisplay: false - }, 'google_translate_element'); + console.log("googleTranslateElementInit called"); + try { + new google.translate.TranslateElement( + { + pageLanguage: "en", + includedLanguages: "en,hi", + autoDisplay: false, + layout: google.translate.TranslateElement.InlineLayout.SIMPLE, + }, + "google_translate_element" + ); + console.log("Google Translate element created successfully"); + } catch (error) { + console.error("Error creating Google Translate element:", error); + } } -document.addEventListener("DOMContentLoaded", function () { - let currentLang = localStorage.getItem("lang") || 'en'; // default English - - const checkDropdown = setInterval(() => { - const select = document.querySelector(".goog-te-combo"); - if (select) { - clearInterval(checkDropdown); - - // Force English first if first visit - if (!localStorage.getItem("lang")) { - currentLang = 'en'; - localStorage.setItem("lang", currentLang); - } - - // Force dropdown to English or Hindi only - select.value = currentLang; - select.dispatchEvent(new Event("change")); - - const langToggle = document.getElementById("lang-toggle"); - if (langToggle) { - langToggle.textContent = currentLang === 'en' ? "हिंदी" : "English"; - - langToggle.onclick = () => { - currentLang = currentLang === 'en' ? 'hi' : 'en'; - select.value = currentLang; - select.dispatchEvent(new Event("change")); - langToggle.textContent = currentLang === 'en' ? "हिंदी" : "English"; - localStorage.setItem("lang", currentLang); - }; - } +function waitForGoogleTranslate(callback, maxAttempts = 30) { + let attempts = 0; + console.log("Waiting for Google Translate dropdown..."); + + const checkInterval = setInterval(() => { + const select = document.querySelector(".goog-te-combo"); + attempts++; + console.log(`Attempt ${attempts}: Looking for .goog-te-combo`); + + if (select) { + clearInterval(checkInterval); + console.log("Google Translate dropdown found!"); + callback(select); + } else if (attempts >= maxAttempts) { + clearInterval(checkInterval); + console.error( + "Google Translate failed to load after", + maxAttempts, + "attempts" + ); + // Try alternative selectors + const altSelect = + document.querySelector("select.goog-te-combo") || + document.querySelector("[name='google_translate_element']") || + document.querySelector(".goog-te-gadget select"); + if (altSelect) { + console.log("Found alternative Google Translate selector"); + callback(altSelect); + } else { + console.error("No Google Translate dropdown found at all"); + } + } + }, 500); +} + +function initializeLanguageToggle() { + console.log("Initializing language toggle..."); + + waitForGoogleTranslate((select) => { + console.log( + "Google Translate loaded successfully, select element:", + select + ); + + const langToggle = document.getElementById("lang-toggle"); + if (!langToggle) { + console.error("Language toggle button not found"); + return; + } + + console.log("Language toggle button found:", langToggle); + + // Get current language from localStorage or default to English + let currentLang = localStorage.getItem("lang") || "en"; + console.log("Current language from storage:", currentLang); + + // Set initial language + select.value = currentLang; + select.dispatchEvent(new Event("change")); + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + + console.log("Initial language set, button text:", langToggle.textContent); + + // Remove any existing click handlers + langToggle.onclick = null; + + // Add click handler for language toggle + langToggle.addEventListener("click", function (e) { + e.preventDefault(); + console.log("Language toggle clicked! Current lang:", currentLang); + + // Toggle language + currentLang = currentLang === "en" ? "hi" : "en"; + console.log("Switching to language:", currentLang); + + // Update Google Translate + console.log("Setting dropdown value to:", currentLang); + select.value = currentLang; + select.dispatchEvent(new Event("change")); + + // Update button text + langToggle.textContent = currentLang === "en" ? "हिंदी" : "English"; + console.log("Button text updated to:", langToggle.textContent); + + // Save to localStorage + localStorage.setItem("lang", currentLang); + console.log("Language saved to localStorage:", currentLang); + + // Force page translation + setTimeout(() => { + console.log("Forcing translation after timeout"); + if (window.google && window.google.translate) { + console.log("Google Translate API available"); + } else { + console.error("Google Translate API not available"); } - }, 200); -}); + }, 100); + }); + + console.log("Language toggle initialized successfully"); + }); +} + +// Load Google Translate script only once +function loadGoogleTranslateScript() { + if (document.querySelector('script[src*="translate.google.com"]')) { + console.log("Google Translate script already loaded"); + return; + } -// Load Google Translate script once -if (!document.querySelector('script[src*="translate.google.com"]')) { - const translateScript = document.createElement('script'); - translateScript.src = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; - document.body.appendChild(translateScript); + console.log("Loading Google Translate script..."); + const translateScript = document.createElement("script"); + // Use https instead of // for localhost compatibility + translateScript.src = + "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; + translateScript.onload = function () { + console.log("Google Translate script loaded successfully"); + }; + translateScript.onerror = function () { + console.error( + "Failed to load Google Translate script - possible network issue" + ); + }; + document.head.appendChild(translateScript); } + +// Initialize when DOM is ready +document.addEventListener("DOMContentLoaded", function () { + console.log("DOM loaded, initializing translation..."); + + // Check if we have internet connection + if (navigator.onLine) { + console.log("Internet connection detected"); + loadGoogleTranslateScript(); + + // Give more time for the script to load before initializing + setTimeout(() => { + console.log("Starting language toggle initialization..."); + initializeLanguageToggle(); + }, 2000); + } else { + console.error("No internet connection detected"); + } +}); + +// Fallback initialization +window.addEventListener("load", function () { + console.log("Window load event triggered"); + // Check if translation is already working + setTimeout(() => { + const langToggle = document.getElementById("lang-toggle"); + if (langToggle && !langToggle.onclick) { + console.log("Fallback initialization triggered"); + initializeLanguageToggle(); + } + }, 3000); +}); diff --git a/pages/cgpa-calculator.html b/pages/cgpa-calculator.html index 6328d68d..3b16c3ea 100644 --- a/pages/cgpa-calculator.html +++ b/pages/cgpa-calculator.html @@ -1,389 +1,546 @@ - + - - - - - + + + Infrastructure - Nitra Mitra - + - - - - - - - + rel="stylesheet" + href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" + /> + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + rel="stylesheet" + href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" + /> + + - - - - - - -