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

style: header opaque on scroll #1297

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
style: header opaque on scroll
  • Loading branch information
peterpeterparker committed Feb 28, 2025
commit ea627f134cd85eccf38d2960fd40f534baceca3b
18 changes: 12 additions & 6 deletions src/frontend/src/lib/components/canister/CanisterWarnings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import type { Snippet } from 'svelte';
import CanisterSyncData from '$lib/components/canister/CanisterSyncData.svelte';
import Warning from '$lib/components/ui/Warning.svelte';
import { onIntersection } from '$lib/directives/intersection.directives';
import { onLayoutTitleIntersection } from '$lib/stores/layout-intersecting.store';
import type { CanisterSyncData as CanisterSyncDataType } from '$lib/types/canister';

interface Props {
Expand All @@ -25,13 +27,17 @@
<CanisterSyncData {canisterId} bind:canister />

{#if cyclesWarning}
<Warning>
{@render cycles?.()}
</Warning>
<div use:onIntersection onjunoIntersecting={onLayoutTitleIntersection}>
<Warning>
{@render cycles?.()}
</Warning>
</div>
{/if}

{#if heapWarning}
<Warning>
{@render heap?.()}
</Warning>
<div use:onIntersection onjunoIntersecting={onLayoutTitleIntersection}>
<Warning>
{@render heap?.()}
</Warning>
</div>
{/if}
4 changes: 4 additions & 0 deletions src/frontend/src/lib/components/ui/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@

padding: var(--padding-2x) var(--padding-2x);

transition: border-bottom-color var(--animation-time);
border-bottom: 1px solid transparent;

@include media.min-width(xlarge) {
padding: calc(var(--padding-4x) - 1px) var(--padding-7x) var(--padding-4x);
}

&.opaque {
background: var(--color-background);
border-bottom: 1px solid var(--color-background-contrast);
}

:global(*) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts">
import IconNewReleases from '$lib/components/icons/IconNewReleases.svelte';
import Html from '$lib/components/ui/Html.svelte';
import { onIntersection } from '$lib/directives/intersection.directives';
import { i18n } from '$lib/stores/i18n.store';
import { onLayoutTitleIntersection } from '$lib/stores/layout-intersecting.store';

interface Props {
text: string;
Expand All @@ -11,7 +13,7 @@
let { text, onclick }: Props = $props();
</script>

<div class="container">
<div class="container" use:onIntersection onjunoIntersecting={onLayoutTitleIntersection}>
<div class="icon"><IconNewReleases /></div>

<div>
Expand Down