Skip to content

feat(header): add glass effect on scroll - #7

Merged
kamycoding merged 1 commit into
mainfrom
feat/header
Aug 6, 2026
Merged

feat(header): add glass effect on scroll#7
kamycoding merged 1 commit into
mainfrom
feat/header

Conversation

@kamycoding

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 6, 2026 07:14
@kamycoding
kamycoding merged commit 01bdbeb into main Aug 6, 2026
1 check passed
@kamycoding
kamycoding deleted the feat/header branch August 6, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “glass” visual treatment to the site header after the user scrolls, by tracking scroll position in the header component and toggling a CSS modifier class to apply blur/shadow/border styling.

Changes:

  • Added a scroll sentinel + IntersectionObserver logic to track whether the page has been scrolled.
  • Bound a site-header--scrolled modifier class in the template based on a new isScrolled signal.
  • Introduced a dedicated header.css stylesheet and linked it via styleUrl.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/app/layout/header/header.ts Adds scroll state tracking with an IntersectionObserver and cleans it up on destroy.
src/app/layout/header/header.html Adds a scroll sentinel element and toggles a CSS modifier class on the header when scrolled.
src/app/layout/header/header.css Implements the “glass” styling (blur, border, shadow) for the scrolled header state, with reduced-motion handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +174 to +192
private observeScrollPosition(): void {
const view = this.document.defaultView;

if (!view) {
return;
}

this.scrollObserver = new view.IntersectionObserver((entries) => {
const [entry] = entries;

if (!entry) {
return;
}

this.isScrolled.set(!entry.isIntersecting);
});

this.scrollObserver.observe(this.scrollSentinel().nativeElement);
}
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