feat(store-header): enhance immersive header with compact mode and dynamic background

This commit is contained in:
2026-09-21 11:18:24 -03:00
parent f6ff91ff3b
commit c876b2b171
3 changed files with 34 additions and 6 deletions

View File

@@ -149,14 +149,16 @@
.immersive-header--compact {
min-height: 0;
padding-bottom: 1.5rem;
background: #171717;
color: #666666;
background: transparent;
}
.immersive-header--compact .immersive-header__backdrop {
position: absolute;
inset: 0;
display: none;
}
.immersive-header--compact .immersive-header__backdrop::after {
background: rgba(0, 0, 0, 0.65);
:host ::ng-deep .immersive-header--compact .immersive-header__actions .icon-btn,
:host ::ng-deep .immersive-header--compact .immersive-header__actions .cart-icon {
color: #666666;
}
@media (max-width: 600px) {

View File

@@ -2,6 +2,17 @@
display: block;
}
:host(.immersive-shell--compact) {
background-color: #f5f5f5;
background-position: center 42%;
background-size: cover;
}
:host(.immersive-shell--compact) .immersive-categories {
border-top: 1px solid rgba(255, 255, 255, 0.6);
background: transparent;
}
.immersive-categories {
width: 100%;
overflow-x: auto;

View File

@@ -1,5 +1,5 @@
import { NgTemplateOutlet, UpperCasePipe } from '@angular/common';
import { Component, input, output } from '@angular/core';
import { Component, computed, input, output } from '@angular/core';
import { AuthUser } from '../../../services/auth/auth.interfaces';
import { Category, Menu, WebsiteExtras } from '../../../services/tenant.interface';
import { ImmersiveStoreHeaderComponent } from './immersive-store-header.component';
@@ -12,6 +12,10 @@ export type StoreHeaderType = 'standard' | 'immersive';
imports: [NgTemplateOutlet, UpperCasePipe, StandardStoreHeaderComponent, ImmersiveStoreHeaderComponent],
templateUrl: './store-header.component.html',
styleUrl: './store-header.component.scss',
host: {
'[class.immersive-shell--compact]': 'isCompactImmersive()',
'[style.background-image]': 'compactBackground()',
},
})
export class StoreHeaderComponent {
readonly headerType = input<StoreHeaderType>('standard');
@@ -20,6 +24,17 @@ export class StoreHeaderComponent {
readonly heroContent = input<WebsiteExtras['immersiveHero']>(undefined);
readonly carouselImages = input<readonly string[]>([]);
readonly showHero = input(true);
protected readonly isCompactImmersive = computed(
() => this.headerType() === 'immersive' && !this.showHero(),
);
protected readonly compactBackground = computed(() => {
if (!this.isCompactImmersive()) return null;
const gradient =
'linear-gradient(180deg, rgba(245, 245, 245, 0.72) 0%, rgba(245, 245, 245, 0.88) 58%, #f5f5f5 100%)';
const image = this.backgroundImageUrl();
return image ? `${gradient}, url(${JSON.stringify(image)})` : gradient;
});
readonly cartQuantity = input<number>(0);
readonly user = input<AuthUser | null>(null);
readonly isAuthenticated = input<boolean>(false);