feat(store-header): enhance immersive header with compact mode and dynamic background
This commit is contained in:
@@ -149,14 +149,16 @@
|
|||||||
.immersive-header--compact {
|
.immersive-header--compact {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
background: #171717;
|
color: #666666;
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
.immersive-header--compact .immersive-header__backdrop {
|
.immersive-header--compact .immersive-header__backdrop {
|
||||||
position: absolute;
|
display: none;
|
||||||
inset: 0;
|
|
||||||
}
|
}
|
||||||
.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) {
|
@media (max-width: 600px) {
|
||||||
|
|||||||
@@ -2,6 +2,17 @@
|
|||||||
display: block;
|
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 {
|
.immersive-categories {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NgTemplateOutlet, UpperCasePipe } from '@angular/common';
|
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 { AuthUser } from '../../../services/auth/auth.interfaces';
|
||||||
import { Category, Menu, WebsiteExtras } from '../../../services/tenant.interface';
|
import { Category, Menu, WebsiteExtras } from '../../../services/tenant.interface';
|
||||||
import { ImmersiveStoreHeaderComponent } from './immersive-store-header.component';
|
import { ImmersiveStoreHeaderComponent } from './immersive-store-header.component';
|
||||||
@@ -12,6 +12,10 @@ export type StoreHeaderType = 'standard' | 'immersive';
|
|||||||
imports: [NgTemplateOutlet, UpperCasePipe, StandardStoreHeaderComponent, ImmersiveStoreHeaderComponent],
|
imports: [NgTemplateOutlet, UpperCasePipe, StandardStoreHeaderComponent, ImmersiveStoreHeaderComponent],
|
||||||
templateUrl: './store-header.component.html',
|
templateUrl: './store-header.component.html',
|
||||||
styleUrl: './store-header.component.scss',
|
styleUrl: './store-header.component.scss',
|
||||||
|
host: {
|
||||||
|
'[class.immersive-shell--compact]': 'isCompactImmersive()',
|
||||||
|
'[style.background-image]': 'compactBackground()',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export class StoreHeaderComponent {
|
export class StoreHeaderComponent {
|
||||||
readonly headerType = input<StoreHeaderType>('standard');
|
readonly headerType = input<StoreHeaderType>('standard');
|
||||||
@@ -20,6 +24,17 @@ export class StoreHeaderComponent {
|
|||||||
readonly heroContent = input<WebsiteExtras['immersiveHero']>(undefined);
|
readonly heroContent = input<WebsiteExtras['immersiveHero']>(undefined);
|
||||||
readonly carouselImages = input<readonly string[]>([]);
|
readonly carouselImages = input<readonly string[]>([]);
|
||||||
readonly showHero = input(true);
|
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 cartQuantity = input<number>(0);
|
||||||
readonly user = input<AuthUser | null>(null);
|
readonly user = input<AuthUser | null>(null);
|
||||||
readonly isAuthenticated = input<boolean>(false);
|
readonly isAuthenticated = input<boolean>(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user