-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
46 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script lang="ts"> | ||
import Page from './example/+page.svelte' | ||
import PageSource from './example/+page.svelte?raw' | ||
import Snippet from '../../Snippet.svelte' | ||
</script> | ||
|
||
<h1>Interaction mode</h1> | ||
|
||
<p> | ||
The <code>interactionMode</code> store is used to determine whether the user is | ||
using a mouse or a keyboard. | ||
</p> | ||
|
||
<p> | ||
The interaction mode is updated automatically when the user is interacting | ||
with the page using a mouse, keyboard, or touch screen. | ||
</p> | ||
|
||
<p> | ||
If the user is typing text into an input, the interaction mode will not be | ||
updated. | ||
</p> | ||
|
||
<h2>Example</h2> | ||
|
||
<div> | ||
<Page /> | ||
</div> | ||
|
||
<h2>Source</h2> | ||
|
||
<Snippet code={PageSource} /> |
13 changes: 13 additions & 0 deletions
13
src/routes/(docs)/store/interaction-mode/example/+page.svelte
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import { interactionMode } from '$lib' | ||
</script> | ||
|
||
<p> | ||
You are currently using a <strong>{$interactionMode}</strong> device. | ||
</p> | ||
|
||
<input | ||
type="text" | ||
class="block rounded border border-gray-300 bg-white p-2 shadow-sm dark:border-neutral-700 dark:bg-neutral-700 dark:text-neutral-100 sm:text-sm" | ||
placeholder="Type some text..." | ||
/> |