-
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
1 parent
4861624
commit 8099f4d
Showing
37 changed files
with
302 additions
and
250 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 |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
"tsconfig": "workspace:*" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -29,3 +29,4 @@ | |
"tsconfig": "workspace:*" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -35,3 +35,4 @@ | |
"tsconfig": "workspace:*" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -58,3 +58,4 @@ | |
"tsconfig": "workspace:*" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -28,3 +28,4 @@ | |
"@types/jsonwebtoken": "9.0.1" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -27,3 +27,4 @@ | |
"tsconfig": "workspace:*" | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -12,4 +12,6 @@ pnpm-lock.yaml | |
package-lock.json | ||
yarn.lock | ||
|
||
*.timestamp-*.mjs | ||
*.timestamp-*.mjs | ||
|
||
./src/app.html |
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
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,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
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
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
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,16 +1,18 @@ | ||
<script lang="ts"> | ||
let isWithin = false | ||
import { stopPropagation } from 'svelte/legacy' | ||
let isWithin = $state(false) | ||
function onGlobalClick() { | ||
isWithin = false; | ||
isWithin = false | ||
} | ||
</script> | ||
|
||
<svelte:document on:click={onGlobalClick} /> | ||
<svelte:document onclick={onGlobalClick} /> | ||
|
||
<article> | ||
<h2>Click Outside</h2> | ||
<button class="btn-primary" on:click|stopPropagation={() => isWithin = true}> | ||
<button class="btn-primary" onclick={stopPropagation(() => (isWithin = true))}> | ||
{isWithin ? 'Within' : 'Outside'} | ||
</button> | ||
</article> | ||
</article> |
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,22 +1,17 @@ | ||
<script lang="ts"> | ||
let value = '' | ||
let debounced = '' | ||
let timer: ReturnType<typeof setTimeout> | ||
let value = $state('') | ||
let debounced = $state('') | ||
let timer: ReturnType<typeof setTimeout> | ||
const debounce = (func: () => void, delay = 300) => { | ||
clearTimeout(timer); | ||
clearTimeout(timer) | ||
timer = setTimeout(func, delay) | ||
} | ||
</script> | ||
|
||
<article> | ||
<h2>Debounce</h2> | ||
<input | ||
class="input" | ||
type="text" | ||
bind:value={value} | ||
on:keyup={() => debounce(() => debounced = value)} | ||
/> | ||
<input class="input" type="text" bind:value onkeyup={() => debounce(() => (debounced = value))} /> | ||
<p>Value: {value}</p> | ||
<p>Debounced: {debounced}</p> | ||
</article> | ||
</article> |
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,12 +1,16 @@ | ||
<script lang="ts"> | ||
import { randomString } from "./randomString" | ||
import { randomString } from './randomString' | ||
export let initValue: string | ||
interface Props { | ||
initValue: string | ||
} | ||
let {value: random, generate} = randomString(initValue) | ||
let { initValue }: Props = $props() | ||
let { value: random, generate } = randomString(initValue) | ||
</script> | ||
|
||
<article> | ||
<h2>Random String</h2> | ||
<button on:click={generate}>{$random}</button> | ||
</article> | ||
<button onclick={generate}>{$random}</button> | ||
</article> |
Oops, something went wrong.