Skip to content

fix: Add theme toggle button and dynamic copyright year to contact page (#1414, #1415)#1426

Open
1234-ad wants to merge 3 commits into
apu52:mainfrom
1234-ad:fix/theme-toggle-and-copyright
Open

fix: Add theme toggle button and dynamic copyright year to contact page (#1414, #1415)#1426
1234-ad wants to merge 3 commits into
apu52:mainfrom
1234-ad:fix/theme-toggle-and-copyright

Conversation

@1234-ad

@1234-ad 1234-ad commented Jan 8, 2026

Copy link
Copy Markdown

Description

This PR fixes two bugs reported in issues #1414 and #1415:

Issue #1414: Theme Toggle Button Missing on Contact Page

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

Solution:

  • Added missing themeToggle.css stylesheet link
  • Replaced old theme toggle code with proper implementation matching index.html
  • Positioned theme toggle button consistently with other pages

Issue #1415: Hardcoded Copyright Year (2024)

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

Solution:

  • Created assets/js/copyright-year.js - a dynamic script that automatically updates copyright year
  • Script detects all elements with class .copyright and replaces any 4-digit year with current year
  • Runs on page load, ensuring copyright is always current

Changes Made

Files Modified:

  1. contact.html
    • Added <link rel="stylesheet" href="./assets/css/themeToggle.css"> in head
    • Replaced old theme toggle with proper container structure
    • Added <script src="./assets/js/copyright-year.js"></script> before closing body tag
    • Removed duplicate/conflicting theme toggle code

Files Created:

  1. assets/js/copyright-year.js

    • Automatically updates copyright year to current year
    • Works across all pages with .copyright class
    • Logs confirmation to console
  2. FIXES_APPLIED.md

    • Comprehensive documentation of all fixes applied
    • Testing recommendations
    • Implementation details

Benefits

βœ… Users can now switch between light/dark themes on contact page
βœ… Copyright year automatically updates without manual intervention
βœ… Consistent design and functionality across all pages
βœ… Future-proof solution requiring no annual updates
βœ… Improved accessibility and user experience

Testing

  • Theme toggle button appears on contact page
  • Theme toggle switches between light and dark modes
  • Copyright year displays dynamically
  • No console errors
  • Responsive design maintained

Screenshots

The theme toggle button now appears in the heading section of the contact page, matching the implementation on index.html and other pages.

Related Issues

Closes #1414
Closes #1415


Note: The copyright-year.js script can be added to other pages (index.html, about.html, etc.) to ensure consistent dynamic copyright across the entire site.

- Automatically updates copyright year to current year
- Works across all pages with .copyright class
- Replaces hardcoded years with dynamic year
- Logs update confirmation to console
- Fixes issue apu52#1415

This script ensures the copyright year is always current without manual updates.
Fixes apu52#1414 - Theme toggle button missing on contact page
Fixes apu52#1415 - Hardcoded copyright year

Changes:
- Added themeToggle.css stylesheet link in head section
- Replaced old theme toggle with proper implementation matching index.html
- Added proper theme toggle button in heading1 container
- Removed duplicate/conflicting theme toggle code
- Added copyright-year.js script to dynamically update copyright year
- Copyright year will now automatically update to current year

The contact page now has consistent theme toggle functionality with other pages
and the copyright year will always display the current year without manual updates.
@netlify

netlify Bot commented Jan 8, 2026

Copy link
Copy Markdown

βœ… Deploy Preview for cute-quokka-b093d8 ready!

Name Link
πŸ”¨ Latest commit 0208423
πŸ” Latest deploy log https://app.netlify.com/projects/cute-quokka-b093d8/deploys/695fda68d71de60008b8d98e
😎 Deploy Preview https://deploy-preview-1426--cute-quokka-b093d8.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for submitting your pull request! πŸ™Œ We'll review it as soon as possible. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dynamic Copyright Year in Footer Major README Revamp for SWoC'26 - Improved Project Discovery & Visual Hierarchy

1 participant