|
2 | 2 | import TmdbCard from '$lib/components/Card/TmdbCard.svelte';
|
3 | 3 | import CardGrid from '$lib/components/CardGrid.svelte';
|
4 | 4 | import Container from '$lib/components/Container.svelte';
|
| 5 | + import FloatingHeader from '$lib/components/FloatingHeader.svelte'; |
5 | 6 | import { createBackgroundPage } from '$lib/components/GlobalBackground/BackgroundStack';
|
6 |
| - import type { StackRouterPageProps } from '$lib/components/StackRouter/StackRouterPage.type'; |
| 7 | + import { getStackRouterControls } from '$lib/components/StackRouter/StackRouter'; |
7 | 8 | import { scrollIntoView } from '$lib/selectable';
|
8 | 9 | import { setScrollContext } from '$lib/stores/scroll.store';
|
9 | 10 | import classNames from 'classnames';
|
|
12 | 13 | export let title: string;
|
13 | 14 | export let subtitle = '';
|
14 | 15 | export let items: Promise<ComponentProps<TmdbCard>['item'][]>;
|
15 |
| - export let registrar: StackRouterPageProps['registrar']; |
16 |
| - export let handleGoBack: StackRouterPageProps['handleGoBack']; |
| 16 | + const { registrar } = getStackRouterControls(); |
17 | 17 |
|
18 | 18 | const background = createBackgroundPage();
|
19 | 19 | const { registrar: registerScroll, topVisible } = setScrollContext();
|
20 |
| - console.log($topVisible); |
21 | 20 | </script>
|
22 | 21 |
|
23 |
| -<Container |
24 |
| - on:back={handleGoBack} |
25 |
| - class="py-16 *:px-32 flex flex-col h-screen overflow-y-auto overflow-x-hidden" |
26 |
| -> |
| 22 | +<Container class="py-16 *:px-32 flex flex-col h-screen overflow-y-auto overflow-x-hidden"> |
27 | 23 | <slot name="header">
|
28 | 24 | <div class="pt-8">
|
29 | 25 | <h2 class="uppercase text-zinc-300 font-semibold tracking-wider">{subtitle}</h2>
|
|
39 | 35 | </slot>
|
40 | 36 |
|
41 | 37 | <slot name="header-compact">
|
42 |
| - <div |
43 |
| - class={classNames( |
44 |
| - 'py-6 absolute top-0 inset-x-0 z-10 bg-gradient-to-b from-100% from-secondary-900 to-transparent transition-all', |
45 |
| - { |
46 |
| - 'opacity-0 pointer-events-none -translate-y-4': $topVisible |
47 |
| - } |
48 |
| - )} |
49 |
| - > |
| 38 | + <FloatingHeader visible={$topVisible}> |
50 | 39 | <h2 class="uppercase text-zinc-300 font-semibold tracking-wider">{subtitle}</h2>
|
51 | 40 | <h1
|
52 | 41 | class={classNames('text-left font-semibold tracking-wider text-stone-200 mt-1', {
|
|
56 | 45 | >
|
57 | 46 | {title}
|
58 | 47 | </h1>
|
59 |
| - </div> |
| 48 | + </FloatingHeader> |
60 | 49 | </slot>
|
61 | 50 |
|
62 | 51 | <div class="pt-16" use:registerScroll>
|
|
0 commit comments