Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Refractor and Header Bug Fix #1

Merged
merged 5 commits into from
Mar 20, 2025
Merged

Conversation

CyberSphinxxx
Copy link
Contributor

Pull Request: Simplify File Structure and Fix Header Scroll

Description

This PR organizes the Findly project files into a cleaner structure and fixes the header scroll effect (transparent to white background) on login.html and register.html.

Changes

  1. Refactored File Structure:

    • Moved files into src/ with subfolders:
      findly/
      ├── src/
      │   ├── assets/     # Images (logo.png, USTP.jpg)
      │   ├── css/        # CSS files (styles.css, auth.css)
      │   ├── html/       # HTML pages (login.html, register.html)
      │   ├── js/         # JS files (script.js, auth.js)
      │   └── index.html  # Homepage
      └── README.md
      
    • Updated file paths in all HTML files:
      • index.html: <link rel="stylesheet" href="css/styles.css">, <script src="js/script.js">, <img src="assets/logo.png">
      • login.html and register.html: <link rel="stylesheet" href="../css/styles.css">, <script src="../js/script.js">
  2. Fixed Header Scroll Effect:

    • Issue: Header scroll effect didn’t work on login.html and register.html due to JavaScript timing.
    • Fix: Updated script.js to run the scroll listener immediately and on DOMContentLoaded.
    • Updated script.js snippet:
      function initHeaderScroll() {
          const header = document.querySelector('header');
          if (!header) return;
          window.addEventListener('scroll', function() {
              if (window.scrollY > 50) {
                  header.classList.add('scrolled');
              } else {
                  header.classList.remove('scrolled');
              }
          });
      }
      initHeaderScroll();
      document.addEventListener('DOMContentLoaded', initHeaderScroll);
  3. Updated README:

    • Adjusted the project structure and paths in README.md to match the new layout.

Testing

  • Header scroll effect works on all pages (index.html, login.html, register.html).
  • All assets (CSS, JS, images) load correctly.
  • Other features (item listing, forms, mobile menu) are unaffected.

@Cejj28
Copy link
Owner

Cejj28 commented Mar 20, 2025

WOWWW, SO NICE!! THANK YOU SO MUCH!

@Cejj28 Cejj28 merged commit bd5e9b9 into Cejj28:master Mar 20, 2025
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.

2 participants