mirror of
https://github.com/ivabus/gui
synced 2025-06-08 00:00:27 +03:00
Merge pull request #102 from teaxyz/scroll-up-on-change-route
#90 scroll up on change route
This commit is contained in:
commit
f063c576cb
2 changed files with 286 additions and 408 deletions
|
@ -1,22 +1,27 @@
|
||||||
<!-- home / discover / welcome page -->
|
<!-- home / discover / welcome page -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '$appcss';
|
import '$appcss';
|
||||||
|
import { navigating } from '$app/stores';
|
||||||
import NavBar from '$components/NavBar/NavBar.svelte';
|
import NavBar from '$components/NavBar/NavBar.svelte';
|
||||||
import FooterLinks from '$components/FooterLinks/FooterLinks.svelte';
|
import FooterLinks from '$components/FooterLinks/FooterLinks.svelte';
|
||||||
|
|
||||||
import { backLink as backLinkStore } from '$libs/stores';
|
import { backLink as backLinkStore } from '$libs/stores';
|
||||||
|
|
||||||
|
let view: HTMLElement;
|
||||||
|
|
||||||
let backLink = '';
|
let backLink = '';
|
||||||
backLinkStore.subscribe((v) => {
|
backLinkStore.subscribe((v) => {
|
||||||
backLink = v;
|
backLink = v;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$: if ($navigating) view.scrollTop = 0;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="main-layout">
|
<div id="main-layout">
|
||||||
<nav class="border border-t-0 border-l-0 border-b-0 border-gray">
|
<nav class="border border-t-0 border-l-0 border-b-0 border-gray">
|
||||||
<NavBar />
|
<NavBar />
|
||||||
</nav>
|
</nav>
|
||||||
<section class="pt-24">
|
<section class="pt-24" bind:this={view}>
|
||||||
{#if backLink}
|
{#if backLink}
|
||||||
<header class="border-b border-gray px-16 text-3xl text-gray hover:text-primary">
|
<header class="border-b border-gray px-16 text-3xl text-gray hover:text-primary">
|
||||||
<a href={backLink}>←</a>
|
<a href={backLink}>←</a>
|
||||||
|
|
687
pnpm-lock.yaml
687
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue