Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions FIXES_APPLIED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Fixes Applied

## Issue #1414: Theme Toggle Button Missing on Contact Page
**Status:** Fixed ✅

### Problem
The contact.html page had an old, non-functional theme toggle implementation that didn't match the working implementation on other pages like index.html.

### Solution
1. Added missing `themeToggle.css` stylesheet link in the `<head>` section
2. Replaced the old theme toggle code with the proper implementation matching index.html
3. Positioned the theme toggle button consistently with other pages

### Changes Made to contact.html:
- **Line 33**: Added `<link rel="stylesheet" href="./assets/css/themeToggle.css">` after contributors.css
- **Lines 417-424**: Replaced old theme toggle implementation with proper container structure:
```html
<div class="container">
<label class="switch">
<input type="checkbox" id="theme-toggle">
<span class="slider"></span>
</label>
</div>
```
- Removed duplicate/conflicting theme toggle code at line 442

---

## Issue #1415: Hardcoded Copyright Year (2024)
**Status:** Fixed ✅

### Problem
The footer displayed "© 2024 METAVERSE" with a hardcoded year that would become outdated.

### Solution
Created a dynamic JavaScript solution that automatically updates the copyright year to the current year across all pages.

### Files Created:
1. **assets/js/copyright-year.js** - New script that:
- Automatically detects all elements with class `.copyright`
- Replaces any 4-digit year with the current year
- Runs on page load via DOMContentLoaded event
- Logs confirmation to console

### Changes Made to contact.html:
- **Line 738**: Added `<script src="./assets/js/copyright-year.js"></script>` before closing `</body>` tag
- The existing copyright text `<p class="copyright">© 2024 METAVERSE</p>` at line 717 will now be automatically updated to current year

### How It Works:
```javascript
// On page load, the script finds all .copyright elements
const copyrightElements = document.querySelectorAll('.copyright');
const currentYear = new Date().getFullYear();

// Updates "© 2024 METAVERSE" to "© 2026 METAVERSE" (or whatever current year is)
copyrightElements.forEach(element => {
const text = element.textContent;
const updatedText = text.replace(/\d{4}/, currentYear);
element.textContent = updatedText;
});
```

---

## Benefits
1. **Theme Toggle**: Users can now switch between light/dark themes on the contact page, improving accessibility and user experience
2. **Dynamic Copyright**: The copyright year will always be current without manual updates, maintaining professional appearance
3. **Consistency**: Contact page now matches the design and functionality of other pages
4. **Maintainability**: Future-proof solution that requires no annual updates

---

## Testing Recommendations
1. Visit contact.html and verify theme toggle button appears and functions
2. Check that clicking the toggle switches between light and dark themes
3. Verify copyright year displays current year (2026)
4. Test on mobile devices to ensure responsive behavior
5. Check browser console for "Copyright year updated to 2026" message

---

## Related Issues
- Fixes #1414
- Fixes #1415
26 changes: 26 additions & 0 deletions assets/js/copyright-year.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Dynamic Copyright Year Updater
// Automatically updates copyright year to current year across all pages

document.addEventListener('DOMContentLoaded', () => {
// Get all elements with class 'copyright'
const copyrightElements = document.querySelectorAll('.copyright');

// Get current year
const currentYear = new Date().getFullYear();

// Update each copyright element
copyrightElements.forEach(element => {
// Replace any year (4 digits) with current year
const text = element.textContent || element.innerText;
const updatedText = text.replace(/\d{4}/, currentYear);
element.textContent = updatedText;
});

// Also handle copyright elements with specific IDs
const copyrightById = document.getElementById('copyright-year');
if (copyrightById) {
copyrightById.textContent = currentYear;
}

console.log(`Copyright year updated to ${currentYear}`);
});
Loading