Use sveltekit:noscroll/prefetch on internal links
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
export let url: string
|
||||
</script>
|
||||
|
||||
<a href={url} class="box-cta">
|
||||
<a href={url} class="box-cta"
|
||||
sveltekit:noscroll sveltekit:prefetch={url.includes('http') ? true : undefined}
|
||||
>
|
||||
<div class="icon">
|
||||
<Icon icon={icon} label={alt} />
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<div class="newsletter-form__bottom">
|
||||
{#if past}
|
||||
<a href="/subscribe" class="past-issues">
|
||||
<a href="/subscribe" class="past-issues" sveltekit:noscroll sveltekit:prefetch>
|
||||
<svg width="20" height="16" viewBox="0 0 20 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-label="Newsletter icon">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 2.346H2a.5.5 0 0 0-.5.5v11.102a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V2.846a.5.5 0 0 0-.5-.5ZM2 .846a2 2 0 0 0-2 2v11.102a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2.846a2 2 0 0 0-2-2H2Zm13.75 4.25h-2v3h2v-3Zm-2-1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2ZM3.5 6.5a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Zm.25 3a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5Zm1.25 2a.5.5 0 0 0 0 1h6a.5.5 0 1 0 0-1H5Z" />
|
||||
</svg>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<a href="/{location.country.slug}/{location.slug}"
|
||||
on:mousemove={handleMouseMove}
|
||||
on:mouseleave={handleMouseLeave}
|
||||
sveltekit-noscroll
|
||||
sveltekit:noscroll
|
||||
>
|
||||
<Image
|
||||
class="location__flag"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<div class="poster">
|
||||
{#if image}
|
||||
<a href="/shop/poster-{location.slug}">
|
||||
<a href="/shop/poster-{location.slug}" sveltekit:noscroll sveltekit:prefetch>
|
||||
<Image
|
||||
id={image.id}
|
||||
sizeKey="product"
|
||||
|
||||
@@ -58,7 +58,9 @@
|
||||
<ul>
|
||||
{#each links as { icon, iconLabel, url, text }}
|
||||
<li>
|
||||
<a href={url} on:click={toggleSwitcher} sveltekit:prefetch>
|
||||
<a href={url} on:click={toggleSwitcher}
|
||||
sveltekit:noscroll sveltekit:prefetch
|
||||
>
|
||||
<Icon class="icon" icon={icon} label={iconLabel} />
|
||||
<span>{text}</span>
|
||||
</a>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container grid">
|
||||
<a href="/" class="footer__title" sveltekit:prefetch>
|
||||
<a href="/" class="footer__title" sveltekit:prefetch sveltekit:noscroll>
|
||||
<SiteTitle tag="div" />
|
||||
</a>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ul>
|
||||
{#each footer_links as { title, slug }}
|
||||
<li>
|
||||
<a href="/{slug}" class="link-3d" sveltekit:prefetch>
|
||||
<a href="/{slug}" class="link-3d" sveltekit:prefetch sveltekit:noscroll>
|
||||
<SplitText text={title} clone={true} />
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<h1 class="title-medium">{currentPhoto.title}</h1>
|
||||
|
||||
<div class="detail text-info">
|
||||
<a href="/{location.country.slug}/{location.slug}">
|
||||
<a href="/{location.country.slug}/{location.slug}" sveltekit:prefetch sveltekit:noscroll>
|
||||
<Icon class="icon" icon="map-pin" label="Map pin" />
|
||||
<span>
|
||||
{#if currentPhoto.city}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<ul>
|
||||
{#each location as { location_id: { name, slug: slugLocation, country: { slug: slugCountry }}}, index}
|
||||
<li>
|
||||
<a href="/{slugCountry}/{slugLocation}">{name}</a>
|
||||
<a href="/{slugCountry}/{slugLocation}" sveltekit:noscroll>{name}</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
<div class="photos__grid">
|
||||
{#each photos as { image, slug, location, title, city }, index}
|
||||
<figure class="photo shadow-photo">
|
||||
<a href="/{location.country.slug}/{location.slug}/{slug}">
|
||||
<a href="/{location.country.slug}/{location.slug}/{slug}" sveltekit:prefetch sveltekit:noscroll>
|
||||
<Image
|
||||
id={image.id}
|
||||
sizeKey="photo-grid"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
<section class="shop-page__intro" bind:this={introEl}>
|
||||
<div class="top container">
|
||||
<a href="/" class="back">
|
||||
<a href="/" class="back" sveltekit:noscroll>
|
||||
<svg width="5" height="8" viewBox="0 0 5 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4 1 1 4l3 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
@@ -83,7 +83,7 @@
|
||||
<ul>
|
||||
{#each $shopLocations as { name, slug }}
|
||||
<li class:is-active={slug === product.location.slug}>
|
||||
<a href="/shop/poster-{slug}" sveltekit:noscroll sveltekit:prefetch>
|
||||
<a href="/shop/poster-{slug}" sveltekit:prefetch sveltekit:noscroll>
|
||||
{name}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user