-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,779 additions
and
1,264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
examples/svelte-with-runtime-rendering/src/routes/about/+page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { dev } from '$app/environment' | ||
import { dev } from '$app/environment'; | ||
|
||
// we don't need any JS on this page, though we'll load | ||
// it in dev so that we get hot module replacement | ||
export const csr = dev | ||
export const csr = dev; | ||
|
||
// since there's no dynamic data here, we can prerender | ||
// it so that it gets served as a static asset in production | ||
export const prerender = true | ||
export const prerender = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
examples/svelte-with-runtime-rendering/src/routes/sverdle/reduced-motion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { readable } from 'svelte/store'; | ||
import { browser } from '$app/environment'; | ||
|
||
const reduced_motion_query = '(prefers-reduced-motion: reduce)'; | ||
const reducedMotionQuery = '(prefers-reduced-motion: reduce)'; | ||
|
||
const get_initial_motion_preference = () => { | ||
const getInitialMotionPreference = () => { | ||
if (!browser) return false; | ||
return window.matchMedia(reduced_motion_query).matches; | ||
return window.matchMedia(reducedMotionQuery).matches; | ||
}; | ||
|
||
export const reduced_motion = readable(get_initial_motion_preference(), (set) => { | ||
export const reducedMotion = readable(getInitialMotionPreference(), (set) => { | ||
if (browser) { | ||
const set_reduced_motion = (event: MediaQueryListEvent) => { | ||
const setReducedMotion = (event: MediaQueryListEvent) => { | ||
set(event.matches); | ||
}; | ||
const media_query_list = window.matchMedia(reduced_motion_query); | ||
media_query_list.addEventListener('change', set_reduced_motion); | ||
const mediaQueryList = window.matchMedia(reducedMotionQuery); | ||
mediaQueryList.addEventListener('change', setReducedMotion); | ||
|
||
return () => { | ||
media_query_list.removeEventListener('change', set_reduced_motion); | ||
mediaQueryList.removeEventListener('change', setReducedMotion); | ||
}; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<script> | ||
import Counter from './Counter.svelte'; | ||
import welcome from '$lib/images/svelte-welcome.webp'; | ||
import welcome_fallback from '$lib/images/svelte-welcome.png'; | ||
import Counter from "./Counter.svelte"; | ||
import welcome from "$lib/images/svelte-welcome.webp"; | ||
import welcome_fallback from "$lib/images/svelte-welcome.png"; | ||
</script> | ||
|
||
<svelte:head> | ||
|
@@ -17,7 +17,13 @@ | |
<img src={welcome_fallback} alt="Welcome" /> | ||
</picture> | ||
</span> | ||
<img src="/[email protected]" alt="Master Logo" class="mt:-2vw block mx:auto max-w:50%" width="300" height="35" /> | ||
<img | ||
src="/[email protected]" | ||
alt="Master Logo" | ||
class="mt:-2vw block mx:auto max-w:50%" | ||
width="300" | ||
height="35" | ||
/> | ||
<span class="sr-only">Svelte Kit and Master CSS</span> | ||
</h1> | ||
|
||
|
@@ -29,31 +35,31 @@ | |
</section> | ||
|
||
<style> | ||
section { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
flex: 0.6; | ||
} | ||
h1 { | ||
width: 100%; | ||
} | ||
.welcome { | ||
display: block; | ||
position: relative; | ||
width: 100%; | ||
height: 0; | ||
padding: 0 0 calc(100% * 495 / 2048) 0; | ||
} | ||
.welcome img { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
display: block; | ||
} | ||
section { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
flex: 0.6; | ||
} | ||
h1 { | ||
width: 100%; | ||
} | ||
.welcome { | ||
display: block; | ||
position: relative; | ||
width: 100%; | ||
height: 0; | ||
padding: 0 0 calc(100% * 495 / 2048) 0; | ||
} | ||
.welcome img { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
display: block; | ||
} | ||
</style> |
Oops, something went wrong.