[Release] v0.2.2
@@ -1,7 +1,5 @@
|
|||||||
**/*
|
**/*
|
||||||
!/extra/**/*
|
!/app/**/*
|
||||||
!*.d.ts
|
!*.d.ts
|
||||||
!index.js
|
|
||||||
!platforms.js
|
|
||||||
!*.md
|
!*.md
|
||||||
!*.json
|
!*.json
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
/dist
|
/dist
|
||||||
/build
|
/build
|
||||||
|
/examples
|
||||||
/node_modules
|
/node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
13
CHANGELOG.md
@@ -1,8 +1,7 @@
|
|||||||
# v0.2.1 (February 11, 2023)
|
# v0.2.2 (February 11, 2023)
|
||||||
|
|
||||||
- New Options: `viewport`
|
- Fix: Docs
|
||||||
- New Options: `policy`
|
- New: `/examples` folder
|
||||||
- Fix: HTML Regex
|
|
||||||
|
|
||||||
<!-- all-shields/sponsors-badges:START -->
|
<!-- all-shields/sponsors-badges:START -->
|
||||||
|
|
||||||
@@ -10,6 +9,12 @@
|
|||||||
|
|
||||||
<!-- all-shields/sponsors-badges:END -->
|
<!-- all-shields/sponsors-badges:END -->
|
||||||
|
|
||||||
|
# v0.2.1 (February 11, 2023)
|
||||||
|
|
||||||
|
- New Options: `viewport`
|
||||||
|
- New Options: `policy`
|
||||||
|
- Fix: HTML Regex
|
||||||
|
|
||||||
# v0.1.0 (February 06, 2023)
|
# v0.1.0 (February 06, 2023)
|
||||||
|
|
||||||
- First release
|
- First release
|
||||||
|
|||||||
10
README.md
@@ -57,7 +57,7 @@ import adapter from "@ptkdev/sveltekit-electron-adapter";
|
|||||||
const config = {
|
const config = {
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
strict: true,
|
strict: false,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -72,7 +72,7 @@ I make a boilerplate that "automate" this process, but is working in progress: c
|
|||||||
|
|
||||||
## 🧰 Options
|
## 🧰 Options
|
||||||
|
|
||||||
The `adatper({ options })` parameters list:
|
The `adapter({ options })` parameters list:
|
||||||
|
|
||||||
| Parameter | Description | Values | Default value | Available since |
|
| Parameter | Description | Values | Default value | Available since |
|
||||||
| ----------- | --------------------------------------------------------------- | ------ | ----------------------------------------------------------- | --------------- |
|
| ----------- | --------------------------------------------------------------- | ------ | ----------------------------------------------------------- | --------------- |
|
||||||
@@ -81,7 +81,7 @@ The `adatper({ options })` parameters list:
|
|||||||
| fallback | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
| fallback | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
||||||
| precompress | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
| precompress | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
||||||
| strict | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
| strict | See official [docs](https://kit.svelte.dev/docs/adapter-static) | | | |
|
||||||
| policy | Set meta-tag `content-security-policy` | String | `default-src 'self'; script-src 'self'` | v0.2.0 |
|
| policy | Set meta-tag `content-security-policy` | String | Empty | v0.2.0 |
|
||||||
| viewport | Set meta-tag `viewport` | String | `width=device-width, initial-scale=1.0, viewport-fit=cover` | v0.2.0 |
|
| viewport | Set meta-tag `viewport` | String | `width=device-width, initial-scale=1.0, viewport-fit=cover` | v0.2.0 |
|
||||||
|
|
||||||
#### Example:
|
#### Example:
|
||||||
@@ -90,8 +90,8 @@ The `adatper({ options })` parameters list:
|
|||||||
const config = {
|
const config = {
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
strict: true,
|
strict: false,
|
||||||
policy: "",
|
policy: "default-src 'self'; script-src 'self'",
|
||||||
viewport: `width=device-width`,
|
viewport: `width=device-width`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ See https://kit.svelte.dev/docs/page-options#prerender for more details`,
|
|||||||
});
|
});
|
||||||
|
|
||||||
let regex_input = new RegExp(`http-equiv="content-security-policy" content=""`, "g");
|
let regex_input = new RegExp(`http-equiv="content-security-policy" content=""`, "g");
|
||||||
const policy = "default-src 'self'; script-src 'self'";
|
const policy = "";
|
||||||
let regex_replace = `http-equiv="content-security-policy" content="${
|
let regex_replace = `http-equiv="content-security-policy" content="${
|
||||||
options?.policy ? options.policy : policy
|
options?.policy ? options.policy : policy
|
||||||
}"`;
|
}"`;
|
||||||
|
|||||||
89
examples/electron-app/.gitignore
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# TypeScript v1 declaration files
|
||||||
|
typings/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
.env.test
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# next.js build output
|
||||||
|
.next
|
||||||
|
|
||||||
|
# nuxt.js build output
|
||||||
|
.nuxt
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# Webpack
|
||||||
|
.webpack/
|
||||||
|
|
||||||
|
# Electron-Forge
|
||||||
|
out/
|
||||||
22
examples/electron-app/forge.config.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
module.exports = {
|
||||||
|
packagerConfig: {},
|
||||||
|
rebuildConfig: {},
|
||||||
|
makers: [
|
||||||
|
{
|
||||||
|
name: '@electron-forge/maker-squirrel',
|
||||||
|
config: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '@electron-forge/maker-zip',
|
||||||
|
platforms: ['darwin'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '@electron-forge/maker-deb',
|
||||||
|
config: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '@electron-forge/maker-rpm',
|
||||||
|
config: {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
31
examples/electron-app/package.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "electron-app",
|
||||||
|
"productName": "electron-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "My Electron application description",
|
||||||
|
"main": "src/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "electron-forge start",
|
||||||
|
"package": "electron-forge package",
|
||||||
|
"make": "electron-forge make",
|
||||||
|
"publish": "electron-forge publish",
|
||||||
|
"lint": "echo \"No linting configured\""
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": {
|
||||||
|
"name": "Patryk Rzucidlo (PTKDev)",
|
||||||
|
"email": "ptkdev@gmail.com"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"electron-squirrel-startup": "^1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@electron-forge/cli": "^6.0.5",
|
||||||
|
"@electron-forge/maker-deb": "^6.0.5",
|
||||||
|
"@electron-forge/maker-rpm": "^6.0.5",
|
||||||
|
"@electron-forge/maker-squirrel": "^6.0.5",
|
||||||
|
"@electron-forge/maker-zip": "^6.0.5",
|
||||||
|
"electron": "23.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
header.svelte-1u9z1tp.svelte-1u9z1tp{display:flex;justify-content:space-between}.corner.svelte-1u9z1tp.svelte-1u9z1tp{width:3em;height:3em}.corner.svelte-1u9z1tp a.svelte-1u9z1tp{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.corner.svelte-1u9z1tp img.svelte-1u9z1tp{width:2em;height:2em;object-fit:contain}nav.svelte-1u9z1tp.svelte-1u9z1tp{display:flex;justify-content:center;--background:rgba(255, 255, 255, 0.7)}svg.svelte-1u9z1tp.svelte-1u9z1tp{width:2em;height:3em;display:block}path.svelte-1u9z1tp.svelte-1u9z1tp{fill:var(--background)}ul.svelte-1u9z1tp.svelte-1u9z1tp{position:relative;padding:0;margin:0;height:3em;display:flex;justify-content:center;align-items:center;list-style:none;background:var(--background);background-size:contain}li.svelte-1u9z1tp.svelte-1u9z1tp{position:relative;height:100%}li[aria-current='page'].svelte-1u9z1tp.svelte-1u9z1tp::before{--size:6px;content:'';width:0;height:0;position:absolute;top:0;left:calc(50% - var(--size));border:var(--size) solid transparent;border-top:var(--size) solid var(--color-theme-1)}nav.svelte-1u9z1tp a.svelte-1u9z1tp{display:flex;height:100%;align-items:center;padding:0 0.5rem;color:var(--color-text);font-weight:700;font-size:0.8rem;text-transform:uppercase;letter-spacing:0.1em;text-decoration:none;transition:color 0.2s linear}a.svelte-1u9z1tp.svelte-1u9z1tp:hover{color:var(--color-theme-1)}/* fira-mono-cyrillic-ext-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-cyrillic-ext-400-normal-3df7909e.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* fira-mono-cyrillic-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-cyrillic-400-normal-c7d433fd.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
|
||||||
|
}
|
||||||
|
/* fira-mono-greek-ext-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-greek-ext-400-normal-9e2fe623.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* fira-mono-greek-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-greek-400-normal-a8be01ce.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+0370-03FF;
|
||||||
|
}
|
||||||
|
/* fira-mono-latin-ext-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-latin-ext-400-normal-6bfabd30.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* fira-mono-latin-400-normal*/
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('./fira-mono-latin-400-normal-e43b3538.woff2') format('woff2'), url('./fira-mono-all-400-normal-1e3b098c.woff') format('woff');
|
||||||
|
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
|
||||||
|
}
|
||||||
|
:root {
|
||||||
|
--font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
|
||||||
|
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
--font-mono: 'Fira Mono', monospace;
|
||||||
|
--color-bg-0: rgb(202, 216, 228);
|
||||||
|
--color-bg-1: hsl(209, 36%, 86%);
|
||||||
|
--color-bg-2: hsl(224, 44%, 95%);
|
||||||
|
--color-theme-1: #ff3e00;
|
||||||
|
--color-theme-2: #4075a6;
|
||||||
|
--color-text: rgba(0, 0, 0, 0.7);
|
||||||
|
--column-width: 42rem;
|
||||||
|
--column-margin-top: 4rem;
|
||||||
|
font-family: var(--font-body);
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-color: var(--color-bg-1);
|
||||||
|
background-size: 100vw 100vh;
|
||||||
|
background-image: radial-gradient(
|
||||||
|
50% 50% at 50% 50%,
|
||||||
|
rgba(255, 255, 255, 0.75) 0%,
|
||||||
|
rgba(255, 255, 255, 0) 100%
|
||||||
|
),
|
||||||
|
linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 15%, var(--color-bg-2) 50%);
|
||||||
|
}
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
p {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: var(--color-theme-1);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 2rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
background-color: rgba(255, 255, 255, 0.45);
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 2px 2px 6px rgb(255 255 255 / 25%);
|
||||||
|
padding: 0.5em;
|
||||||
|
overflow-x: auto;
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
.text-column {
|
||||||
|
display: flex;
|
||||||
|
max-width: 48rem;
|
||||||
|
flex: 0.6;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
input,
|
||||||
|
button {
|
||||||
|
font-size: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
button:focus:not(:focus-visible) {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
@media (min-width: 720px) {
|
||||||
|
h1 {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.visually-hidden {
|
||||||
|
border: 0;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
height: auto;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.app.svelte-8o1gnw.svelte-8o1gnw{display:flex;flex-direction:column;min-height:100vh}main.svelte-8o1gnw.svelte-8o1gnw{flex:1;display:flex;flex-direction:column;padding:1rem;width:100%;max-width:64rem;margin:0 auto;box-sizing:border-box}footer.svelte-8o1gnw.svelte-8o1gnw{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:12px}footer.svelte-8o1gnw a.svelte-8o1gnw{font-weight:bold}@media(min-width: 480px){footer.svelte-8o1gnw.svelte-8o1gnw{padding:12px 0}}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.counter.svelte-y96mxt.svelte-y96mxt{display:flex;border-top:1px solid rgba(0, 0, 0, 0.1);border-bottom:1px solid rgba(0, 0, 0, 0.1);margin:1rem 0}.counter.svelte-y96mxt button.svelte-y96mxt{width:2em;padding:0;display:flex;align-items:center;justify-content:center;border:0;background-color:transparent;touch-action:manipulation;font-size:2rem}.counter.svelte-y96mxt button.svelte-y96mxt:hover{background-color:var(--color-bg-1)}svg.svelte-y96mxt.svelte-y96mxt{width:25%;height:25%}path.svelte-y96mxt.svelte-y96mxt{vector-effect:non-scaling-stroke;stroke-width:2px;stroke:#444}.counter-viewport.svelte-y96mxt.svelte-y96mxt{width:8em;height:4em;overflow:hidden;text-align:center;position:relative}.counter-viewport.svelte-y96mxt strong.svelte-y96mxt{position:absolute;display:flex;width:100%;height:100%;font-weight:400;color:var(--color-theme-1);font-size:4rem;align-items:center;justify-content:center}.counter-digits.svelte-y96mxt.svelte-y96mxt{position:absolute;width:100%;height:100%}.hidden.svelte-y96mxt.svelte-y96mxt{top:-100%;user-select:none}section.svelte-19xx0bt.svelte-19xx0bt{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0.6}h1.svelte-19xx0bt.svelte-19xx0bt{width:100%}.welcome.svelte-19xx0bt.svelte-19xx0bt{display:block;position:relative;width:100%;height:0;padding:0 0 calc(100% * 495 / 2048) 0}.welcome.svelte-19xx0bt img.svelte-19xx0bt{position:absolute;width:100%;height:100%;top:0;display:block}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
span.svelte-1x5nq1n.svelte-1x5nq1n{display:inline-flex;justify-content:center;align-items:center;font-size:0.8em;width:2.4em;height:2.4em;background-color:white;box-sizing:border-box;border-radius:2px;border-width:2px;color:rgba(0, 0, 0, 0.7)}.missing.svelte-1x5nq1n.svelte-1x5nq1n{background:rgba(255, 255, 255, 0.5);color:rgba(0, 0, 0, 0.5)}.close.svelte-1x5nq1n.svelte-1x5nq1n{border-style:solid;border-color:var(--color-theme-2)}.exact.svelte-1x5nq1n.svelte-1x5nq1n{background:var(--color-theme-2);color:white}.example.svelte-1x5nq1n.svelte-1x5nq1n{display:flex;justify-content:flex-start;margin:1rem 0;gap:0.2rem}.example.svelte-1x5nq1n span.svelte-1x5nq1n{font-size:1.4rem}p.svelte-1x5nq1n span.svelte-1x5nq1n{position:relative;border-width:1px;border-radius:1px;font-size:0.4em;transform:scale(2) translate(0, -10%);margin:0 1em}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
form.svelte-1pg2j5l.svelte-1pg2j5l{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;flex:1}.how-to-play.svelte-1pg2j5l.svelte-1pg2j5l{color:var(--color-text)}.how-to-play.svelte-1pg2j5l.svelte-1pg2j5l::before{content:'i';display:inline-block;font-size:0.8em;font-weight:900;width:1em;height:1em;padding:0.2em;line-height:1;border:1.5px solid var(--color-text);border-radius:50%;text-align:center;margin:0 0.5em 0 0;position:relative;top:-0.05em}.grid.svelte-1pg2j5l.svelte-1pg2j5l{--width:min(100vw, 40vh, 380px);max-width:var(--width);align-self:center;justify-self:center;width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-start}.grid.svelte-1pg2j5l .row.svelte-1pg2j5l{display:grid;grid-template-columns:repeat(5, 1fr);grid-gap:0.2rem;margin:0 0 0.2rem 0}@media(prefers-reduced-motion: no-preference){.grid.bad-guess.svelte-1pg2j5l .row.current.svelte-1pg2j5l{animation:svelte-1pg2j5l-wiggle 0.5s}}.grid.playing.svelte-1pg2j5l .row.current.svelte-1pg2j5l{filter:drop-shadow(3px 3px 10px var(--color-bg-0))}.letter.svelte-1pg2j5l.svelte-1pg2j5l{aspect-ratio:1;width:100%;display:flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box;text-transform:lowercase;border:none;font-size:calc(0.08 * var(--width));border-radius:2px;background:white;margin:0;color:rgba(0, 0, 0, 0.7)}.letter.missing.svelte-1pg2j5l.svelte-1pg2j5l{background:rgba(255, 255, 255, 0.5);color:rgba(0, 0, 0, 0.5)}.letter.exact.svelte-1pg2j5l.svelte-1pg2j5l{background:var(--color-theme-2);color:white}.letter.close.svelte-1pg2j5l.svelte-1pg2j5l{border:2px solid var(--color-theme-2)}.selected.svelte-1pg2j5l.svelte-1pg2j5l{outline:2px solid var(--color-theme-1)}.controls.svelte-1pg2j5l.svelte-1pg2j5l{text-align:center;justify-content:center;height:min(18vh, 10rem)}.keyboard.svelte-1pg2j5l.svelte-1pg2j5l{--gap:0.2rem;position:relative;display:flex;flex-direction:column;gap:var(--gap);height:100%}.keyboard.svelte-1pg2j5l .row.svelte-1pg2j5l{display:flex;justify-content:center;gap:0.2rem;flex:1}.keyboard.svelte-1pg2j5l button.svelte-1pg2j5l,.keyboard.svelte-1pg2j5l button.svelte-1pg2j5l:disabled{--size:min(8vw, 4vh, 40px);background-color:white;color:black;width:var(--size);border:none;border-radius:2px;font-size:calc(var(--size) * 0.5);margin:0}.keyboard.svelte-1pg2j5l button.exact.svelte-1pg2j5l{background:var(--color-theme-2);color:white}.keyboard.svelte-1pg2j5l button.missing.svelte-1pg2j5l{opacity:0.5}.keyboard.svelte-1pg2j5l button.close.svelte-1pg2j5l{border:2px solid var(--color-theme-2)}.keyboard.svelte-1pg2j5l button.svelte-1pg2j5l:focus{background:var(--color-theme-1);color:white;outline:none}.keyboard.svelte-1pg2j5l button[data-key='enter'].svelte-1pg2j5l,.keyboard.svelte-1pg2j5l button[data-key='backspace'].svelte-1pg2j5l{position:absolute;bottom:0;width:calc(1.5 * var(--size));height:calc(1 / 3 * (100% - 2 * var(--gap)));text-transform:uppercase;font-size:calc(0.3 * var(--size));padding-top:calc(0.15 * var(--size))}.keyboard.svelte-1pg2j5l button[data-key='enter'].svelte-1pg2j5l{right:calc(50% + 3.5 * var(--size) + 0.8rem)}.keyboard.svelte-1pg2j5l button[data-key='backspace'].svelte-1pg2j5l{left:calc(50% + 3.5 * var(--size) + 0.8rem)}.keyboard.svelte-1pg2j5l button[data-key='enter'].svelte-1pg2j5l:disabled{opacity:0.5}.restart.svelte-1pg2j5l.svelte-1pg2j5l{width:100%;padding:1rem;background:rgba(255, 255, 255, 0.5);border-radius:2px;border:none}.restart.svelte-1pg2j5l.svelte-1pg2j5l:focus,.restart.svelte-1pg2j5l.svelte-1pg2j5l:hover{background:var(--color-theme-1);color:white;outline:none}@keyframes svelte-1pg2j5l-wiggle{0%{transform:translateX(0)}10%{transform:translateX(-2px)}30%{transform:translateX(4px)}50%{transform:translateX(-6px)}70%{transform:translateX(+4px)}90%{transform:translateX(-2px)}100%{transform:translateX(0)}}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-3 -3 30 30">
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5229 6.47715 22 12 22C17.5229 22 22 17.5229 22 12C22 6.47715 17.5229 2 12 2ZM0 12C0 5.3726 5.3726 0 12 0C18.6274 0 24 5.3726 24 12C24 18.6274 18.6274 24 12 24C5.3726 24 0 18.6274 0 12Z"
|
||||||
|
fill="rgba(0,0,0,0.7)"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="M9.59162 22.7357C9.49492 22.6109 9.49492 21.4986 9.59162 19.399C8.55572 19.4347 7.90122 19.3628 7.62812 19.1833C7.21852 18.9139 6.80842 18.0833 6.44457 17.4979C6.08072 16.9125 5.27312 16.8199 4.94702 16.6891C4.62091 16.5582 4.53905 16.0247 5.84562 16.4282C7.15222 16.8316 7.21592 17.9303 7.62812 18.1872C8.04032 18.4441 9.02572 18.3317 9.47242 18.1259C9.91907 17.9201 9.88622 17.1538 9.96587 16.8503C10.0666 16.5669 9.71162 16.5041 9.70382 16.5018C9.26777 16.5018 6.97697 16.0036 6.34772 13.7852C5.71852 11.5669 6.52907 10.117 6.96147 9.49369C7.24972 9.07814 7.22422 8.19254 6.88497 6.83679C8.11677 6.67939 9.06732 7.06709 9.73672 7.99999C9.73737 8.00534 10.6143 7.47854 12.0001 7.47854C13.386 7.47854 13.8777 7.90764 14.2571 7.99999C14.6365 8.09234 14.94 6.36699 17.2834 6.83679C16.7942 7.79839 16.3844 8.99999 16.6972 9.49369C17.0099 9.98739 18.2372 11.5573 17.4833 13.7852C16.9807 15.2706 15.9927 16.1761 14.5192 16.5018C14.3502 16.5557 14.2658 16.6427 14.2658 16.7627C14.2658 16.9427 14.4942 16.9624 14.8233 17.8058C15.0426 18.368 15.0585 19.9739 14.8708 22.6234C14.3953 22.7445 14.0254 22.8257 13.7611 22.8673C13.2924 22.9409 12.7835 22.9822 12.2834 22.9982C11.7834 23.0141 11.6098 23.0123 10.9185 22.948C10.4577 22.9051 10.0154 22.8343 9.59162 22.7357Z"
|
||||||
|
fill="rgba(0,0,0,0.7)"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.1566,22.8189c-10.4-14.8851-30.94-19.2971-45.7914-9.8348L22.2825,29.6078A29.9234,29.9234,0,0,0,8.7639,49.6506a31.5136,31.5136,0,0,0,3.1076,20.2318A30.0061,30.0061,0,0,0,7.3953,81.0653a31.8886,31.8886,0,0,0,5.4473,24.1157c10.4022,14.8865,30.9423,19.2966,45.7914,9.8348L84.7167,98.3921A29.9177,29.9177,0,0,0,98.2353,78.3493,31.5263,31.5263,0,0,0,95.13,58.117a30,30,0,0,0,4.4743-11.1824,31.88,31.88,0,0,0-5.4473-24.1157" style="fill:#ff3e00"/><path d="M45.8171,106.5815A20.7182,20.7182,0,0,1,23.58,98.3389a19.1739,19.1739,0,0,1-3.2766-14.5025,18.1886,18.1886,0,0,1,.6233-2.4357l.4912-1.4978,1.3363.9815a33.6443,33.6443,0,0,0,10.203,5.0978l.9694.2941-.0893.9675a5.8474,5.8474,0,0,0,1.052,3.8781,6.2389,6.2389,0,0,0,6.6952,2.485,5.7449,5.7449,0,0,0,1.6021-.7041L69.27,76.281a5.4306,5.4306,0,0,0,2.4506-3.631,5.7948,5.7948,0,0,0-.9875-4.3712,6.2436,6.2436,0,0,0-6.6978-2.4864,5.7427,5.7427,0,0,0-1.6.7036l-9.9532,6.3449a19.0329,19.0329,0,0,1-5.2965,2.3259,20.7181,20.7181,0,0,1-22.2368-8.2427,19.1725,19.1725,0,0,1-3.2766-14.5024,17.9885,17.9885,0,0,1,8.13-12.0513L55.8833,23.7472a19.0038,19.0038,0,0,1,5.3-2.3287A20.7182,20.7182,0,0,1,83.42,29.6611a19.1739,19.1739,0,0,1,3.2766,14.5025,18.4,18.4,0,0,1-.6233,2.4357l-.4912,1.4978-1.3356-.98a33.6175,33.6175,0,0,0-10.2037-5.1l-.9694-.2942.0893-.9675a5.8588,5.8588,0,0,0-1.052-3.878,6.2389,6.2389,0,0,0-6.6952-2.485,5.7449,5.7449,0,0,0-1.6021.7041L37.73,51.719a5.4218,5.4218,0,0,0-2.4487,3.63,5.7862,5.7862,0,0,0,.9856,4.3717,6.2437,6.2437,0,0,0,6.6978,2.4864,5.7652,5.7652,0,0,0,1.602-.7041l9.9519-6.3425a18.978,18.978,0,0,1,5.2959-2.3278,20.7181,20.7181,0,0,1,22.2368,8.2427,19.1725,19.1725,0,0,1,3.2766,14.5024,17.9977,17.9977,0,0,1-8.13,12.0532L51.1167,104.2528a19.0038,19.0038,0,0,1-5.3,2.3287" style="fill:#fff"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 352 KiB |
|
After Width: | Height: | Size: 113 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
import { default as default2 } from "../components/pages/_layout.svelte-20a5d298.js";
|
||||||
|
export {
|
||||||
|
default2 as component
|
||||||
|
};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { default as default2 } from "../components/error.svelte-673baa07.js";
|
||||||
|
export {
|
||||||
|
default2 as component
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { _ } from "./_page-de0ef88a.js";
|
||||||
|
import { default as default2 } from "../components/pages/_page.svelte-8f3445c9.js";
|
||||||
|
export {
|
||||||
|
default2 as component,
|
||||||
|
_ as universal
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { _ } from "./_page-34b026b6.js";
|
||||||
|
import { default as default2 } from "../components/pages/about/_page.svelte-f31c9606.js";
|
||||||
|
export {
|
||||||
|
default2 as component,
|
||||||
|
_ as universal
|
||||||
|
};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { default as default2 } from "../components/pages/sverdle/_page.svelte-aa322e66.js";
|
||||||
|
export {
|
||||||
|
default2 as component
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { _ } from "./_page-cbe3748d.js";
|
||||||
|
import { default as default2 } from "../components/pages/sverdle/how-to-play/_page.svelte-fb619894.js";
|
||||||
|
export {
|
||||||
|
default2 as component,
|
||||||
|
_ as universal
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { d as dev } from "./environment-57be8769.js";
|
||||||
|
const csr = dev;
|
||||||
|
const prerender = true;
|
||||||
|
const _page = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
||||||
|
__proto__: null,
|
||||||
|
csr,
|
||||||
|
prerender
|
||||||
|
}, Symbol.toStringTag, { value: "Module" }));
|
||||||
|
export {
|
||||||
|
_page as _,
|
||||||
|
csr as c,
|
||||||
|
prerender as p
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { d as dev } from "./environment-57be8769.js";
|
||||||
|
const csr = dev;
|
||||||
|
const prerender = true;
|
||||||
|
const _page = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
||||||
|
__proto__: null,
|
||||||
|
csr,
|
||||||
|
prerender
|
||||||
|
}, Symbol.toStringTag, { value: "Module" }));
|
||||||
|
export {
|
||||||
|
_page as _,
|
||||||
|
csr as c,
|
||||||
|
prerender as p
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const prerender = true;
|
||||||
|
const _page = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
||||||
|
__proto__: null,
|
||||||
|
prerender
|
||||||
|
}, Symbol.toStringTag, { value: "Module" }));
|
||||||
|
export {
|
||||||
|
_page as _,
|
||||||
|
prerender as p
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const DEV = false;
|
||||||
|
const dev = DEV;
|
||||||
|
export {
|
||||||
|
dev as d
|
||||||
|
};
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { C as noop, s as safe_not_equal } from "./index-d985765e.js";
|
||||||
|
const subscriber_queue = [];
|
||||||
|
function readable(value, start) {
|
||||||
|
return {
|
||||||
|
subscribe: writable(value, start).subscribe
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function writable(value, start = noop) {
|
||||||
|
let stop;
|
||||||
|
const subscribers = /* @__PURE__ */ new Set();
|
||||||
|
function set(new_value) {
|
||||||
|
if (safe_not_equal(value, new_value)) {
|
||||||
|
value = new_value;
|
||||||
|
if (stop) {
|
||||||
|
const run_queue = !subscriber_queue.length;
|
||||||
|
for (const subscriber of subscribers) {
|
||||||
|
subscriber[1]();
|
||||||
|
subscriber_queue.push(subscriber, value);
|
||||||
|
}
|
||||||
|
if (run_queue) {
|
||||||
|
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
||||||
|
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
||||||
|
}
|
||||||
|
subscriber_queue.length = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function update(fn) {
|
||||||
|
set(fn(value));
|
||||||
|
}
|
||||||
|
function subscribe(run, invalidate = noop) {
|
||||||
|
const subscriber = [run, invalidate];
|
||||||
|
subscribers.add(subscriber);
|
||||||
|
if (subscribers.size === 1) {
|
||||||
|
stop = start(set) || noop;
|
||||||
|
}
|
||||||
|
run(value);
|
||||||
|
return () => {
|
||||||
|
subscribers.delete(subscriber);
|
||||||
|
if (subscribers.size === 0) {
|
||||||
|
stop();
|
||||||
|
stop = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return { set, update, subscribe };
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
readable as r,
|
||||||
|
writable as w
|
||||||
|
};
|
||||||
@@ -0,0 +1,684 @@
|
|||||||
|
function noop() {
|
||||||
|
}
|
||||||
|
function assign(tar, src) {
|
||||||
|
for (const k in src)
|
||||||
|
tar[k] = src[k];
|
||||||
|
return tar;
|
||||||
|
}
|
||||||
|
function run(fn) {
|
||||||
|
return fn();
|
||||||
|
}
|
||||||
|
function blank_object() {
|
||||||
|
return /* @__PURE__ */ Object.create(null);
|
||||||
|
}
|
||||||
|
function run_all(fns) {
|
||||||
|
fns.forEach(run);
|
||||||
|
}
|
||||||
|
function is_function(thing) {
|
||||||
|
return typeof thing === "function";
|
||||||
|
}
|
||||||
|
function safe_not_equal(a, b) {
|
||||||
|
return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function");
|
||||||
|
}
|
||||||
|
let src_url_equal_anchor;
|
||||||
|
function src_url_equal(element_src, url) {
|
||||||
|
if (!src_url_equal_anchor) {
|
||||||
|
src_url_equal_anchor = document.createElement("a");
|
||||||
|
}
|
||||||
|
src_url_equal_anchor.href = url;
|
||||||
|
return element_src === src_url_equal_anchor.href;
|
||||||
|
}
|
||||||
|
function is_empty(obj) {
|
||||||
|
return Object.keys(obj).length === 0;
|
||||||
|
}
|
||||||
|
function subscribe(store, ...callbacks) {
|
||||||
|
if (store == null) {
|
||||||
|
return noop;
|
||||||
|
}
|
||||||
|
const unsub = store.subscribe(...callbacks);
|
||||||
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||||
|
}
|
||||||
|
function component_subscribe(component, store, callback) {
|
||||||
|
component.$$.on_destroy.push(subscribe(store, callback));
|
||||||
|
}
|
||||||
|
function create_slot(definition, ctx, $$scope, fn) {
|
||||||
|
if (definition) {
|
||||||
|
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
||||||
|
return definition[0](slot_ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_slot_context(definition, ctx, $$scope, fn) {
|
||||||
|
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
|
||||||
|
}
|
||||||
|
function get_slot_changes(definition, $$scope, dirty, fn) {
|
||||||
|
if (definition[2] && fn) {
|
||||||
|
const lets = definition[2](fn(dirty));
|
||||||
|
if ($$scope.dirty === void 0) {
|
||||||
|
return lets;
|
||||||
|
}
|
||||||
|
if (typeof lets === "object") {
|
||||||
|
const merged = [];
|
||||||
|
const len = Math.max($$scope.dirty.length, lets.length);
|
||||||
|
for (let i = 0; i < len; i += 1) {
|
||||||
|
merged[i] = $$scope.dirty[i] | lets[i];
|
||||||
|
}
|
||||||
|
return merged;
|
||||||
|
}
|
||||||
|
return $$scope.dirty | lets;
|
||||||
|
}
|
||||||
|
return $$scope.dirty;
|
||||||
|
}
|
||||||
|
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
|
||||||
|
if (slot_changes) {
|
||||||
|
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
||||||
|
slot.p(slot_context, slot_changes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_all_dirty_from_scope($$scope) {
|
||||||
|
if ($$scope.ctx.length > 32) {
|
||||||
|
const dirty = [];
|
||||||
|
const length = $$scope.ctx.length / 32;
|
||||||
|
for (let i = 0; i < length; i++) {
|
||||||
|
dirty[i] = -1;
|
||||||
|
}
|
||||||
|
return dirty;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
function null_to_empty(value) {
|
||||||
|
return value == null ? "" : value;
|
||||||
|
}
|
||||||
|
function action_destroyer(action_result) {
|
||||||
|
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
||||||
|
}
|
||||||
|
const is_client = typeof window !== "undefined";
|
||||||
|
let now = is_client ? () => window.performance.now() : () => Date.now();
|
||||||
|
let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;
|
||||||
|
const tasks = /* @__PURE__ */ new Set();
|
||||||
|
function run_tasks(now2) {
|
||||||
|
tasks.forEach((task) => {
|
||||||
|
if (!task.c(now2)) {
|
||||||
|
tasks.delete(task);
|
||||||
|
task.f();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (tasks.size !== 0)
|
||||||
|
raf(run_tasks);
|
||||||
|
}
|
||||||
|
function loop(callback) {
|
||||||
|
let task;
|
||||||
|
if (tasks.size === 0)
|
||||||
|
raf(run_tasks);
|
||||||
|
return {
|
||||||
|
promise: new Promise((fulfill) => {
|
||||||
|
tasks.add(task = { c: callback, f: fulfill });
|
||||||
|
}),
|
||||||
|
abort() {
|
||||||
|
tasks.delete(task);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
let is_hydrating = false;
|
||||||
|
function start_hydrating() {
|
||||||
|
is_hydrating = true;
|
||||||
|
}
|
||||||
|
function end_hydrating() {
|
||||||
|
is_hydrating = false;
|
||||||
|
}
|
||||||
|
function upper_bound(low, high, key, value) {
|
||||||
|
while (low < high) {
|
||||||
|
const mid = low + (high - low >> 1);
|
||||||
|
if (key(mid) <= value) {
|
||||||
|
low = mid + 1;
|
||||||
|
} else {
|
||||||
|
high = mid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return low;
|
||||||
|
}
|
||||||
|
function init_hydrate(target) {
|
||||||
|
if (target.hydrate_init)
|
||||||
|
return;
|
||||||
|
target.hydrate_init = true;
|
||||||
|
let children2 = target.childNodes;
|
||||||
|
if (target.nodeName === "HEAD") {
|
||||||
|
const myChildren = [];
|
||||||
|
for (let i = 0; i < children2.length; i++) {
|
||||||
|
const node = children2[i];
|
||||||
|
if (node.claim_order !== void 0) {
|
||||||
|
myChildren.push(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
children2 = myChildren;
|
||||||
|
}
|
||||||
|
const m = new Int32Array(children2.length + 1);
|
||||||
|
const p = new Int32Array(children2.length);
|
||||||
|
m[0] = -1;
|
||||||
|
let longest = 0;
|
||||||
|
for (let i = 0; i < children2.length; i++) {
|
||||||
|
const current = children2[i].claim_order;
|
||||||
|
const seqLen = (longest > 0 && children2[m[longest]].claim_order <= current ? longest + 1 : upper_bound(1, longest, (idx) => children2[m[idx]].claim_order, current)) - 1;
|
||||||
|
p[i] = m[seqLen] + 1;
|
||||||
|
const newLen = seqLen + 1;
|
||||||
|
m[newLen] = i;
|
||||||
|
longest = Math.max(newLen, longest);
|
||||||
|
}
|
||||||
|
const lis = [];
|
||||||
|
const toMove = [];
|
||||||
|
let last = children2.length - 1;
|
||||||
|
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
|
||||||
|
lis.push(children2[cur - 1]);
|
||||||
|
for (; last >= cur; last--) {
|
||||||
|
toMove.push(children2[last]);
|
||||||
|
}
|
||||||
|
last--;
|
||||||
|
}
|
||||||
|
for (; last >= 0; last--) {
|
||||||
|
toMove.push(children2[last]);
|
||||||
|
}
|
||||||
|
lis.reverse();
|
||||||
|
toMove.sort((a, b) => a.claim_order - b.claim_order);
|
||||||
|
for (let i = 0, j = 0; i < toMove.length; i++) {
|
||||||
|
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
const anchor = j < lis.length ? lis[j] : null;
|
||||||
|
target.insertBefore(toMove[i], anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function append_hydration(target, node) {
|
||||||
|
if (is_hydrating) {
|
||||||
|
init_hydrate(target);
|
||||||
|
if (target.actual_end_child === void 0 || target.actual_end_child !== null && target.actual_end_child.parentNode !== target) {
|
||||||
|
target.actual_end_child = target.firstChild;
|
||||||
|
}
|
||||||
|
while (target.actual_end_child !== null && target.actual_end_child.claim_order === void 0) {
|
||||||
|
target.actual_end_child = target.actual_end_child.nextSibling;
|
||||||
|
}
|
||||||
|
if (node !== target.actual_end_child) {
|
||||||
|
if (node.claim_order !== void 0 || node.parentNode !== target) {
|
||||||
|
target.insertBefore(node, target.actual_end_child);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
target.actual_end_child = node.nextSibling;
|
||||||
|
}
|
||||||
|
} else if (node.parentNode !== target || node.nextSibling !== null) {
|
||||||
|
target.appendChild(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function insert_hydration(target, node, anchor) {
|
||||||
|
if (is_hydrating && !anchor) {
|
||||||
|
append_hydration(target, node);
|
||||||
|
} else if (node.parentNode !== target || node.nextSibling != anchor) {
|
||||||
|
target.insertBefore(node, anchor || null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function detach(node) {
|
||||||
|
if (node.parentNode) {
|
||||||
|
node.parentNode.removeChild(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function destroy_each(iterations, detaching) {
|
||||||
|
for (let i = 0; i < iterations.length; i += 1) {
|
||||||
|
if (iterations[i])
|
||||||
|
iterations[i].d(detaching);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function element(name) {
|
||||||
|
return document.createElement(name);
|
||||||
|
}
|
||||||
|
function svg_element(name) {
|
||||||
|
return document.createElementNS("http://www.w3.org/2000/svg", name);
|
||||||
|
}
|
||||||
|
function text(data) {
|
||||||
|
return document.createTextNode(data);
|
||||||
|
}
|
||||||
|
function space() {
|
||||||
|
return text(" ");
|
||||||
|
}
|
||||||
|
function empty() {
|
||||||
|
return text("");
|
||||||
|
}
|
||||||
|
function listen(node, event, handler, options) {
|
||||||
|
node.addEventListener(event, handler, options);
|
||||||
|
return () => node.removeEventListener(event, handler, options);
|
||||||
|
}
|
||||||
|
function prevent_default(fn) {
|
||||||
|
return function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
return fn.call(this, event);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function attr(node, attribute, value) {
|
||||||
|
if (value == null)
|
||||||
|
node.removeAttribute(attribute);
|
||||||
|
else if (node.getAttribute(attribute) !== value)
|
||||||
|
node.setAttribute(attribute, value);
|
||||||
|
}
|
||||||
|
function children(element2) {
|
||||||
|
return Array.from(element2.childNodes);
|
||||||
|
}
|
||||||
|
function init_claim_info(nodes) {
|
||||||
|
if (nodes.claim_info === void 0) {
|
||||||
|
nodes.claim_info = { last_index: 0, total_claimed: 0 };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {
|
||||||
|
init_claim_info(nodes);
|
||||||
|
const resultNode = (() => {
|
||||||
|
for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {
|
||||||
|
const node = nodes[i];
|
||||||
|
if (predicate(node)) {
|
||||||
|
const replacement = processNode(node);
|
||||||
|
if (replacement === void 0) {
|
||||||
|
nodes.splice(i, 1);
|
||||||
|
} else {
|
||||||
|
nodes[i] = replacement;
|
||||||
|
}
|
||||||
|
if (!dontUpdateLastIndex) {
|
||||||
|
nodes.claim_info.last_index = i;
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {
|
||||||
|
const node = nodes[i];
|
||||||
|
if (predicate(node)) {
|
||||||
|
const replacement = processNode(node);
|
||||||
|
if (replacement === void 0) {
|
||||||
|
nodes.splice(i, 1);
|
||||||
|
} else {
|
||||||
|
nodes[i] = replacement;
|
||||||
|
}
|
||||||
|
if (!dontUpdateLastIndex) {
|
||||||
|
nodes.claim_info.last_index = i;
|
||||||
|
} else if (replacement === void 0) {
|
||||||
|
nodes.claim_info.last_index--;
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return createNode();
|
||||||
|
})();
|
||||||
|
resultNode.claim_order = nodes.claim_info.total_claimed;
|
||||||
|
nodes.claim_info.total_claimed += 1;
|
||||||
|
return resultNode;
|
||||||
|
}
|
||||||
|
function claim_element_base(nodes, name, attributes, create_element) {
|
||||||
|
return claim_node(nodes, (node) => node.nodeName === name, (node) => {
|
||||||
|
const remove = [];
|
||||||
|
for (let j = 0; j < node.attributes.length; j++) {
|
||||||
|
const attribute = node.attributes[j];
|
||||||
|
if (!attributes[attribute.name]) {
|
||||||
|
remove.push(attribute.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remove.forEach((v) => node.removeAttribute(v));
|
||||||
|
return void 0;
|
||||||
|
}, () => create_element(name));
|
||||||
|
}
|
||||||
|
function claim_element(nodes, name, attributes) {
|
||||||
|
return claim_element_base(nodes, name, attributes, element);
|
||||||
|
}
|
||||||
|
function claim_svg_element(nodes, name, attributes) {
|
||||||
|
return claim_element_base(nodes, name, attributes, svg_element);
|
||||||
|
}
|
||||||
|
function claim_text(nodes, data) {
|
||||||
|
return claim_node(
|
||||||
|
nodes,
|
||||||
|
(node) => node.nodeType === 3,
|
||||||
|
(node) => {
|
||||||
|
const dataStr = "" + data;
|
||||||
|
if (node.data.startsWith(dataStr)) {
|
||||||
|
if (node.data.length !== dataStr.length) {
|
||||||
|
return node.splitText(dataStr.length);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
node.data = dataStr;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => text(data),
|
||||||
|
true
|
||||||
|
// Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
|
||||||
|
);
|
||||||
|
}
|
||||||
|
function claim_space(nodes) {
|
||||||
|
return claim_text(nodes, " ");
|
||||||
|
}
|
||||||
|
function set_data(text2, data) {
|
||||||
|
data = "" + data;
|
||||||
|
if (text2.wholeText !== data)
|
||||||
|
text2.data = data;
|
||||||
|
}
|
||||||
|
function set_style(node, key, value, important) {
|
||||||
|
if (value === null) {
|
||||||
|
node.style.removeProperty(key);
|
||||||
|
} else {
|
||||||
|
node.style.setProperty(key, value, important ? "important" : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function toggle_class(element2, name, toggle) {
|
||||||
|
element2.classList[toggle ? "add" : "remove"](name);
|
||||||
|
}
|
||||||
|
function head_selector(nodeId, head) {
|
||||||
|
const result = [];
|
||||||
|
let started = 0;
|
||||||
|
for (const node of head.childNodes) {
|
||||||
|
if (node.nodeType === 8) {
|
||||||
|
const comment = node.textContent.trim();
|
||||||
|
if (comment === `HEAD_${nodeId}_END`) {
|
||||||
|
started -= 1;
|
||||||
|
result.push(node);
|
||||||
|
} else if (comment === `HEAD_${nodeId}_START`) {
|
||||||
|
started += 1;
|
||||||
|
result.push(node);
|
||||||
|
}
|
||||||
|
} else if (started > 0) {
|
||||||
|
result.push(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function construct_svelte_component(component, props) {
|
||||||
|
return new component(props);
|
||||||
|
}
|
||||||
|
let current_component;
|
||||||
|
function set_current_component(component) {
|
||||||
|
current_component = component;
|
||||||
|
}
|
||||||
|
function get_current_component() {
|
||||||
|
if (!current_component)
|
||||||
|
throw new Error("Function called outside component initialization");
|
||||||
|
return current_component;
|
||||||
|
}
|
||||||
|
function onMount(fn) {
|
||||||
|
get_current_component().$$.on_mount.push(fn);
|
||||||
|
}
|
||||||
|
function afterUpdate(fn) {
|
||||||
|
get_current_component().$$.after_update.push(fn);
|
||||||
|
}
|
||||||
|
const dirty_components = [];
|
||||||
|
const binding_callbacks = [];
|
||||||
|
const render_callbacks = [];
|
||||||
|
const flush_callbacks = [];
|
||||||
|
const resolved_promise = Promise.resolve();
|
||||||
|
let update_scheduled = false;
|
||||||
|
function schedule_update() {
|
||||||
|
if (!update_scheduled) {
|
||||||
|
update_scheduled = true;
|
||||||
|
resolved_promise.then(flush);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function tick() {
|
||||||
|
schedule_update();
|
||||||
|
return resolved_promise;
|
||||||
|
}
|
||||||
|
function add_render_callback(fn) {
|
||||||
|
render_callbacks.push(fn);
|
||||||
|
}
|
||||||
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
||||||
|
let flushidx = 0;
|
||||||
|
function flush() {
|
||||||
|
if (flushidx !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const saved_component = current_component;
|
||||||
|
do {
|
||||||
|
try {
|
||||||
|
while (flushidx < dirty_components.length) {
|
||||||
|
const component = dirty_components[flushidx];
|
||||||
|
flushidx++;
|
||||||
|
set_current_component(component);
|
||||||
|
update(component.$$);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
dirty_components.length = 0;
|
||||||
|
flushidx = 0;
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
set_current_component(null);
|
||||||
|
dirty_components.length = 0;
|
||||||
|
flushidx = 0;
|
||||||
|
while (binding_callbacks.length)
|
||||||
|
binding_callbacks.pop()();
|
||||||
|
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||||||
|
const callback = render_callbacks[i];
|
||||||
|
if (!seen_callbacks.has(callback)) {
|
||||||
|
seen_callbacks.add(callback);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
render_callbacks.length = 0;
|
||||||
|
} while (dirty_components.length);
|
||||||
|
while (flush_callbacks.length) {
|
||||||
|
flush_callbacks.pop()();
|
||||||
|
}
|
||||||
|
update_scheduled = false;
|
||||||
|
seen_callbacks.clear();
|
||||||
|
set_current_component(saved_component);
|
||||||
|
}
|
||||||
|
function update($$) {
|
||||||
|
if ($$.fragment !== null) {
|
||||||
|
$$.update();
|
||||||
|
run_all($$.before_update);
|
||||||
|
const dirty = $$.dirty;
|
||||||
|
$$.dirty = [-1];
|
||||||
|
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||||||
|
$$.after_update.forEach(add_render_callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const outroing = /* @__PURE__ */ new Set();
|
||||||
|
let outros;
|
||||||
|
function group_outros() {
|
||||||
|
outros = {
|
||||||
|
r: 0,
|
||||||
|
c: [],
|
||||||
|
p: outros
|
||||||
|
// parent group
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function check_outros() {
|
||||||
|
if (!outros.r) {
|
||||||
|
run_all(outros.c);
|
||||||
|
}
|
||||||
|
outros = outros.p;
|
||||||
|
}
|
||||||
|
function transition_in(block, local) {
|
||||||
|
if (block && block.i) {
|
||||||
|
outroing.delete(block);
|
||||||
|
block.i(local);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function transition_out(block, local, detach2, callback) {
|
||||||
|
if (block && block.o) {
|
||||||
|
if (outroing.has(block))
|
||||||
|
return;
|
||||||
|
outroing.add(block);
|
||||||
|
outros.c.push(() => {
|
||||||
|
outroing.delete(block);
|
||||||
|
if (callback) {
|
||||||
|
if (detach2)
|
||||||
|
block.d(1);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
block.o(local);
|
||||||
|
} else if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
||||||
|
function create_component(block) {
|
||||||
|
block && block.c();
|
||||||
|
}
|
||||||
|
function claim_component(block, parent_nodes) {
|
||||||
|
block && block.l(parent_nodes);
|
||||||
|
}
|
||||||
|
function mount_component(component, target, anchor, customElement) {
|
||||||
|
const { fragment, after_update } = component.$$;
|
||||||
|
fragment && fragment.m(target, anchor);
|
||||||
|
if (!customElement) {
|
||||||
|
add_render_callback(() => {
|
||||||
|
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||||
|
if (component.$$.on_destroy) {
|
||||||
|
component.$$.on_destroy.push(...new_on_destroy);
|
||||||
|
} else {
|
||||||
|
run_all(new_on_destroy);
|
||||||
|
}
|
||||||
|
component.$$.on_mount = [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
after_update.forEach(add_render_callback);
|
||||||
|
}
|
||||||
|
function destroy_component(component, detaching) {
|
||||||
|
const $$ = component.$$;
|
||||||
|
if ($$.fragment !== null) {
|
||||||
|
run_all($$.on_destroy);
|
||||||
|
$$.fragment && $$.fragment.d(detaching);
|
||||||
|
$$.on_destroy = $$.fragment = null;
|
||||||
|
$$.ctx = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function make_dirty(component, i) {
|
||||||
|
if (component.$$.dirty[0] === -1) {
|
||||||
|
dirty_components.push(component);
|
||||||
|
schedule_update();
|
||||||
|
component.$$.dirty.fill(0);
|
||||||
|
}
|
||||||
|
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
||||||
|
}
|
||||||
|
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
|
||||||
|
const parent_component = current_component;
|
||||||
|
set_current_component(component);
|
||||||
|
const $$ = component.$$ = {
|
||||||
|
fragment: null,
|
||||||
|
ctx: [],
|
||||||
|
// state
|
||||||
|
props,
|
||||||
|
update: noop,
|
||||||
|
not_equal,
|
||||||
|
bound: blank_object(),
|
||||||
|
// lifecycle
|
||||||
|
on_mount: [],
|
||||||
|
on_destroy: [],
|
||||||
|
on_disconnect: [],
|
||||||
|
before_update: [],
|
||||||
|
after_update: [],
|
||||||
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||||
|
// everything else
|
||||||
|
callbacks: blank_object(),
|
||||||
|
dirty,
|
||||||
|
skip_bound: false,
|
||||||
|
root: options.target || parent_component.$$.root
|
||||||
|
};
|
||||||
|
append_styles && append_styles($$.root);
|
||||||
|
let ready = false;
|
||||||
|
$$.ctx = instance ? instance(component, options.props || {}, (i, ret, ...rest) => {
|
||||||
|
const value = rest.length ? rest[0] : ret;
|
||||||
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||||||
|
if (!$$.skip_bound && $$.bound[i])
|
||||||
|
$$.bound[i](value);
|
||||||
|
if (ready)
|
||||||
|
make_dirty(component, i);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}) : [];
|
||||||
|
$$.update();
|
||||||
|
ready = true;
|
||||||
|
run_all($$.before_update);
|
||||||
|
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
||||||
|
if (options.target) {
|
||||||
|
if (options.hydrate) {
|
||||||
|
start_hydrating();
|
||||||
|
const nodes = children(options.target);
|
||||||
|
$$.fragment && $$.fragment.l(nodes);
|
||||||
|
nodes.forEach(detach);
|
||||||
|
} else {
|
||||||
|
$$.fragment && $$.fragment.c();
|
||||||
|
}
|
||||||
|
if (options.intro)
|
||||||
|
transition_in(component.$$.fragment);
|
||||||
|
mount_component(component, options.target, options.anchor, options.customElement);
|
||||||
|
end_hydrating();
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
set_current_component(parent_component);
|
||||||
|
}
|
||||||
|
class SvelteComponent {
|
||||||
|
$destroy() {
|
||||||
|
destroy_component(this, 1);
|
||||||
|
this.$destroy = noop;
|
||||||
|
}
|
||||||
|
$on(type, callback) {
|
||||||
|
if (!is_function(callback)) {
|
||||||
|
return noop;
|
||||||
|
}
|
||||||
|
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
||||||
|
callbacks.push(callback);
|
||||||
|
return () => {
|
||||||
|
const index = callbacks.indexOf(callback);
|
||||||
|
if (index !== -1)
|
||||||
|
callbacks.splice(index, 1);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
$set($$props) {
|
||||||
|
if (this.$$set && !is_empty($$props)) {
|
||||||
|
this.$$.skip_bound = true;
|
||||||
|
this.$$set($$props);
|
||||||
|
this.$$.skip_bound = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
destroy_component as A,
|
||||||
|
tick as B,
|
||||||
|
noop as C,
|
||||||
|
svg_element as D,
|
||||||
|
claim_svg_element as E,
|
||||||
|
src_url_equal as F,
|
||||||
|
append_hydration as G,
|
||||||
|
component_subscribe as H,
|
||||||
|
create_slot as I,
|
||||||
|
update_slot_base as J,
|
||||||
|
get_all_dirty_from_scope as K,
|
||||||
|
get_slot_changes as L,
|
||||||
|
now as M,
|
||||||
|
loop as N,
|
||||||
|
listen as O,
|
||||||
|
run_all as P,
|
||||||
|
head_selector as Q,
|
||||||
|
toggle_class as R,
|
||||||
|
SvelteComponent as S,
|
||||||
|
action_destroyer as T,
|
||||||
|
destroy_each as U,
|
||||||
|
globals as V,
|
||||||
|
is_function as W,
|
||||||
|
prevent_default as X,
|
||||||
|
null_to_empty as Y,
|
||||||
|
space as a,
|
||||||
|
insert_hydration as b,
|
||||||
|
claim_space as c,
|
||||||
|
check_outros as d,
|
||||||
|
empty as e,
|
||||||
|
transition_in as f,
|
||||||
|
group_outros as g,
|
||||||
|
detach as h,
|
||||||
|
init as i,
|
||||||
|
afterUpdate as j,
|
||||||
|
element as k,
|
||||||
|
claim_element as l,
|
||||||
|
children as m,
|
||||||
|
attr as n,
|
||||||
|
onMount as o,
|
||||||
|
set_style as p,
|
||||||
|
text as q,
|
||||||
|
claim_text as r,
|
||||||
|
safe_not_equal as s,
|
||||||
|
transition_out as t,
|
||||||
|
set_data as u,
|
||||||
|
binding_callbacks as v,
|
||||||
|
construct_svelte_component as w,
|
||||||
|
create_component as x,
|
||||||
|
claim_component as y,
|
||||||
|
mount_component as z
|
||||||
|
};
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
||||||
|
const UNDEFINED = -1;
|
||||||
|
const HOLE = -2;
|
||||||
|
const NAN = -3;
|
||||||
|
const POSITIVE_INFINITY = -4;
|
||||||
|
const NEGATIVE_INFINITY = -5;
|
||||||
|
const NEGATIVE_ZERO = -6;
|
||||||
|
function parse(serialized, revivers) {
|
||||||
|
return unflatten(JSON.parse(serialized), revivers);
|
||||||
|
}
|
||||||
|
function unflatten(parsed, revivers) {
|
||||||
|
if (typeof parsed === "number")
|
||||||
|
return hydrate(parsed, true);
|
||||||
|
if (!Array.isArray(parsed) || parsed.length === 0) {
|
||||||
|
throw new Error("Invalid input");
|
||||||
|
}
|
||||||
|
const values = (
|
||||||
|
/** @type {any[]} */
|
||||||
|
parsed
|
||||||
|
);
|
||||||
|
const hydrated = Array(values.length);
|
||||||
|
function hydrate(index, standalone = false) {
|
||||||
|
if (index === UNDEFINED)
|
||||||
|
return void 0;
|
||||||
|
if (index === NAN)
|
||||||
|
return NaN;
|
||||||
|
if (index === POSITIVE_INFINITY)
|
||||||
|
return Infinity;
|
||||||
|
if (index === NEGATIVE_INFINITY)
|
||||||
|
return -Infinity;
|
||||||
|
if (index === NEGATIVE_ZERO)
|
||||||
|
return -0;
|
||||||
|
if (standalone)
|
||||||
|
throw new Error(`Invalid input`);
|
||||||
|
if (index in hydrated)
|
||||||
|
return hydrated[index];
|
||||||
|
const value = values[index];
|
||||||
|
if (!value || typeof value !== "object") {
|
||||||
|
hydrated[index] = value;
|
||||||
|
} else if (Array.isArray(value)) {
|
||||||
|
if (typeof value[0] === "string") {
|
||||||
|
const type = value[0];
|
||||||
|
const reviver = revivers == null ? void 0 : revivers[type];
|
||||||
|
if (reviver) {
|
||||||
|
return hydrated[index] = reviver(hydrate(value[1]));
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case "Date":
|
||||||
|
hydrated[index] = new Date(value[1]);
|
||||||
|
break;
|
||||||
|
case "Set":
|
||||||
|
const set = /* @__PURE__ */ new Set();
|
||||||
|
hydrated[index] = set;
|
||||||
|
for (let i = 1; i < value.length; i += 1) {
|
||||||
|
set.add(hydrate(value[i]));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "Map":
|
||||||
|
const map = /* @__PURE__ */ new Map();
|
||||||
|
hydrated[index] = map;
|
||||||
|
for (let i = 1; i < value.length; i += 2) {
|
||||||
|
map.set(hydrate(value[i]), hydrate(value[i + 1]));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "RegExp":
|
||||||
|
hydrated[index] = new RegExp(value[1], value[2]);
|
||||||
|
break;
|
||||||
|
case "Object":
|
||||||
|
hydrated[index] = Object(value[1]);
|
||||||
|
break;
|
||||||
|
case "BigInt":
|
||||||
|
hydrated[index] = BigInt(value[1]);
|
||||||
|
break;
|
||||||
|
case "null":
|
||||||
|
const obj = /* @__PURE__ */ Object.create(null);
|
||||||
|
hydrated[index] = obj;
|
||||||
|
for (let i = 1; i < value.length; i += 2) {
|
||||||
|
obj[value[i]] = hydrate(value[i + 1]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Unknown type ${type}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const array = new Array(value.length);
|
||||||
|
hydrated[index] = array;
|
||||||
|
for (let i = 0; i < value.length; i += 1) {
|
||||||
|
const n = value[i];
|
||||||
|
if (n === HOLE)
|
||||||
|
continue;
|
||||||
|
array[i] = hydrate(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const object = {};
|
||||||
|
hydrated[index] = object;
|
||||||
|
for (const key in value) {
|
||||||
|
const n = value[key];
|
||||||
|
object[key] = hydrate(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hydrated[index];
|
||||||
|
}
|
||||||
|
return hydrate(0);
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
parse as p,
|
||||||
|
unflatten as u
|
||||||
|
};
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
import { w as writable } from "./index-bb582736.js";
|
||||||
|
const base = "";
|
||||||
|
let assets = base;
|
||||||
|
function set_assets(path) {
|
||||||
|
assets = path;
|
||||||
|
}
|
||||||
|
let version = "";
|
||||||
|
function set_version(value) {
|
||||||
|
version = value;
|
||||||
|
}
|
||||||
|
const SNAPSHOT_KEY = "sveltekit:snapshot";
|
||||||
|
const SCROLL_KEY = "sveltekit:scroll";
|
||||||
|
const INDEX_KEY = "sveltekit:index";
|
||||||
|
const PRELOAD_PRIORITIES = (
|
||||||
|
/** @type {const} */
|
||||||
|
{
|
||||||
|
tap: 1,
|
||||||
|
hover: 2,
|
||||||
|
viewport: 3,
|
||||||
|
eager: 4,
|
||||||
|
off: -1
|
||||||
|
}
|
||||||
|
);
|
||||||
|
function get_base_uri(doc) {
|
||||||
|
let baseURI = doc.baseURI;
|
||||||
|
if (!baseURI) {
|
||||||
|
const baseTags = doc.getElementsByTagName("base");
|
||||||
|
baseURI = baseTags.length ? baseTags[0].href : doc.URL;
|
||||||
|
}
|
||||||
|
return baseURI;
|
||||||
|
}
|
||||||
|
function scroll_state() {
|
||||||
|
return {
|
||||||
|
x: pageXOffset,
|
||||||
|
y: pageYOffset
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function link_option(element, name) {
|
||||||
|
const value = (
|
||||||
|
/** @type {ValidLinkOptions<T> | null} */
|
||||||
|
element.getAttribute(`data-sveltekit-${name}`)
|
||||||
|
);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
const levels = {
|
||||||
|
...PRELOAD_PRIORITIES,
|
||||||
|
"": PRELOAD_PRIORITIES.hover
|
||||||
|
};
|
||||||
|
function parent_element(element) {
|
||||||
|
let parent = element.assignedSlot ?? element.parentNode;
|
||||||
|
if ((parent == null ? void 0 : parent.nodeType) === 11)
|
||||||
|
parent = parent.host;
|
||||||
|
return (
|
||||||
|
/** @type {Element} */
|
||||||
|
parent
|
||||||
|
);
|
||||||
|
}
|
||||||
|
function find_anchor(element, target) {
|
||||||
|
while (element && element !== target) {
|
||||||
|
if (element.nodeName.toUpperCase() === "A" && element.hasAttribute("href")) {
|
||||||
|
return (
|
||||||
|
/** @type {HTMLAnchorElement | SVGAElement} */
|
||||||
|
element
|
||||||
|
);
|
||||||
|
}
|
||||||
|
element = /** @type {Element} */
|
||||||
|
parent_element(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_link_info(a, base2) {
|
||||||
|
let url;
|
||||||
|
try {
|
||||||
|
url = new URL(a instanceof SVGAElement ? a.href.baseVal : a.href, document.baseURI);
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
const target = a instanceof SVGAElement ? a.target.baseVal : a.target;
|
||||||
|
const external = !url || !!target || is_external_url(url, base2) || (a.getAttribute("rel") || "").split(/\s+/).includes("external") || a.hasAttribute("download");
|
||||||
|
return { url, external, target };
|
||||||
|
}
|
||||||
|
function get_router_options(element) {
|
||||||
|
let noscroll = null;
|
||||||
|
let preload_code = null;
|
||||||
|
let preload_data = null;
|
||||||
|
let reload = null;
|
||||||
|
let el = element;
|
||||||
|
while (el && el !== document.documentElement) {
|
||||||
|
if (preload_code === null)
|
||||||
|
preload_code = link_option(el, "preload-code");
|
||||||
|
if (preload_data === null)
|
||||||
|
preload_data = link_option(el, "preload-data");
|
||||||
|
if (noscroll === null)
|
||||||
|
noscroll = link_option(el, "noscroll");
|
||||||
|
if (reload === null)
|
||||||
|
reload = link_option(el, "reload");
|
||||||
|
el = /** @type {Element} */
|
||||||
|
parent_element(el);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
preload_code: levels[preload_code ?? "off"],
|
||||||
|
preload_data: levels[preload_data ?? "off"],
|
||||||
|
noscroll: noscroll === "off" ? false : noscroll === "" ? true : null,
|
||||||
|
reload: reload === "off" ? false : reload === "" ? true : null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function notifiable_store(value) {
|
||||||
|
const store = writable(value);
|
||||||
|
let ready = true;
|
||||||
|
function notify() {
|
||||||
|
ready = true;
|
||||||
|
store.update((val) => val);
|
||||||
|
}
|
||||||
|
function set(new_value) {
|
||||||
|
ready = false;
|
||||||
|
store.set(new_value);
|
||||||
|
}
|
||||||
|
function subscribe(run) {
|
||||||
|
let old_value;
|
||||||
|
return store.subscribe((new_value) => {
|
||||||
|
if (old_value === void 0 || ready && new_value !== old_value) {
|
||||||
|
run(old_value = new_value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return { notify, set, subscribe };
|
||||||
|
}
|
||||||
|
function create_updated_store() {
|
||||||
|
const { set, subscribe } = writable(false);
|
||||||
|
let timeout;
|
||||||
|
async function check() {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
const res = await fetch(`${assets}/${"_app/version.json"}`, {
|
||||||
|
headers: {
|
||||||
|
pragma: "no-cache",
|
||||||
|
"cache-control": "no-cache"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (res.ok) {
|
||||||
|
const data = await res.json();
|
||||||
|
const updated = data.version !== version;
|
||||||
|
if (updated) {
|
||||||
|
set(true);
|
||||||
|
clearTimeout(timeout);
|
||||||
|
}
|
||||||
|
return updated;
|
||||||
|
} else {
|
||||||
|
throw new Error(`Version check failed: ${res.status}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
subscribe,
|
||||||
|
check
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function is_external_url(url, base2) {
|
||||||
|
return url.origin !== location.origin || !url.pathname.startsWith(base2);
|
||||||
|
}
|
||||||
|
let client;
|
||||||
|
function init(opts) {
|
||||||
|
client = opts.client;
|
||||||
|
}
|
||||||
|
const stores = {
|
||||||
|
url: notifiable_store({}),
|
||||||
|
page: notifiable_store({}),
|
||||||
|
navigating: writable(
|
||||||
|
/** @type {import('types').Navigation | null} */
|
||||||
|
null
|
||||||
|
),
|
||||||
|
updated: create_updated_store()
|
||||||
|
};
|
||||||
|
export {
|
||||||
|
INDEX_KEY as I,
|
||||||
|
PRELOAD_PRIORITIES as P,
|
||||||
|
SCROLL_KEY as S,
|
||||||
|
SNAPSHOT_KEY as a,
|
||||||
|
get_link_info as b,
|
||||||
|
get_router_options as c,
|
||||||
|
scroll_state as d,
|
||||||
|
base as e,
|
||||||
|
find_anchor as f,
|
||||||
|
get_base_uri as g,
|
||||||
|
init as h,
|
||||||
|
is_external_url as i,
|
||||||
|
set_assets as j,
|
||||||
|
set_version as k,
|
||||||
|
client as l,
|
||||||
|
stores as s
|
||||||
|
};
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import "./index-d985765e.js";
|
||||||
|
import { s as stores } from "./singletons-0c6ee057.js";
|
||||||
|
const getStores = () => {
|
||||||
|
const stores$1 = stores;
|
||||||
|
return {
|
||||||
|
page: {
|
||||||
|
subscribe: stores$1.page.subscribe
|
||||||
|
},
|
||||||
|
navigating: {
|
||||||
|
subscribe: stores$1.navigating.subscribe
|
||||||
|
},
|
||||||
|
updated: stores$1.updated
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const page = {
|
||||||
|
/** @param {(value: any) => void} fn */
|
||||||
|
subscribe(fn) {
|
||||||
|
const store = getStores().page;
|
||||||
|
return store.subscribe(fn);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
export {
|
||||||
|
page as p
|
||||||
|
};
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import { S as SvelteComponent, i as init, s as safe_not_equal, k as element, q as text, a as space, l as claim_element, m as children, r as claim_text, h as detach, c as claim_space, b as insert_hydration, G as append_hydration, u as set_data, C as noop, H as component_subscribe } from "../chunks/index-d985765e.js";
|
||||||
|
import { p as page } from "../chunks/stores-8cac4559.js";
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
var _a;
|
||||||
|
let h1;
|
||||||
|
let t0_value = (
|
||||||
|
/*$page*/
|
||||||
|
ctx[0].status + ""
|
||||||
|
);
|
||||||
|
let t0;
|
||||||
|
let t1;
|
||||||
|
let p;
|
||||||
|
let t2_value = (
|
||||||
|
/*$page*/
|
||||||
|
((_a = ctx[0].error) == null ? void 0 : _a.message) + ""
|
||||||
|
);
|
||||||
|
let t2;
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
h1 = element("h1");
|
||||||
|
t0 = text(t0_value);
|
||||||
|
t1 = space();
|
||||||
|
p = element("p");
|
||||||
|
t2 = text(t2_value);
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
h1 = claim_element(nodes, "H1", {});
|
||||||
|
var h1_nodes = children(h1);
|
||||||
|
t0 = claim_text(h1_nodes, t0_value);
|
||||||
|
h1_nodes.forEach(detach);
|
||||||
|
t1 = claim_space(nodes);
|
||||||
|
p = claim_element(nodes, "P", {});
|
||||||
|
var p_nodes = children(p);
|
||||||
|
t2 = claim_text(p_nodes, t2_value);
|
||||||
|
p_nodes.forEach(detach);
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
insert_hydration(target, h1, anchor);
|
||||||
|
append_hydration(h1, t0);
|
||||||
|
insert_hydration(target, t1, anchor);
|
||||||
|
insert_hydration(target, p, anchor);
|
||||||
|
append_hydration(p, t2);
|
||||||
|
},
|
||||||
|
p(ctx2, [dirty]) {
|
||||||
|
var _a2;
|
||||||
|
if (dirty & /*$page*/
|
||||||
|
1 && t0_value !== (t0_value = /*$page*/
|
||||||
|
ctx2[0].status + ""))
|
||||||
|
set_data(t0, t0_value);
|
||||||
|
if (dirty & /*$page*/
|
||||||
|
1 && t2_value !== (t2_value = /*$page*/
|
||||||
|
((_a2 = ctx2[0].error) == null ? void 0 : _a2.message) + ""))
|
||||||
|
set_data(t2, t2_value);
|
||||||
|
},
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
d(detaching) {
|
||||||
|
if (detaching)
|
||||||
|
detach(h1);
|
||||||
|
if (detaching)
|
||||||
|
detach(t1);
|
||||||
|
if (detaching)
|
||||||
|
detach(p);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function instance($$self, $$props, $$invalidate) {
|
||||||
|
let $page;
|
||||||
|
component_subscribe($$self, page, ($$value) => $$invalidate(0, $page = $$value));
|
||||||
|
return [$page];
|
||||||
|
}
|
||||||
|
class Error extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, instance, create_fragment, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Error as default
|
||||||
|
};
|
||||||
@@ -0,0 +1,409 @@
|
|||||||
|
import { S as SvelteComponent, i as init, s as safe_not_equal, k as element, a as space, D as svg_element, q as text, l as claim_element, m as children, h as detach, c as claim_space, E as claim_svg_element, r as claim_text, F as src_url_equal, n as attr, b as insert_hydration, G as append_hydration, C as noop, H as component_subscribe, I as create_slot, x as create_component, y as claim_component, z as mount_component, J as update_slot_base, K as get_all_dirty_from_scope, L as get_slot_changes, f as transition_in, t as transition_out, A as destroy_component } from "../../chunks/index-d985765e.js";
|
||||||
|
import { p as page } from "../../chunks/stores-8cac4559.js";
|
||||||
|
const logo = "" + new URL("../../assets/svelte-logo-87df40b8.svg", import.meta.url).href;
|
||||||
|
const github = "" + new URL("../../assets/github-1ea8d62e.svg", import.meta.url).href;
|
||||||
|
const Header_svelte_svelte_type_style_lang = "";
|
||||||
|
function create_fragment$1(ctx) {
|
||||||
|
let header;
|
||||||
|
let div0;
|
||||||
|
let a0;
|
||||||
|
let img0;
|
||||||
|
let img0_src_value;
|
||||||
|
let t0;
|
||||||
|
let nav;
|
||||||
|
let svg0;
|
||||||
|
let path0;
|
||||||
|
let t1;
|
||||||
|
let ul;
|
||||||
|
let li0;
|
||||||
|
let a1;
|
||||||
|
let t2;
|
||||||
|
let li0_aria_current_value;
|
||||||
|
let t3;
|
||||||
|
let li1;
|
||||||
|
let a2;
|
||||||
|
let t4;
|
||||||
|
let li1_aria_current_value;
|
||||||
|
let t5;
|
||||||
|
let li2;
|
||||||
|
let a3;
|
||||||
|
let t6;
|
||||||
|
let li2_aria_current_value;
|
||||||
|
let t7;
|
||||||
|
let svg1;
|
||||||
|
let path1;
|
||||||
|
let t8;
|
||||||
|
let div1;
|
||||||
|
let a4;
|
||||||
|
let img1;
|
||||||
|
let img1_src_value;
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
header = element("header");
|
||||||
|
div0 = element("div");
|
||||||
|
a0 = element("a");
|
||||||
|
img0 = element("img");
|
||||||
|
t0 = space();
|
||||||
|
nav = element("nav");
|
||||||
|
svg0 = svg_element("svg");
|
||||||
|
path0 = svg_element("path");
|
||||||
|
t1 = space();
|
||||||
|
ul = element("ul");
|
||||||
|
li0 = element("li");
|
||||||
|
a1 = element("a");
|
||||||
|
t2 = text("Home");
|
||||||
|
t3 = space();
|
||||||
|
li1 = element("li");
|
||||||
|
a2 = element("a");
|
||||||
|
t4 = text("About");
|
||||||
|
t5 = space();
|
||||||
|
li2 = element("li");
|
||||||
|
a3 = element("a");
|
||||||
|
t6 = text("Sverdle");
|
||||||
|
t7 = space();
|
||||||
|
svg1 = svg_element("svg");
|
||||||
|
path1 = svg_element("path");
|
||||||
|
t8 = space();
|
||||||
|
div1 = element("div");
|
||||||
|
a4 = element("a");
|
||||||
|
img1 = element("img");
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
header = claim_element(nodes, "HEADER", { class: true });
|
||||||
|
var header_nodes = children(header);
|
||||||
|
div0 = claim_element(header_nodes, "DIV", { class: true });
|
||||||
|
var div0_nodes = children(div0);
|
||||||
|
a0 = claim_element(div0_nodes, "A", { href: true, class: true });
|
||||||
|
var a0_nodes = children(a0);
|
||||||
|
img0 = claim_element(a0_nodes, "IMG", { src: true, alt: true, class: true });
|
||||||
|
a0_nodes.forEach(detach);
|
||||||
|
div0_nodes.forEach(detach);
|
||||||
|
t0 = claim_space(header_nodes);
|
||||||
|
nav = claim_element(header_nodes, "NAV", { class: true });
|
||||||
|
var nav_nodes = children(nav);
|
||||||
|
svg0 = claim_svg_element(nav_nodes, "svg", {
|
||||||
|
viewBox: true,
|
||||||
|
"aria-hidden": true,
|
||||||
|
class: true
|
||||||
|
});
|
||||||
|
var svg0_nodes = children(svg0);
|
||||||
|
path0 = claim_svg_element(svg0_nodes, "path", { d: true, class: true });
|
||||||
|
children(path0).forEach(detach);
|
||||||
|
svg0_nodes.forEach(detach);
|
||||||
|
t1 = claim_space(nav_nodes);
|
||||||
|
ul = claim_element(nav_nodes, "UL", { class: true });
|
||||||
|
var ul_nodes = children(ul);
|
||||||
|
li0 = claim_element(ul_nodes, "LI", { "aria-current": true, class: true });
|
||||||
|
var li0_nodes = children(li0);
|
||||||
|
a1 = claim_element(li0_nodes, "A", { href: true, class: true });
|
||||||
|
var a1_nodes = children(a1);
|
||||||
|
t2 = claim_text(a1_nodes, "Home");
|
||||||
|
a1_nodes.forEach(detach);
|
||||||
|
li0_nodes.forEach(detach);
|
||||||
|
t3 = claim_space(ul_nodes);
|
||||||
|
li1 = claim_element(ul_nodes, "LI", { "aria-current": true, class: true });
|
||||||
|
var li1_nodes = children(li1);
|
||||||
|
a2 = claim_element(li1_nodes, "A", { href: true, class: true });
|
||||||
|
var a2_nodes = children(a2);
|
||||||
|
t4 = claim_text(a2_nodes, "About");
|
||||||
|
a2_nodes.forEach(detach);
|
||||||
|
li1_nodes.forEach(detach);
|
||||||
|
t5 = claim_space(ul_nodes);
|
||||||
|
li2 = claim_element(ul_nodes, "LI", { "aria-current": true, class: true });
|
||||||
|
var li2_nodes = children(li2);
|
||||||
|
a3 = claim_element(li2_nodes, "A", { href: true, class: true });
|
||||||
|
var a3_nodes = children(a3);
|
||||||
|
t6 = claim_text(a3_nodes, "Sverdle");
|
||||||
|
a3_nodes.forEach(detach);
|
||||||
|
li2_nodes.forEach(detach);
|
||||||
|
ul_nodes.forEach(detach);
|
||||||
|
t7 = claim_space(nav_nodes);
|
||||||
|
svg1 = claim_svg_element(nav_nodes, "svg", {
|
||||||
|
viewBox: true,
|
||||||
|
"aria-hidden": true,
|
||||||
|
class: true
|
||||||
|
});
|
||||||
|
var svg1_nodes = children(svg1);
|
||||||
|
path1 = claim_svg_element(svg1_nodes, "path", { d: true, class: true });
|
||||||
|
children(path1).forEach(detach);
|
||||||
|
svg1_nodes.forEach(detach);
|
||||||
|
nav_nodes.forEach(detach);
|
||||||
|
t8 = claim_space(header_nodes);
|
||||||
|
div1 = claim_element(header_nodes, "DIV", { class: true });
|
||||||
|
var div1_nodes = children(div1);
|
||||||
|
a4 = claim_element(div1_nodes, "A", { href: true, class: true });
|
||||||
|
var a4_nodes = children(a4);
|
||||||
|
img1 = claim_element(a4_nodes, "IMG", { src: true, alt: true, class: true });
|
||||||
|
a4_nodes.forEach(detach);
|
||||||
|
div1_nodes.forEach(detach);
|
||||||
|
header_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
if (!src_url_equal(img0.src, img0_src_value = logo))
|
||||||
|
attr(img0, "src", img0_src_value);
|
||||||
|
attr(img0, "alt", "SvelteKit");
|
||||||
|
attr(img0, "class", "svelte-1u9z1tp");
|
||||||
|
attr(a0, "href", "https://kit.svelte.dev");
|
||||||
|
attr(a0, "class", "svelte-1u9z1tp");
|
||||||
|
attr(div0, "class", "corner svelte-1u9z1tp");
|
||||||
|
attr(path0, "d", "M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z");
|
||||||
|
attr(path0, "class", "svelte-1u9z1tp");
|
||||||
|
attr(svg0, "viewBox", "0 0 2 3");
|
||||||
|
attr(svg0, "aria-hidden", "true");
|
||||||
|
attr(svg0, "class", "svelte-1u9z1tp");
|
||||||
|
attr(a1, "href", "/");
|
||||||
|
attr(a1, "class", "svelte-1u9z1tp");
|
||||||
|
attr(li0, "aria-current", li0_aria_current_value = /*$page*/
|
||||||
|
ctx[0].url.pathname === "/" ? "page" : void 0);
|
||||||
|
attr(li0, "class", "svelte-1u9z1tp");
|
||||||
|
attr(a2, "href", "/about");
|
||||||
|
attr(a2, "class", "svelte-1u9z1tp");
|
||||||
|
attr(li1, "aria-current", li1_aria_current_value = /*$page*/
|
||||||
|
ctx[0].url.pathname === "/about" ? "page" : void 0);
|
||||||
|
attr(li1, "class", "svelte-1u9z1tp");
|
||||||
|
attr(a3, "href", "/sverdle");
|
||||||
|
attr(a3, "class", "svelte-1u9z1tp");
|
||||||
|
attr(li2, "aria-current", li2_aria_current_value = /*$page*/
|
||||||
|
ctx[0].url.pathname.startsWith("/sverdle") ? "page" : void 0);
|
||||||
|
attr(li2, "class", "svelte-1u9z1tp");
|
||||||
|
attr(ul, "class", "svelte-1u9z1tp");
|
||||||
|
attr(path1, "d", "M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z");
|
||||||
|
attr(path1, "class", "svelte-1u9z1tp");
|
||||||
|
attr(svg1, "viewBox", "0 0 2 3");
|
||||||
|
attr(svg1, "aria-hidden", "true");
|
||||||
|
attr(svg1, "class", "svelte-1u9z1tp");
|
||||||
|
attr(nav, "class", "svelte-1u9z1tp");
|
||||||
|
if (!src_url_equal(img1.src, img1_src_value = github))
|
||||||
|
attr(img1, "src", img1_src_value);
|
||||||
|
attr(img1, "alt", "GitHub");
|
||||||
|
attr(img1, "class", "svelte-1u9z1tp");
|
||||||
|
attr(a4, "href", "https://github.com/sveltejs/kit");
|
||||||
|
attr(a4, "class", "svelte-1u9z1tp");
|
||||||
|
attr(div1, "class", "corner svelte-1u9z1tp");
|
||||||
|
attr(header, "class", "svelte-1u9z1tp");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
insert_hydration(target, header, anchor);
|
||||||
|
append_hydration(header, div0);
|
||||||
|
append_hydration(div0, a0);
|
||||||
|
append_hydration(a0, img0);
|
||||||
|
append_hydration(header, t0);
|
||||||
|
append_hydration(header, nav);
|
||||||
|
append_hydration(nav, svg0);
|
||||||
|
append_hydration(svg0, path0);
|
||||||
|
append_hydration(nav, t1);
|
||||||
|
append_hydration(nav, ul);
|
||||||
|
append_hydration(ul, li0);
|
||||||
|
append_hydration(li0, a1);
|
||||||
|
append_hydration(a1, t2);
|
||||||
|
append_hydration(ul, t3);
|
||||||
|
append_hydration(ul, li1);
|
||||||
|
append_hydration(li1, a2);
|
||||||
|
append_hydration(a2, t4);
|
||||||
|
append_hydration(ul, t5);
|
||||||
|
append_hydration(ul, li2);
|
||||||
|
append_hydration(li2, a3);
|
||||||
|
append_hydration(a3, t6);
|
||||||
|
append_hydration(nav, t7);
|
||||||
|
append_hydration(nav, svg1);
|
||||||
|
append_hydration(svg1, path1);
|
||||||
|
append_hydration(header, t8);
|
||||||
|
append_hydration(header, div1);
|
||||||
|
append_hydration(div1, a4);
|
||||||
|
append_hydration(a4, img1);
|
||||||
|
},
|
||||||
|
p(ctx2, [dirty]) {
|
||||||
|
if (dirty & /*$page*/
|
||||||
|
1 && li0_aria_current_value !== (li0_aria_current_value = /*$page*/
|
||||||
|
ctx2[0].url.pathname === "/" ? "page" : void 0)) {
|
||||||
|
attr(li0, "aria-current", li0_aria_current_value);
|
||||||
|
}
|
||||||
|
if (dirty & /*$page*/
|
||||||
|
1 && li1_aria_current_value !== (li1_aria_current_value = /*$page*/
|
||||||
|
ctx2[0].url.pathname === "/about" ? "page" : void 0)) {
|
||||||
|
attr(li1, "aria-current", li1_aria_current_value);
|
||||||
|
}
|
||||||
|
if (dirty & /*$page*/
|
||||||
|
1 && li2_aria_current_value !== (li2_aria_current_value = /*$page*/
|
||||||
|
ctx2[0].url.pathname.startsWith("/sverdle") ? "page" : void 0)) {
|
||||||
|
attr(li2, "aria-current", li2_aria_current_value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
d(detaching) {
|
||||||
|
if (detaching)
|
||||||
|
detach(header);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function instance$1($$self, $$props, $$invalidate) {
|
||||||
|
let $page;
|
||||||
|
component_subscribe($$self, page, ($$value) => $$invalidate(0, $page = $$value));
|
||||||
|
return [$page];
|
||||||
|
}
|
||||||
|
class Header extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const styles = "";
|
||||||
|
const _layout_svelte_svelte_type_style_lang = "";
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
let div;
|
||||||
|
let header;
|
||||||
|
let t0;
|
||||||
|
let main;
|
||||||
|
let t1;
|
||||||
|
let footer;
|
||||||
|
let p;
|
||||||
|
let t2;
|
||||||
|
let a;
|
||||||
|
let t3;
|
||||||
|
let t4;
|
||||||
|
let current;
|
||||||
|
header = new Header({});
|
||||||
|
const default_slot_template = (
|
||||||
|
/*#slots*/
|
||||||
|
ctx[1].default
|
||||||
|
);
|
||||||
|
const default_slot = create_slot(
|
||||||
|
default_slot_template,
|
||||||
|
ctx,
|
||||||
|
/*$$scope*/
|
||||||
|
ctx[0],
|
||||||
|
null
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
div = element("div");
|
||||||
|
create_component(header.$$.fragment);
|
||||||
|
t0 = space();
|
||||||
|
main = element("main");
|
||||||
|
if (default_slot)
|
||||||
|
default_slot.c();
|
||||||
|
t1 = space();
|
||||||
|
footer = element("footer");
|
||||||
|
p = element("p");
|
||||||
|
t2 = text("visit ");
|
||||||
|
a = element("a");
|
||||||
|
t3 = text("kit.svelte.dev");
|
||||||
|
t4 = text(" to learn SvelteKit");
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
div = claim_element(nodes, "DIV", { class: true });
|
||||||
|
var div_nodes = children(div);
|
||||||
|
claim_component(header.$$.fragment, div_nodes);
|
||||||
|
t0 = claim_space(div_nodes);
|
||||||
|
main = claim_element(div_nodes, "MAIN", { class: true });
|
||||||
|
var main_nodes = children(main);
|
||||||
|
if (default_slot)
|
||||||
|
default_slot.l(main_nodes);
|
||||||
|
main_nodes.forEach(detach);
|
||||||
|
t1 = claim_space(div_nodes);
|
||||||
|
footer = claim_element(div_nodes, "FOOTER", { class: true });
|
||||||
|
var footer_nodes = children(footer);
|
||||||
|
p = claim_element(footer_nodes, "P", {});
|
||||||
|
var p_nodes = children(p);
|
||||||
|
t2 = claim_text(p_nodes, "visit ");
|
||||||
|
a = claim_element(p_nodes, "A", { href: true, class: true });
|
||||||
|
var a_nodes = children(a);
|
||||||
|
t3 = claim_text(a_nodes, "kit.svelte.dev");
|
||||||
|
a_nodes.forEach(detach);
|
||||||
|
t4 = claim_text(p_nodes, " to learn SvelteKit");
|
||||||
|
p_nodes.forEach(detach);
|
||||||
|
footer_nodes.forEach(detach);
|
||||||
|
div_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
attr(main, "class", "svelte-8o1gnw");
|
||||||
|
attr(a, "href", "https://kit.svelte.dev");
|
||||||
|
attr(a, "class", "svelte-8o1gnw");
|
||||||
|
attr(footer, "class", "svelte-8o1gnw");
|
||||||
|
attr(div, "class", "app svelte-8o1gnw");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
insert_hydration(target, div, anchor);
|
||||||
|
mount_component(header, div, null);
|
||||||
|
append_hydration(div, t0);
|
||||||
|
append_hydration(div, main);
|
||||||
|
if (default_slot) {
|
||||||
|
default_slot.m(main, null);
|
||||||
|
}
|
||||||
|
append_hydration(div, t1);
|
||||||
|
append_hydration(div, footer);
|
||||||
|
append_hydration(footer, p);
|
||||||
|
append_hydration(p, t2);
|
||||||
|
append_hydration(p, a);
|
||||||
|
append_hydration(a, t3);
|
||||||
|
append_hydration(p, t4);
|
||||||
|
current = true;
|
||||||
|
},
|
||||||
|
p(ctx2, [dirty]) {
|
||||||
|
if (default_slot) {
|
||||||
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
||||||
|
1)) {
|
||||||
|
update_slot_base(
|
||||||
|
default_slot,
|
||||||
|
default_slot_template,
|
||||||
|
ctx2,
|
||||||
|
/*$$scope*/
|
||||||
|
ctx2[0],
|
||||||
|
!current ? get_all_dirty_from_scope(
|
||||||
|
/*$$scope*/
|
||||||
|
ctx2[0]
|
||||||
|
) : get_slot_changes(
|
||||||
|
default_slot_template,
|
||||||
|
/*$$scope*/
|
||||||
|
ctx2[0],
|
||||||
|
dirty,
|
||||||
|
null
|
||||||
|
),
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
i(local) {
|
||||||
|
if (current)
|
||||||
|
return;
|
||||||
|
transition_in(header.$$.fragment, local);
|
||||||
|
transition_in(default_slot, local);
|
||||||
|
current = true;
|
||||||
|
},
|
||||||
|
o(local) {
|
||||||
|
transition_out(header.$$.fragment, local);
|
||||||
|
transition_out(default_slot, local);
|
||||||
|
current = false;
|
||||||
|
},
|
||||||
|
d(detaching) {
|
||||||
|
if (detaching)
|
||||||
|
detach(div);
|
||||||
|
destroy_component(header);
|
||||||
|
if (default_slot)
|
||||||
|
default_slot.d(detaching);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function instance($$self, $$props, $$invalidate) {
|
||||||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||||||
|
$$self.$$set = ($$props2) => {
|
||||||
|
if ("$$scope" in $$props2)
|
||||||
|
$$invalidate(0, $$scope = $$props2.$$scope);
|
||||||
|
};
|
||||||
|
return [$$scope, slots];
|
||||||
|
}
|
||||||
|
class Layout extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, instance, create_fragment, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Layout as default
|
||||||
|
};
|
||||||
@@ -0,0 +1,469 @@
|
|||||||
|
import { M as now, N as loop, S as SvelteComponent, i as init, s as safe_not_equal, k as element, D as svg_element, a as space, q as text, l as claim_element, m as children, E as claim_svg_element, h as detach, c as claim_space, r as claim_text, n as attr, p as set_style, b as insert_hydration, G as append_hydration, O as listen, u as set_data, C as noop, P as run_all, H as component_subscribe, x as create_component, Q as head_selector, y as claim_component, F as src_url_equal, z as mount_component, f as transition_in, t as transition_out, A as destroy_component } from "../../chunks/index-d985765e.js";
|
||||||
|
import { w as writable } from "../../chunks/index-bb582736.js";
|
||||||
|
function is_date(obj) {
|
||||||
|
return Object.prototype.toString.call(obj) === "[object Date]";
|
||||||
|
}
|
||||||
|
function tick_spring(ctx, last_value, current_value, target_value) {
|
||||||
|
if (typeof current_value === "number" || is_date(current_value)) {
|
||||||
|
const delta = target_value - current_value;
|
||||||
|
const velocity = (current_value - last_value) / (ctx.dt || 1 / 60);
|
||||||
|
const spring2 = ctx.opts.stiffness * delta;
|
||||||
|
const damper = ctx.opts.damping * velocity;
|
||||||
|
const acceleration = (spring2 - damper) * ctx.inv_mass;
|
||||||
|
const d = (velocity + acceleration) * ctx.dt;
|
||||||
|
if (Math.abs(d) < ctx.opts.precision && Math.abs(delta) < ctx.opts.precision) {
|
||||||
|
return target_value;
|
||||||
|
} else {
|
||||||
|
ctx.settled = false;
|
||||||
|
return is_date(current_value) ? new Date(current_value.getTime() + d) : current_value + d;
|
||||||
|
}
|
||||||
|
} else if (Array.isArray(current_value)) {
|
||||||
|
return current_value.map((_, i) => tick_spring(ctx, last_value[i], current_value[i], target_value[i]));
|
||||||
|
} else if (typeof current_value === "object") {
|
||||||
|
const next_value = {};
|
||||||
|
for (const k in current_value) {
|
||||||
|
next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]);
|
||||||
|
}
|
||||||
|
return next_value;
|
||||||
|
} else {
|
||||||
|
throw new Error(`Cannot spring ${typeof current_value} values`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function spring(value, opts = {}) {
|
||||||
|
const store = writable(value);
|
||||||
|
const { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts;
|
||||||
|
let last_time;
|
||||||
|
let task;
|
||||||
|
let current_token;
|
||||||
|
let last_value = value;
|
||||||
|
let target_value = value;
|
||||||
|
let inv_mass = 1;
|
||||||
|
let inv_mass_recovery_rate = 0;
|
||||||
|
let cancel_task = false;
|
||||||
|
function set(new_value, opts2 = {}) {
|
||||||
|
target_value = new_value;
|
||||||
|
const token = current_token = {};
|
||||||
|
if (value == null || opts2.hard || spring2.stiffness >= 1 && spring2.damping >= 1) {
|
||||||
|
cancel_task = true;
|
||||||
|
last_time = now();
|
||||||
|
last_value = new_value;
|
||||||
|
store.set(value = target_value);
|
||||||
|
return Promise.resolve();
|
||||||
|
} else if (opts2.soft) {
|
||||||
|
const rate = opts2.soft === true ? 0.5 : +opts2.soft;
|
||||||
|
inv_mass_recovery_rate = 1 / (rate * 60);
|
||||||
|
inv_mass = 0;
|
||||||
|
}
|
||||||
|
if (!task) {
|
||||||
|
last_time = now();
|
||||||
|
cancel_task = false;
|
||||||
|
task = loop((now2) => {
|
||||||
|
if (cancel_task) {
|
||||||
|
cancel_task = false;
|
||||||
|
task = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
inv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1);
|
||||||
|
const ctx = {
|
||||||
|
inv_mass,
|
||||||
|
opts: spring2,
|
||||||
|
settled: true,
|
||||||
|
dt: (now2 - last_time) * 60 / 1e3
|
||||||
|
};
|
||||||
|
const next_value = tick_spring(ctx, last_value, value, target_value);
|
||||||
|
last_time = now2;
|
||||||
|
last_value = value;
|
||||||
|
store.set(value = next_value);
|
||||||
|
if (ctx.settled) {
|
||||||
|
task = null;
|
||||||
|
}
|
||||||
|
return !ctx.settled;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new Promise((fulfil) => {
|
||||||
|
task.promise.then(() => {
|
||||||
|
if (token === current_token)
|
||||||
|
fulfil();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const spring2 = {
|
||||||
|
set,
|
||||||
|
update: (fn, opts2) => set(fn(target_value, value), opts2),
|
||||||
|
subscribe: store.subscribe,
|
||||||
|
stiffness,
|
||||||
|
damping,
|
||||||
|
precision
|
||||||
|
};
|
||||||
|
return spring2;
|
||||||
|
}
|
||||||
|
const Counter_svelte_svelte_type_style_lang = "";
|
||||||
|
function create_fragment$1(ctx) {
|
||||||
|
let div2;
|
||||||
|
let button0;
|
||||||
|
let svg0;
|
||||||
|
let path0;
|
||||||
|
let t0;
|
||||||
|
let div1;
|
||||||
|
let div0;
|
||||||
|
let strong0;
|
||||||
|
let t1_value = Math.floor(
|
||||||
|
/*$displayed_count*/
|
||||||
|
ctx[1] + 1
|
||||||
|
) + "";
|
||||||
|
let t1;
|
||||||
|
let t2;
|
||||||
|
let strong1;
|
||||||
|
let t3_value = Math.floor(
|
||||||
|
/*$displayed_count*/
|
||||||
|
ctx[1]
|
||||||
|
) + "";
|
||||||
|
let t3;
|
||||||
|
let t4;
|
||||||
|
let button1;
|
||||||
|
let svg1;
|
||||||
|
let path1;
|
||||||
|
let mounted;
|
||||||
|
let dispose;
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
div2 = element("div");
|
||||||
|
button0 = element("button");
|
||||||
|
svg0 = svg_element("svg");
|
||||||
|
path0 = svg_element("path");
|
||||||
|
t0 = space();
|
||||||
|
div1 = element("div");
|
||||||
|
div0 = element("div");
|
||||||
|
strong0 = element("strong");
|
||||||
|
t1 = text(t1_value);
|
||||||
|
t2 = space();
|
||||||
|
strong1 = element("strong");
|
||||||
|
t3 = text(t3_value);
|
||||||
|
t4 = space();
|
||||||
|
button1 = element("button");
|
||||||
|
svg1 = svg_element("svg");
|
||||||
|
path1 = svg_element("path");
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
div2 = claim_element(nodes, "DIV", { class: true });
|
||||||
|
var div2_nodes = children(div2);
|
||||||
|
button0 = claim_element(div2_nodes, "BUTTON", { "aria-label": true, class: true });
|
||||||
|
var button0_nodes = children(button0);
|
||||||
|
svg0 = claim_svg_element(button0_nodes, "svg", {
|
||||||
|
"aria-hidden": true,
|
||||||
|
viewBox: true,
|
||||||
|
class: true
|
||||||
|
});
|
||||||
|
var svg0_nodes = children(svg0);
|
||||||
|
path0 = claim_svg_element(svg0_nodes, "path", { d: true, class: true });
|
||||||
|
children(path0).forEach(detach);
|
||||||
|
svg0_nodes.forEach(detach);
|
||||||
|
button0_nodes.forEach(detach);
|
||||||
|
t0 = claim_space(div2_nodes);
|
||||||
|
div1 = claim_element(div2_nodes, "DIV", { class: true });
|
||||||
|
var div1_nodes = children(div1);
|
||||||
|
div0 = claim_element(div1_nodes, "DIV", { class: true, style: true });
|
||||||
|
var div0_nodes = children(div0);
|
||||||
|
strong0 = claim_element(div0_nodes, "STRONG", { class: true, "aria-hidden": true });
|
||||||
|
var strong0_nodes = children(strong0);
|
||||||
|
t1 = claim_text(strong0_nodes, t1_value);
|
||||||
|
strong0_nodes.forEach(detach);
|
||||||
|
t2 = claim_space(div0_nodes);
|
||||||
|
strong1 = claim_element(div0_nodes, "STRONG", { class: true });
|
||||||
|
var strong1_nodes = children(strong1);
|
||||||
|
t3 = claim_text(strong1_nodes, t3_value);
|
||||||
|
strong1_nodes.forEach(detach);
|
||||||
|
div0_nodes.forEach(detach);
|
||||||
|
div1_nodes.forEach(detach);
|
||||||
|
t4 = claim_space(div2_nodes);
|
||||||
|
button1 = claim_element(div2_nodes, "BUTTON", { "aria-label": true, class: true });
|
||||||
|
var button1_nodes = children(button1);
|
||||||
|
svg1 = claim_svg_element(button1_nodes, "svg", {
|
||||||
|
"aria-hidden": true,
|
||||||
|
viewBox: true,
|
||||||
|
class: true
|
||||||
|
});
|
||||||
|
var svg1_nodes = children(svg1);
|
||||||
|
path1 = claim_svg_element(svg1_nodes, "path", { d: true, class: true });
|
||||||
|
children(path1).forEach(detach);
|
||||||
|
svg1_nodes.forEach(detach);
|
||||||
|
button1_nodes.forEach(detach);
|
||||||
|
div2_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
attr(path0, "d", "M0,0.5 L1,0.5");
|
||||||
|
attr(path0, "class", "svelte-y96mxt");
|
||||||
|
attr(svg0, "aria-hidden", "true");
|
||||||
|
attr(svg0, "viewBox", "0 0 1 1");
|
||||||
|
attr(svg0, "class", "svelte-y96mxt");
|
||||||
|
attr(button0, "aria-label", "Decrease the counter by one");
|
||||||
|
attr(button0, "class", "svelte-y96mxt");
|
||||||
|
attr(strong0, "class", "hidden svelte-y96mxt");
|
||||||
|
attr(strong0, "aria-hidden", "true");
|
||||||
|
attr(strong1, "class", "svelte-y96mxt");
|
||||||
|
attr(div0, "class", "counter-digits svelte-y96mxt");
|
||||||
|
set_style(div0, "transform", "translate(0, " + 100 * /*offset*/
|
||||||
|
ctx[2] + "%)");
|
||||||
|
attr(div1, "class", "counter-viewport svelte-y96mxt");
|
||||||
|
attr(path1, "d", "M0,0.5 L1,0.5 M0.5,0 L0.5,1");
|
||||||
|
attr(path1, "class", "svelte-y96mxt");
|
||||||
|
attr(svg1, "aria-hidden", "true");
|
||||||
|
attr(svg1, "viewBox", "0 0 1 1");
|
||||||
|
attr(svg1, "class", "svelte-y96mxt");
|
||||||
|
attr(button1, "aria-label", "Increase the counter by one");
|
||||||
|
attr(button1, "class", "svelte-y96mxt");
|
||||||
|
attr(div2, "class", "counter svelte-y96mxt");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
insert_hydration(target, div2, anchor);
|
||||||
|
append_hydration(div2, button0);
|
||||||
|
append_hydration(button0, svg0);
|
||||||
|
append_hydration(svg0, path0);
|
||||||
|
append_hydration(div2, t0);
|
||||||
|
append_hydration(div2, div1);
|
||||||
|
append_hydration(div1, div0);
|
||||||
|
append_hydration(div0, strong0);
|
||||||
|
append_hydration(strong0, t1);
|
||||||
|
append_hydration(div0, t2);
|
||||||
|
append_hydration(div0, strong1);
|
||||||
|
append_hydration(strong1, t3);
|
||||||
|
append_hydration(div2, t4);
|
||||||
|
append_hydration(div2, button1);
|
||||||
|
append_hydration(button1, svg1);
|
||||||
|
append_hydration(svg1, path1);
|
||||||
|
if (!mounted) {
|
||||||
|
dispose = [
|
||||||
|
listen(
|
||||||
|
button0,
|
||||||
|
"click",
|
||||||
|
/*click_handler*/
|
||||||
|
ctx[4]
|
||||||
|
),
|
||||||
|
listen(
|
||||||
|
button1,
|
||||||
|
"click",
|
||||||
|
/*click_handler_1*/
|
||||||
|
ctx[5]
|
||||||
|
)
|
||||||
|
];
|
||||||
|
mounted = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
p(ctx2, [dirty]) {
|
||||||
|
if (dirty & /*$displayed_count*/
|
||||||
|
2 && t1_value !== (t1_value = Math.floor(
|
||||||
|
/*$displayed_count*/
|
||||||
|
ctx2[1] + 1
|
||||||
|
) + ""))
|
||||||
|
set_data(t1, t1_value);
|
||||||
|
if (dirty & /*$displayed_count*/
|
||||||
|
2 && t3_value !== (t3_value = Math.floor(
|
||||||
|
/*$displayed_count*/
|
||||||
|
ctx2[1]
|
||||||
|
) + ""))
|
||||||
|
set_data(t3, t3_value);
|
||||||
|
if (dirty & /*offset*/
|
||||||
|
4) {
|
||||||
|
set_style(div0, "transform", "translate(0, " + 100 * /*offset*/
|
||||||
|
ctx2[2] + "%)");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
d(detaching) {
|
||||||
|
if (detaching)
|
||||||
|
detach(div2);
|
||||||
|
mounted = false;
|
||||||
|
run_all(dispose);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function modulo(n, m) {
|
||||||
|
return (n % m + m) % m;
|
||||||
|
}
|
||||||
|
function instance($$self, $$props, $$invalidate) {
|
||||||
|
let offset;
|
||||||
|
let $displayed_count;
|
||||||
|
let count = 0;
|
||||||
|
const displayed_count = spring();
|
||||||
|
component_subscribe($$self, displayed_count, (value) => $$invalidate(1, $displayed_count = value));
|
||||||
|
const click_handler = () => $$invalidate(0, count -= 1);
|
||||||
|
const click_handler_1 = () => $$invalidate(0, count += 1);
|
||||||
|
$$self.$$.update = () => {
|
||||||
|
if ($$self.$$.dirty & /*count*/
|
||||||
|
1) {
|
||||||
|
displayed_count.set(count);
|
||||||
|
}
|
||||||
|
if ($$self.$$.dirty & /*$displayed_count*/
|
||||||
|
2) {
|
||||||
|
$$invalidate(2, offset = modulo($displayed_count, 1));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return [
|
||||||
|
count,
|
||||||
|
$displayed_count,
|
||||||
|
offset,
|
||||||
|
displayed_count,
|
||||||
|
click_handler,
|
||||||
|
click_handler_1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
class Counter extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, instance, create_fragment$1, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const welcome = "" + new URL("../../assets/svelte-welcome-c18bcf5a.webp", import.meta.url).href;
|
||||||
|
const welcome_fallback = "" + new URL("../../assets/svelte-welcome-6c300099.png", import.meta.url).href;
|
||||||
|
const _page_svelte_svelte_type_style_lang = "";
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
let meta;
|
||||||
|
let t0;
|
||||||
|
let section;
|
||||||
|
let h1;
|
||||||
|
let span;
|
||||||
|
let picture;
|
||||||
|
let source;
|
||||||
|
let t1;
|
||||||
|
let img;
|
||||||
|
let img_src_value;
|
||||||
|
let t2;
|
||||||
|
let br;
|
||||||
|
let t3;
|
||||||
|
let t4;
|
||||||
|
let h2;
|
||||||
|
let t5;
|
||||||
|
let strong;
|
||||||
|
let t6;
|
||||||
|
let t7;
|
||||||
|
let counter;
|
||||||
|
let current;
|
||||||
|
counter = new Counter({});
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
meta = element("meta");
|
||||||
|
t0 = space();
|
||||||
|
section = element("section");
|
||||||
|
h1 = element("h1");
|
||||||
|
span = element("span");
|
||||||
|
picture = element("picture");
|
||||||
|
source = element("source");
|
||||||
|
t1 = space();
|
||||||
|
img = element("img");
|
||||||
|
t2 = text("\n\n to your new");
|
||||||
|
br = element("br");
|
||||||
|
t3 = text("SvelteKit app");
|
||||||
|
t4 = space();
|
||||||
|
h2 = element("h2");
|
||||||
|
t5 = text("try editing ");
|
||||||
|
strong = element("strong");
|
||||||
|
t6 = text("src/routes/+page.svelte");
|
||||||
|
t7 = space();
|
||||||
|
create_component(counter.$$.fragment);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
const head_nodes = head_selector("svelte-t32ptj", document.head);
|
||||||
|
meta = claim_element(head_nodes, "META", { name: true, content: true });
|
||||||
|
head_nodes.forEach(detach);
|
||||||
|
t0 = claim_space(nodes);
|
||||||
|
section = claim_element(nodes, "SECTION", { class: true });
|
||||||
|
var section_nodes = children(section);
|
||||||
|
h1 = claim_element(section_nodes, "H1", { class: true });
|
||||||
|
var h1_nodes = children(h1);
|
||||||
|
span = claim_element(h1_nodes, "SPAN", { class: true });
|
||||||
|
var span_nodes = children(span);
|
||||||
|
picture = claim_element(span_nodes, "PICTURE", {});
|
||||||
|
var picture_nodes = children(picture);
|
||||||
|
source = claim_element(picture_nodes, "SOURCE", { srcset: true, type: true });
|
||||||
|
t1 = claim_space(picture_nodes);
|
||||||
|
img = claim_element(picture_nodes, "IMG", { src: true, alt: true, class: true });
|
||||||
|
picture_nodes.forEach(detach);
|
||||||
|
span_nodes.forEach(detach);
|
||||||
|
t2 = claim_text(h1_nodes, "\n\n to your new");
|
||||||
|
br = claim_element(h1_nodes, "BR", {});
|
||||||
|
t3 = claim_text(h1_nodes, "SvelteKit app");
|
||||||
|
h1_nodes.forEach(detach);
|
||||||
|
t4 = claim_space(section_nodes);
|
||||||
|
h2 = claim_element(section_nodes, "H2", {});
|
||||||
|
var h2_nodes = children(h2);
|
||||||
|
t5 = claim_text(h2_nodes, "try editing ");
|
||||||
|
strong = claim_element(h2_nodes, "STRONG", {});
|
||||||
|
var strong_nodes = children(strong);
|
||||||
|
t6 = claim_text(strong_nodes, "src/routes/+page.svelte");
|
||||||
|
strong_nodes.forEach(detach);
|
||||||
|
h2_nodes.forEach(detach);
|
||||||
|
t7 = claim_space(section_nodes);
|
||||||
|
claim_component(counter.$$.fragment, section_nodes);
|
||||||
|
section_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
document.title = "Home";
|
||||||
|
attr(meta, "name", "description");
|
||||||
|
attr(meta, "content", "Svelte demo app");
|
||||||
|
attr(source, "srcset", welcome);
|
||||||
|
attr(source, "type", "image/webp");
|
||||||
|
if (!src_url_equal(img.src, img_src_value = welcome_fallback))
|
||||||
|
attr(img, "src", img_src_value);
|
||||||
|
attr(img, "alt", "Welcome");
|
||||||
|
attr(img, "class", "svelte-19xx0bt");
|
||||||
|
attr(span, "class", "welcome svelte-19xx0bt");
|
||||||
|
attr(h1, "class", "svelte-19xx0bt");
|
||||||
|
attr(section, "class", "svelte-19xx0bt");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
append_hydration(document.head, meta);
|
||||||
|
insert_hydration(target, t0, anchor);
|
||||||
|
insert_hydration(target, section, anchor);
|
||||||
|
append_hydration(section, h1);
|
||||||
|
append_hydration(h1, span);
|
||||||
|
append_hydration(span, picture);
|
||||||
|
append_hydration(picture, source);
|
||||||
|
append_hydration(picture, t1);
|
||||||
|
append_hydration(picture, img);
|
||||||
|
append_hydration(h1, t2);
|
||||||
|
append_hydration(h1, br);
|
||||||
|
append_hydration(h1, t3);
|
||||||
|
append_hydration(section, t4);
|
||||||
|
append_hydration(section, h2);
|
||||||
|
append_hydration(h2, t5);
|
||||||
|
append_hydration(h2, strong);
|
||||||
|
append_hydration(strong, t6);
|
||||||
|
append_hydration(section, t7);
|
||||||
|
mount_component(counter, section, null);
|
||||||
|
current = true;
|
||||||
|
},
|
||||||
|
p: noop,
|
||||||
|
i(local) {
|
||||||
|
if (current)
|
||||||
|
return;
|
||||||
|
transition_in(counter.$$.fragment, local);
|
||||||
|
current = true;
|
||||||
|
},
|
||||||
|
o(local) {
|
||||||
|
transition_out(counter.$$.fragment, local);
|
||||||
|
current = false;
|
||||||
|
},
|
||||||
|
d(detaching) {
|
||||||
|
detach(meta);
|
||||||
|
if (detaching)
|
||||||
|
detach(t0);
|
||||||
|
if (detaching)
|
||||||
|
detach(section);
|
||||||
|
destroy_component(counter);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
class Page extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, null, create_fragment, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Page as default
|
||||||
|
};
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
import { S as SvelteComponent, i as init, s as safe_not_equal, k as element, a as space, q as text, Q as head_selector, l as claim_element, h as detach, c as claim_space, m as children, r as claim_text, n as attr, G as append_hydration, b as insert_hydration, C as noop } from "../../../chunks/index-d985765e.js";
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
let meta;
|
||||||
|
let t0;
|
||||||
|
let div;
|
||||||
|
let h1;
|
||||||
|
let t1;
|
||||||
|
let t2;
|
||||||
|
let p0;
|
||||||
|
let t3;
|
||||||
|
let a0;
|
||||||
|
let t4;
|
||||||
|
let t5;
|
||||||
|
let t6;
|
||||||
|
let pre;
|
||||||
|
let t7;
|
||||||
|
let t8;
|
||||||
|
let p1;
|
||||||
|
let t9;
|
||||||
|
let t10;
|
||||||
|
let p2;
|
||||||
|
let t11;
|
||||||
|
let a1;
|
||||||
|
let t12;
|
||||||
|
let t13;
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
meta = element("meta");
|
||||||
|
t0 = space();
|
||||||
|
div = element("div");
|
||||||
|
h1 = element("h1");
|
||||||
|
t1 = text("About this app");
|
||||||
|
t2 = space();
|
||||||
|
p0 = element("p");
|
||||||
|
t3 = text("This is a ");
|
||||||
|
a0 = element("a");
|
||||||
|
t4 = text("SvelteKit");
|
||||||
|
t5 = text(" app. You can make your own by typing the\n following into your command line and following the prompts:");
|
||||||
|
t6 = space();
|
||||||
|
pre = element("pre");
|
||||||
|
t7 = text("npm create svelte@latest");
|
||||||
|
t8 = space();
|
||||||
|
p1 = element("p");
|
||||||
|
t9 = text("The page you're looking at is purely static HTML, with no client-side interactivity needed.\n Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening\n the devtools network panel and reloading.");
|
||||||
|
t10 = space();
|
||||||
|
p2 = element("p");
|
||||||
|
t11 = text("The ");
|
||||||
|
a1 = element("a");
|
||||||
|
t12 = text("Sverdle");
|
||||||
|
t13 = text(" page illustrates SvelteKit's data loading and form handling. Try\n using it with JavaScript disabled!");
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
const head_nodes = head_selector("svelte-1ds1qyu", document.head);
|
||||||
|
meta = claim_element(head_nodes, "META", { name: true, content: true });
|
||||||
|
head_nodes.forEach(detach);
|
||||||
|
t0 = claim_space(nodes);
|
||||||
|
div = claim_element(nodes, "DIV", { class: true });
|
||||||
|
var div_nodes = children(div);
|
||||||
|
h1 = claim_element(div_nodes, "H1", {});
|
||||||
|
var h1_nodes = children(h1);
|
||||||
|
t1 = claim_text(h1_nodes, "About this app");
|
||||||
|
h1_nodes.forEach(detach);
|
||||||
|
t2 = claim_space(div_nodes);
|
||||||
|
p0 = claim_element(div_nodes, "P", {});
|
||||||
|
var p0_nodes = children(p0);
|
||||||
|
t3 = claim_text(p0_nodes, "This is a ");
|
||||||
|
a0 = claim_element(p0_nodes, "A", { href: true });
|
||||||
|
var a0_nodes = children(a0);
|
||||||
|
t4 = claim_text(a0_nodes, "SvelteKit");
|
||||||
|
a0_nodes.forEach(detach);
|
||||||
|
t5 = claim_text(p0_nodes, " app. You can make your own by typing the\n following into your command line and following the prompts:");
|
||||||
|
p0_nodes.forEach(detach);
|
||||||
|
t6 = claim_space(div_nodes);
|
||||||
|
pre = claim_element(div_nodes, "PRE", {});
|
||||||
|
var pre_nodes = children(pre);
|
||||||
|
t7 = claim_text(pre_nodes, "npm create svelte@latest");
|
||||||
|
pre_nodes.forEach(detach);
|
||||||
|
t8 = claim_space(div_nodes);
|
||||||
|
p1 = claim_element(div_nodes, "P", {});
|
||||||
|
var p1_nodes = children(p1);
|
||||||
|
t9 = claim_text(p1_nodes, "The page you're looking at is purely static HTML, with no client-side interactivity needed.\n Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening\n the devtools network panel and reloading.");
|
||||||
|
p1_nodes.forEach(detach);
|
||||||
|
t10 = claim_space(div_nodes);
|
||||||
|
p2 = claim_element(div_nodes, "P", {});
|
||||||
|
var p2_nodes = children(p2);
|
||||||
|
t11 = claim_text(p2_nodes, "The ");
|
||||||
|
a1 = claim_element(p2_nodes, "A", { href: true });
|
||||||
|
var a1_nodes = children(a1);
|
||||||
|
t12 = claim_text(a1_nodes, "Sverdle");
|
||||||
|
a1_nodes.forEach(detach);
|
||||||
|
t13 = claim_text(p2_nodes, " page illustrates SvelteKit's data loading and form handling. Try\n using it with JavaScript disabled!");
|
||||||
|
p2_nodes.forEach(detach);
|
||||||
|
div_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
document.title = "About";
|
||||||
|
attr(meta, "name", "description");
|
||||||
|
attr(meta, "content", "About this app");
|
||||||
|
attr(a0, "href", "https://kit.svelte.dev");
|
||||||
|
attr(a1, "href", "/sverdle");
|
||||||
|
attr(div, "class", "text-column");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
append_hydration(document.head, meta);
|
||||||
|
insert_hydration(target, t0, anchor);
|
||||||
|
insert_hydration(target, div, anchor);
|
||||||
|
append_hydration(div, h1);
|
||||||
|
append_hydration(h1, t1);
|
||||||
|
append_hydration(div, t2);
|
||||||
|
append_hydration(div, p0);
|
||||||
|
append_hydration(p0, t3);
|
||||||
|
append_hydration(p0, a0);
|
||||||
|
append_hydration(a0, t4);
|
||||||
|
append_hydration(p0, t5);
|
||||||
|
append_hydration(div, t6);
|
||||||
|
append_hydration(div, pre);
|
||||||
|
append_hydration(pre, t7);
|
||||||
|
append_hydration(div, t8);
|
||||||
|
append_hydration(div, p1);
|
||||||
|
append_hydration(p1, t9);
|
||||||
|
append_hydration(div, t10);
|
||||||
|
append_hydration(div, p2);
|
||||||
|
append_hydration(p2, t11);
|
||||||
|
append_hydration(p2, a1);
|
||||||
|
append_hydration(a1, t12);
|
||||||
|
append_hydration(p2, t13);
|
||||||
|
},
|
||||||
|
p: noop,
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
d(detaching) {
|
||||||
|
detach(meta);
|
||||||
|
if (detaching)
|
||||||
|
detach(t0);
|
||||||
|
if (detaching)
|
||||||
|
detach(div);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
class Page extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, null, create_fragment, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Page as default
|
||||||
|
};
|
||||||
@@ -0,0 +1,374 @@
|
|||||||
|
import { S as SvelteComponent, i as init, s as safe_not_equal, k as element, a as space, q as text, Q as head_selector, l as claim_element, h as detach, c as claim_space, m as children, r as claim_text, n as attr, G as append_hydration, b as insert_hydration, C as noop } from "../../../../chunks/index-d985765e.js";
|
||||||
|
const _page_svelte_svelte_type_style_lang = "";
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
let meta;
|
||||||
|
let t0;
|
||||||
|
let div2;
|
||||||
|
let h1;
|
||||||
|
let t1;
|
||||||
|
let t2;
|
||||||
|
let p0;
|
||||||
|
let t3;
|
||||||
|
let a;
|
||||||
|
let t4;
|
||||||
|
let t5;
|
||||||
|
let t6;
|
||||||
|
let div0;
|
||||||
|
let span0;
|
||||||
|
let t7;
|
||||||
|
let t8;
|
||||||
|
let span1;
|
||||||
|
let t9;
|
||||||
|
let t10;
|
||||||
|
let span2;
|
||||||
|
let t11;
|
||||||
|
let t12;
|
||||||
|
let span3;
|
||||||
|
let t13;
|
||||||
|
let t14;
|
||||||
|
let span4;
|
||||||
|
let t15;
|
||||||
|
let t16;
|
||||||
|
let p1;
|
||||||
|
let t17;
|
||||||
|
let span5;
|
||||||
|
let t18;
|
||||||
|
let t19;
|
||||||
|
let span6;
|
||||||
|
let t20;
|
||||||
|
let t21;
|
||||||
|
let span7;
|
||||||
|
let t22;
|
||||||
|
let t23;
|
||||||
|
let t24;
|
||||||
|
let div1;
|
||||||
|
let span8;
|
||||||
|
let t25;
|
||||||
|
let t26;
|
||||||
|
let span9;
|
||||||
|
let t27;
|
||||||
|
let t28;
|
||||||
|
let span10;
|
||||||
|
let t29;
|
||||||
|
let t30;
|
||||||
|
let span11;
|
||||||
|
let t31;
|
||||||
|
let t32;
|
||||||
|
let span12;
|
||||||
|
let t33;
|
||||||
|
let t34;
|
||||||
|
let p2;
|
||||||
|
let t35;
|
||||||
|
let strong;
|
||||||
|
let t36;
|
||||||
|
let t37;
|
||||||
|
let t38;
|
||||||
|
let p3;
|
||||||
|
let t39;
|
||||||
|
let code;
|
||||||
|
let t40;
|
||||||
|
let t41;
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
meta = element("meta");
|
||||||
|
t0 = space();
|
||||||
|
div2 = element("div");
|
||||||
|
h1 = element("h1");
|
||||||
|
t1 = text("How to play Sverdle");
|
||||||
|
t2 = space();
|
||||||
|
p0 = element("p");
|
||||||
|
t3 = text("Sverdle is a clone of ");
|
||||||
|
a = element("a");
|
||||||
|
t4 = text("Wordle");
|
||||||
|
t5 = text(", the\n word guessing game. To play, enter a five-letter English word. For example:");
|
||||||
|
t6 = space();
|
||||||
|
div0 = element("div");
|
||||||
|
span0 = element("span");
|
||||||
|
t7 = text("r");
|
||||||
|
t8 = space();
|
||||||
|
span1 = element("span");
|
||||||
|
t9 = text("i");
|
||||||
|
t10 = space();
|
||||||
|
span2 = element("span");
|
||||||
|
t11 = text("t");
|
||||||
|
t12 = space();
|
||||||
|
span3 = element("span");
|
||||||
|
t13 = text("z");
|
||||||
|
t14 = space();
|
||||||
|
span4 = element("span");
|
||||||
|
t15 = text("y");
|
||||||
|
t16 = space();
|
||||||
|
p1 = element("p");
|
||||||
|
t17 = text("The ");
|
||||||
|
span5 = element("span");
|
||||||
|
t18 = text("y");
|
||||||
|
t19 = text(" is in the right place. ");
|
||||||
|
span6 = element("span");
|
||||||
|
t20 = text("r");
|
||||||
|
t21 = text(" and\n ");
|
||||||
|
span7 = element("span");
|
||||||
|
t22 = text("t");
|
||||||
|
t23 = text("\n are the right letters, but in the wrong place. The other letters are wrong, and can be discarded.\n Let's make another guess:");
|
||||||
|
t24 = space();
|
||||||
|
div1 = element("div");
|
||||||
|
span8 = element("span");
|
||||||
|
t25 = text("p");
|
||||||
|
t26 = space();
|
||||||
|
span9 = element("span");
|
||||||
|
t27 = text("a");
|
||||||
|
t28 = space();
|
||||||
|
span10 = element("span");
|
||||||
|
t29 = text("r");
|
||||||
|
t30 = space();
|
||||||
|
span11 = element("span");
|
||||||
|
t31 = text("t");
|
||||||
|
t32 = space();
|
||||||
|
span12 = element("span");
|
||||||
|
t33 = text("y");
|
||||||
|
t34 = space();
|
||||||
|
p2 = element("p");
|
||||||
|
t35 = text("This time we guessed right! You have ");
|
||||||
|
strong = element("strong");
|
||||||
|
t36 = text("six");
|
||||||
|
t37 = text(" guesses to get the word.");
|
||||||
|
t38 = space();
|
||||||
|
p3 = element("p");
|
||||||
|
t39 = text("Unlike the original Wordle, Sverdle runs on the server instead of in the browser, making it\n impossible to cheat. It uses ");
|
||||||
|
code = element("code");
|
||||||
|
t40 = text("<form>");
|
||||||
|
t41 = text(" and cookies to submit data, meaning you can\n even play with JavaScript disabled!");
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
l(nodes) {
|
||||||
|
const head_nodes = head_selector("svelte-1fqqyy5", document.head);
|
||||||
|
meta = claim_element(head_nodes, "META", { name: true, content: true });
|
||||||
|
head_nodes.forEach(detach);
|
||||||
|
t0 = claim_space(nodes);
|
||||||
|
div2 = claim_element(nodes, "DIV", { class: true });
|
||||||
|
var div2_nodes = children(div2);
|
||||||
|
h1 = claim_element(div2_nodes, "H1", {});
|
||||||
|
var h1_nodes = children(h1);
|
||||||
|
t1 = claim_text(h1_nodes, "How to play Sverdle");
|
||||||
|
h1_nodes.forEach(detach);
|
||||||
|
t2 = claim_space(div2_nodes);
|
||||||
|
p0 = claim_element(div2_nodes, "P", {});
|
||||||
|
var p0_nodes = children(p0);
|
||||||
|
t3 = claim_text(p0_nodes, "Sverdle is a clone of ");
|
||||||
|
a = claim_element(p0_nodes, "A", { href: true });
|
||||||
|
var a_nodes = children(a);
|
||||||
|
t4 = claim_text(a_nodes, "Wordle");
|
||||||
|
a_nodes.forEach(detach);
|
||||||
|
t5 = claim_text(p0_nodes, ", the\n word guessing game. To play, enter a five-letter English word. For example:");
|
||||||
|
p0_nodes.forEach(detach);
|
||||||
|
t6 = claim_space(div2_nodes);
|
||||||
|
div0 = claim_element(div2_nodes, "DIV", { class: true });
|
||||||
|
var div0_nodes = children(div0);
|
||||||
|
span0 = claim_element(div0_nodes, "SPAN", { class: true });
|
||||||
|
var span0_nodes = children(span0);
|
||||||
|
t7 = claim_text(span0_nodes, "r");
|
||||||
|
span0_nodes.forEach(detach);
|
||||||
|
t8 = claim_space(div0_nodes);
|
||||||
|
span1 = claim_element(div0_nodes, "SPAN", { class: true });
|
||||||
|
var span1_nodes = children(span1);
|
||||||
|
t9 = claim_text(span1_nodes, "i");
|
||||||
|
span1_nodes.forEach(detach);
|
||||||
|
t10 = claim_space(div0_nodes);
|
||||||
|
span2 = claim_element(div0_nodes, "SPAN", { class: true });
|
||||||
|
var span2_nodes = children(span2);
|
||||||
|
t11 = claim_text(span2_nodes, "t");
|
||||||
|
span2_nodes.forEach(detach);
|
||||||
|
t12 = claim_space(div0_nodes);
|
||||||
|
span3 = claim_element(div0_nodes, "SPAN", { class: true });
|
||||||
|
var span3_nodes = children(span3);
|
||||||
|
t13 = claim_text(span3_nodes, "z");
|
||||||
|
span3_nodes.forEach(detach);
|
||||||
|
t14 = claim_space(div0_nodes);
|
||||||
|
span4 = claim_element(div0_nodes, "SPAN", { class: true });
|
||||||
|
var span4_nodes = children(span4);
|
||||||
|
t15 = claim_text(span4_nodes, "y");
|
||||||
|
span4_nodes.forEach(detach);
|
||||||
|
div0_nodes.forEach(detach);
|
||||||
|
t16 = claim_space(div2_nodes);
|
||||||
|
p1 = claim_element(div2_nodes, "P", { class: true });
|
||||||
|
var p1_nodes = children(p1);
|
||||||
|
t17 = claim_text(p1_nodes, "The ");
|
||||||
|
span5 = claim_element(p1_nodes, "SPAN", { class: true });
|
||||||
|
var span5_nodes = children(span5);
|
||||||
|
t18 = claim_text(span5_nodes, "y");
|
||||||
|
span5_nodes.forEach(detach);
|
||||||
|
t19 = claim_text(p1_nodes, " is in the right place. ");
|
||||||
|
span6 = claim_element(p1_nodes, "SPAN", { class: true });
|
||||||
|
var span6_nodes = children(span6);
|
||||||
|
t20 = claim_text(span6_nodes, "r");
|
||||||
|
span6_nodes.forEach(detach);
|
||||||
|
t21 = claim_text(p1_nodes, " and\n ");
|
||||||
|
span7 = claim_element(p1_nodes, "SPAN", { class: true });
|
||||||
|
var span7_nodes = children(span7);
|
||||||
|
t22 = claim_text(span7_nodes, "t");
|
||||||
|
span7_nodes.forEach(detach);
|
||||||
|
t23 = claim_text(p1_nodes, "\n are the right letters, but in the wrong place. The other letters are wrong, and can be discarded.\n Let's make another guess:");
|
||||||
|
p1_nodes.forEach(detach);
|
||||||
|
t24 = claim_space(div2_nodes);
|
||||||
|
div1 = claim_element(div2_nodes, "DIV", { class: true });
|
||||||
|
var div1_nodes = children(div1);
|
||||||
|
span8 = claim_element(div1_nodes, "SPAN", { class: true });
|
||||||
|
var span8_nodes = children(span8);
|
||||||
|
t25 = claim_text(span8_nodes, "p");
|
||||||
|
span8_nodes.forEach(detach);
|
||||||
|
t26 = claim_space(div1_nodes);
|
||||||
|
span9 = claim_element(div1_nodes, "SPAN", { class: true });
|
||||||
|
var span9_nodes = children(span9);
|
||||||
|
t27 = claim_text(span9_nodes, "a");
|
||||||
|
span9_nodes.forEach(detach);
|
||||||
|
t28 = claim_space(div1_nodes);
|
||||||
|
span10 = claim_element(div1_nodes, "SPAN", { class: true });
|
||||||
|
var span10_nodes = children(span10);
|
||||||
|
t29 = claim_text(span10_nodes, "r");
|
||||||
|
span10_nodes.forEach(detach);
|
||||||
|
t30 = claim_space(div1_nodes);
|
||||||
|
span11 = claim_element(div1_nodes, "SPAN", { class: true });
|
||||||
|
var span11_nodes = children(span11);
|
||||||
|
t31 = claim_text(span11_nodes, "t");
|
||||||
|
span11_nodes.forEach(detach);
|
||||||
|
t32 = claim_space(div1_nodes);
|
||||||
|
span12 = claim_element(div1_nodes, "SPAN", { class: true });
|
||||||
|
var span12_nodes = children(span12);
|
||||||
|
t33 = claim_text(span12_nodes, "y");
|
||||||
|
span12_nodes.forEach(detach);
|
||||||
|
div1_nodes.forEach(detach);
|
||||||
|
t34 = claim_space(div2_nodes);
|
||||||
|
p2 = claim_element(div2_nodes, "P", {});
|
||||||
|
var p2_nodes = children(p2);
|
||||||
|
t35 = claim_text(p2_nodes, "This time we guessed right! You have ");
|
||||||
|
strong = claim_element(p2_nodes, "STRONG", {});
|
||||||
|
var strong_nodes = children(strong);
|
||||||
|
t36 = claim_text(strong_nodes, "six");
|
||||||
|
strong_nodes.forEach(detach);
|
||||||
|
t37 = claim_text(p2_nodes, " guesses to get the word.");
|
||||||
|
p2_nodes.forEach(detach);
|
||||||
|
t38 = claim_space(div2_nodes);
|
||||||
|
p3 = claim_element(div2_nodes, "P", {});
|
||||||
|
var p3_nodes = children(p3);
|
||||||
|
t39 = claim_text(p3_nodes, "Unlike the original Wordle, Sverdle runs on the server instead of in the browser, making it\n impossible to cheat. It uses ");
|
||||||
|
code = claim_element(p3_nodes, "CODE", {});
|
||||||
|
var code_nodes = children(code);
|
||||||
|
t40 = claim_text(code_nodes, "<form>");
|
||||||
|
code_nodes.forEach(detach);
|
||||||
|
t41 = claim_text(p3_nodes, " and cookies to submit data, meaning you can\n even play with JavaScript disabled!");
|
||||||
|
p3_nodes.forEach(detach);
|
||||||
|
div2_nodes.forEach(detach);
|
||||||
|
this.h();
|
||||||
|
},
|
||||||
|
h() {
|
||||||
|
document.title = "How to play Sverdle";
|
||||||
|
attr(meta, "name", "description");
|
||||||
|
attr(meta, "content", "How to play Sverdle");
|
||||||
|
attr(a, "href", "https://www.nytimes.com/games/wordle/index.html");
|
||||||
|
attr(span0, "class", "close svelte-1x5nq1n");
|
||||||
|
attr(span1, "class", "missing svelte-1x5nq1n");
|
||||||
|
attr(span2, "class", "close svelte-1x5nq1n");
|
||||||
|
attr(span3, "class", "missing svelte-1x5nq1n");
|
||||||
|
attr(span4, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(div0, "class", "example svelte-1x5nq1n");
|
||||||
|
attr(span5, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(span6, "class", "close svelte-1x5nq1n");
|
||||||
|
attr(span7, "class", "close svelte-1x5nq1n");
|
||||||
|
attr(p1, "class", "svelte-1x5nq1n");
|
||||||
|
attr(span8, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(span9, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(span10, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(span11, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(span12, "class", "exact svelte-1x5nq1n");
|
||||||
|
attr(div1, "class", "example svelte-1x5nq1n");
|
||||||
|
attr(div2, "class", "text-column");
|
||||||
|
},
|
||||||
|
m(target, anchor) {
|
||||||
|
append_hydration(document.head, meta);
|
||||||
|
insert_hydration(target, t0, anchor);
|
||||||
|
insert_hydration(target, div2, anchor);
|
||||||
|
append_hydration(div2, h1);
|
||||||
|
append_hydration(h1, t1);
|
||||||
|
append_hydration(div2, t2);
|
||||||
|
append_hydration(div2, p0);
|
||||||
|
append_hydration(p0, t3);
|
||||||
|
append_hydration(p0, a);
|
||||||
|
append_hydration(a, t4);
|
||||||
|
append_hydration(p0, t5);
|
||||||
|
append_hydration(div2, t6);
|
||||||
|
append_hydration(div2, div0);
|
||||||
|
append_hydration(div0, span0);
|
||||||
|
append_hydration(span0, t7);
|
||||||
|
append_hydration(div0, t8);
|
||||||
|
append_hydration(div0, span1);
|
||||||
|
append_hydration(span1, t9);
|
||||||
|
append_hydration(div0, t10);
|
||||||
|
append_hydration(div0, span2);
|
||||||
|
append_hydration(span2, t11);
|
||||||
|
append_hydration(div0, t12);
|
||||||
|
append_hydration(div0, span3);
|
||||||
|
append_hydration(span3, t13);
|
||||||
|
append_hydration(div0, t14);
|
||||||
|
append_hydration(div0, span4);
|
||||||
|
append_hydration(span4, t15);
|
||||||
|
append_hydration(div2, t16);
|
||||||
|
append_hydration(div2, p1);
|
||||||
|
append_hydration(p1, t17);
|
||||||
|
append_hydration(p1, span5);
|
||||||
|
append_hydration(span5, t18);
|
||||||
|
append_hydration(p1, t19);
|
||||||
|
append_hydration(p1, span6);
|
||||||
|
append_hydration(span6, t20);
|
||||||
|
append_hydration(p1, t21);
|
||||||
|
append_hydration(p1, span7);
|
||||||
|
append_hydration(span7, t22);
|
||||||
|
append_hydration(p1, t23);
|
||||||
|
append_hydration(div2, t24);
|
||||||
|
append_hydration(div2, div1);
|
||||||
|
append_hydration(div1, span8);
|
||||||
|
append_hydration(span8, t25);
|
||||||
|
append_hydration(div1, t26);
|
||||||
|
append_hydration(div1, span9);
|
||||||
|
append_hydration(span9, t27);
|
||||||
|
append_hydration(div1, t28);
|
||||||
|
append_hydration(div1, span10);
|
||||||
|
append_hydration(span10, t29);
|
||||||
|
append_hydration(div1, t30);
|
||||||
|
append_hydration(div1, span11);
|
||||||
|
append_hydration(span11, t31);
|
||||||
|
append_hydration(div1, t32);
|
||||||
|
append_hydration(div1, span12);
|
||||||
|
append_hydration(span12, t33);
|
||||||
|
append_hydration(div2, t34);
|
||||||
|
append_hydration(div2, p2);
|
||||||
|
append_hydration(p2, t35);
|
||||||
|
append_hydration(p2, strong);
|
||||||
|
append_hydration(strong, t36);
|
||||||
|
append_hydration(p2, t37);
|
||||||
|
append_hydration(div2, t38);
|
||||||
|
append_hydration(div2, p3);
|
||||||
|
append_hydration(p3, t39);
|
||||||
|
append_hydration(p3, code);
|
||||||
|
append_hydration(code, t40);
|
||||||
|
append_hydration(p3, t41);
|
||||||
|
},
|
||||||
|
p: noop,
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
d(detaching) {
|
||||||
|
detach(meta);
|
||||||
|
if (detaching)
|
||||||
|
detach(t0);
|
||||||
|
if (detaching)
|
||||||
|
detach(div2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
class Page extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, null, create_fragment, safe_not_equal, {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Page as default
|
||||||
|
};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { p } from "../../chunks/_page-de0ef88a.js";
|
||||||
|
export {
|
||||||
|
p as prerender
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import "../../../chunks/environment-57be8769.js";
|
||||||
|
import { c, p } from "../../../chunks/_page-34b026b6.js";
|
||||||
|
export {
|
||||||
|
c as csr,
|
||||||
|
p as prerender
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import "../../../../chunks/environment-57be8769.js";
|
||||||
|
import { c, p } from "../../../../chunks/_page-cbe3748d.js";
|
||||||
|
export {
|
||||||
|
c as csr,
|
||||||
|
p as prerender
|
||||||
|
};
|
||||||
2259
examples/electron-app/src/_app/immutable/start-5499181a.js
Normal file
1
examples/electron-app/src/_app/version.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":"1676135993796"}
|
||||||
49
examples/electron-app/src/about.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="./favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||||
|
<meta http-equiv="content-security-policy" content="default-src 'self'; script-src 'self'">
|
||||||
|
<link href="./_app/immutable/assets/_layout-19af9c2d.css" rel="stylesheet"><title>About</title><!-- HEAD_svelte-1ds1qyu_START --><meta name="description" content="About this app"><!-- HEAD_svelte-1ds1qyu_END -->
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="app svelte-8o1gnw"><header class="svelte-1u9z1tp"><div class="corner svelte-1u9z1tp"><a href="https://kit.svelte.dev" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/svelte-logo-87df40b8.svg" alt="SvelteKit" class="svelte-1u9z1tp"></a></div>
|
||||||
|
|
||||||
|
<nav class="svelte-1u9z1tp"><svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" class="svelte-1u9z1tp"></path></svg>
|
||||||
|
<ul class="svelte-1u9z1tp"><li class="svelte-1u9z1tp"><a href="./index.html" class="svelte-1u9z1tp">Home</a></li>
|
||||||
|
<li aria-current="page" class="svelte-1u9z1tp"><a href="./about.html" class="svelte-1u9z1tp">About</a></li>
|
||||||
|
<li class="svelte-1u9z1tp"><a href="/sverdle" class="svelte-1u9z1tp">Sverdle</a></li></ul>
|
||||||
|
<svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" class="svelte-1u9z1tp"></path></svg></nav>
|
||||||
|
|
||||||
|
<div class="corner svelte-1u9z1tp"><a href="https://github.com/sveltejs/kit" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/github-1ea8d62e.svg" alt="GitHub" class="svelte-1u9z1tp"></a></div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="svelte-8o1gnw">
|
||||||
|
|
||||||
|
<div class="text-column"><h1>About this app</h1>
|
||||||
|
|
||||||
|
<p>This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the
|
||||||
|
following into your command line and following the prompts:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre>npm create svelte@latest</pre>
|
||||||
|
|
||||||
|
<p>The page you're looking at is purely static HTML, with no client-side interactivity needed.
|
||||||
|
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening
|
||||||
|
the devtools network panel and reloading.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>The <a href="/sverdle">Sverdle</a> page illustrates SvelteKit's data loading and form handling. Try
|
||||||
|
using it with JavaScript disabled!
|
||||||
|
</p></div></main>
|
||||||
|
|
||||||
|
<footer class="svelte-8o1gnw"><p>visit <a href="https://kit.svelte.dev" class="svelte-8o1gnw">kit.svelte.dev</a> to learn SvelteKit</p></footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
examples/electron-app/src/favicon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
77
examples/electron-app/src/index.html
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="./favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||||
|
<meta http-equiv="content-security-policy" content="">
|
||||||
|
<link href="./_app/immutable/assets/_layout-19af9c2d.css" rel="stylesheet">
|
||||||
|
<link href="./_app/immutable/assets/_page-08e4d5ca.css" rel="stylesheet">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/start-5499181a.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/index-d985765e.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/singletons-0c6ee057.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/index-bb582736.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/parse-a9b5aeea.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/components/pages/_layout.svelte-20a5d298.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/stores-8cac4559.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/components/pages/_page.svelte-8f3445c9.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/modules/pages/_page.ts-ed610ca4.js">
|
||||||
|
<link rel="modulepreload" href="./_app/immutable/chunks/_page-de0ef88a.js"><title>Home</title><!-- HEAD_svelte-t32ptj_START --><meta name="description" content="Svelte demo app"><!-- HEAD_svelte-t32ptj_END -->
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="app svelte-8o1gnw"><header class="svelte-1u9z1tp"><div class="corner svelte-1u9z1tp"><a href="https://kit.svelte.dev" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/svelte-logo-87df40b8.svg" alt="SvelteKit" class="svelte-1u9z1tp"></a></div>
|
||||||
|
|
||||||
|
<nav class="svelte-1u9z1tp"><svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" class="svelte-1u9z1tp"></path></svg>
|
||||||
|
<ul class="svelte-1u9z1tp"><li aria-current="page" class="svelte-1u9z1tp"><a href="./index.html" class="svelte-1u9z1tp">Home</a></li>
|
||||||
|
<li class="svelte-1u9z1tp"><a href="./about.html" class="svelte-1u9z1tp">About</a></li>
|
||||||
|
<li class="svelte-1u9z1tp"><a href="/sverdle" class="svelte-1u9z1tp">Sverdle</a></li></ul>
|
||||||
|
<svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" class="svelte-1u9z1tp"></path></svg></nav>
|
||||||
|
|
||||||
|
<div class="corner svelte-1u9z1tp"><a href="https://github.com/sveltejs/kit" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/github-1ea8d62e.svg" alt="GitHub" class="svelte-1u9z1tp"></a></div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="svelte-8o1gnw">
|
||||||
|
|
||||||
|
<section class="svelte-19xx0bt"><h1 class="svelte-19xx0bt"><span class="welcome svelte-19xx0bt"><picture><source srcset=./_app/immutable/assets/svelte-welcome-c18bcf5a.webp" type="image/webp">
|
||||||
|
<img src=./_app/immutable/assets/svelte-welcome-6c300099.png" alt="Welcome" class="svelte-19xx0bt"></picture></span>
|
||||||
|
|
||||||
|
to your new<br>SvelteKit app
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<h2>try editing <strong>src/routes/+page.svelte</strong></h2>
|
||||||
|
|
||||||
|
<div class="counter svelte-y96mxt"><button aria-label="Decrease the counter by one" class="svelte-y96mxt"><svg aria-hidden="true" viewBox="0 0 1 1" class="svelte-y96mxt"><path d="M0,0.5 L1,0.5" class="svelte-y96mxt"></path></svg></button>
|
||||||
|
|
||||||
|
<div class="counter-viewport svelte-y96mxt"><div class="counter-digits svelte-y96mxt" style="transform: translate(0, 0%)"><strong class="hidden svelte-y96mxt" aria-hidden="true">1</strong>
|
||||||
|
<strong class="svelte-y96mxt">0</strong></div></div>
|
||||||
|
|
||||||
|
<button aria-label="Increase the counter by one" class="svelte-y96mxt"><svg aria-hidden="true" viewBox="0 0 1 1" class="svelte-y96mxt"><path d="M0,0.5 L1,0.5 M0.5,0 L0.5,1" class="svelte-y96mxt"></path></svg></button>
|
||||||
|
</div>
|
||||||
|
</section></main>
|
||||||
|
|
||||||
|
<footer class="svelte-8o1gnw"><p>visit <a href="https://kit.svelte.dev" class="svelte-8o1gnw">kit.svelte.dev</a> to learn SvelteKit</p></footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="module" data-sveltekit-hydrate="pu4tnb">
|
||||||
|
import { start } from "./_app/immutable/start-5499181a.js";
|
||||||
|
|
||||||
|
start({
|
||||||
|
assets: "",
|
||||||
|
env: {},
|
||||||
|
target: document.querySelector('[data-sveltekit-hydrate="pu4tnb"]').parentNode,
|
||||||
|
version: "1676135993796",
|
||||||
|
hydrate: {
|
||||||
|
node_ids: [0, 2],
|
||||||
|
data: [null,null],
|
||||||
|
form: null,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
49
examples/electron-app/src/index.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||||
|
if (require('electron-squirrel-startup')) {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
const createWindow = () => {
|
||||||
|
// Create the browser window.
|
||||||
|
const mainWindow = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
preload: path.join(__dirname, 'preload.js'),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// and load the index.html of the app.
|
||||||
|
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
||||||
|
|
||||||
|
// Open the DevTools.
|
||||||
|
mainWindow.webContents.openDevTools();
|
||||||
|
};
|
||||||
|
|
||||||
|
// This method will be called when Electron has finished
|
||||||
|
// initialization and is ready to create browser windows.
|
||||||
|
// Some APIs can only be used after this event occurs.
|
||||||
|
app.on('ready', createWindow);
|
||||||
|
|
||||||
|
// Quit when all windows are closed, except on macOS. There, it's common
|
||||||
|
// for applications and their menu bar to stay active until the user quits
|
||||||
|
// explicitly with Cmd + Q.
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
// On OS X it's common to re-create a window in the app when the
|
||||||
|
// dock icon is clicked and there are no other windows open.
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// In this file you can include the rest of your app's specific main process
|
||||||
|
// code. You can also put them in separate files and import them here.
|
||||||
2
examples/electron-app/src/preload.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// See the Electron documentation for details on how to use preload scripts:
|
||||||
|
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
|
||||||
3
examples/electron-app/src/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
65
examples/electron-app/src/sverdle/how-to-play.html
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="../favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||||
|
<meta http-equiv="content-security-policy" content="default-src 'self'; script-src 'self'">
|
||||||
|
<link href="../_app/immutable/assets/_layout-19af9c2d.css" rel="stylesheet">
|
||||||
|
<link href="../_app/immutable/assets/_page-0e6c8ae6.css" rel="stylesheet"><title>How to play Sverdle</title><!-- HEAD_svelte-1fqqyy5_START --><meta name="description" content="How to play Sverdle"><!-- HEAD_svelte-1fqqyy5_END -->
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="app svelte-8o1gnw"><header class="svelte-1u9z1tp"><div class="corner svelte-1u9z1tp"><a href="https://kit.svelte.dev" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/svelte-logo-87df40b8.svg" alt="SvelteKit" class="svelte-1u9z1tp"></a></div>
|
||||||
|
|
||||||
|
<nav class="svelte-1u9z1tp"><svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" class="svelte-1u9z1tp"></path></svg>
|
||||||
|
<ul class="svelte-1u9z1tp"><li class="svelte-1u9z1tp"><a href="./index.html" class="svelte-1u9z1tp">Home</a></li>
|
||||||
|
<li class="svelte-1u9z1tp"><a href="./about.html" class="svelte-1u9z1tp">About</a></li>
|
||||||
|
<li aria-current="page" class="svelte-1u9z1tp"><a href="/sverdle" class="svelte-1u9z1tp">Sverdle</a></li></ul>
|
||||||
|
<svg viewBox="0 0 2 3" aria-hidden="true" class="svelte-1u9z1tp"><path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" class="svelte-1u9z1tp"></path></svg></nav>
|
||||||
|
|
||||||
|
<div class="corner svelte-1u9z1tp"><a href="https://github.com/sveltejs/kit" class="svelte-1u9z1tp"><img src=./_app/immutable/assets/github-1ea8d62e.svg" alt="GitHub" class="svelte-1u9z1tp"></a></div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="svelte-8o1gnw">
|
||||||
|
|
||||||
|
<div class="text-column"><h1>How to play Sverdle</h1>
|
||||||
|
|
||||||
|
<p>Sverdle is a clone of <a href="https://www.nytimes.com/games/wordle/index.html">Wordle</a>, the
|
||||||
|
word guessing game. To play, enter a five-letter English word. For example:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="example svelte-1x5nq1n"><span class="close svelte-1x5nq1n">r</span>
|
||||||
|
<span class="missing svelte-1x5nq1n">i</span>
|
||||||
|
<span class="close svelte-1x5nq1n">t</span>
|
||||||
|
<span class="missing svelte-1x5nq1n">z</span>
|
||||||
|
<span class="exact svelte-1x5nq1n">y</span></div>
|
||||||
|
|
||||||
|
<p class="svelte-1x5nq1n">The <span class="exact svelte-1x5nq1n">y</span> is in the right place. <span class="close svelte-1x5nq1n">r</span> and
|
||||||
|
<span class="close svelte-1x5nq1n">t</span>
|
||||||
|
are the right letters, but in the wrong place. The other letters are wrong, and can be discarded.
|
||||||
|
Let's make another guess:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="example svelte-1x5nq1n"><span class="exact svelte-1x5nq1n">p</span>
|
||||||
|
<span class="exact svelte-1x5nq1n">a</span>
|
||||||
|
<span class="exact svelte-1x5nq1n">r</span>
|
||||||
|
<span class="exact svelte-1x5nq1n">t</span>
|
||||||
|
<span class="exact svelte-1x5nq1n">y</span></div>
|
||||||
|
|
||||||
|
<p>This time we guessed right! You have <strong>six</strong> guesses to get the word.</p>
|
||||||
|
|
||||||
|
<p>Unlike the original Wordle, Sverdle runs on the server instead of in the browser, making it
|
||||||
|
impossible to cheat. It uses <code><form></code> and cookies to submit data, meaning you can
|
||||||
|
even play with JavaScript disabled!
|
||||||
|
</p>
|
||||||
|
</div></main>
|
||||||
|
|
||||||
|
<footer class="svelte-8o1gnw"><p>visit <a href="https://kit.svelte.dev" class="svelte-8o1gnw">kit.svelte.dev</a> to learn SvelteKit</p></footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
examples/sveltekit-app/.eslintignore
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
20
examples/sveltekit-app/.eslintrc.cjs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
|
||||||
|
plugins: ['svelte3', '@typescript-eslint'],
|
||||||
|
ignorePatterns: ['*.cjs'],
|
||||||
|
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
||||||
|
settings: {
|
||||||
|
'svelte3/typescript': () => require('typescript')
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaVersion: 2020
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es2017: true,
|
||||||
|
node: true
|
||||||
|
}
|
||||||
|
};
|
||||||
12
examples/sveltekit-app/.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
.vercel
|
||||||
|
.output
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
1
examples/sveltekit-app/.npmrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
engine-strict=true
|
||||||
13
examples/sveltekit-app/.prettierignore
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
9
examples/sveltekit-app/.prettierrc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"useTabs": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 100,
|
||||||
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
|
"pluginSearchDirs": ["."],
|
||||||
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
|
}
|
||||||
38
examples/sveltekit-app/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# create-svelte
|
||||||
|
|
||||||
|
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
|
||||||
|
|
||||||
|
## Creating a project
|
||||||
|
|
||||||
|
If you're seeing this, you've probably already done this step. Congrats!
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# create a new project in the current directory
|
||||||
|
npm create svelte@latest
|
||||||
|
|
||||||
|
# create a new project in my-app
|
||||||
|
npm create svelte@latest my-app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Developing
|
||||||
|
|
||||||
|
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# or start the server and open the app in a new browser tab
|
||||||
|
npm run dev -- --open
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To create a production version of your app:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
You can preview the production build with `npm run preview`.
|
||||||
|
|
||||||
|
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||||
34
examples/sveltekit-app/package.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "sveltekit-app",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite dev",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||||
|
"format": "prettier --plugin-search-dir . --write ."
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@fontsource/fira-mono": "^4.5.10",
|
||||||
|
"@neoconfetti/svelte": "^1.0.0",
|
||||||
|
"@ptkdev/sveltekit-electron-adapter": "latest",
|
||||||
|
"@sveltejs/adapter-auto": "^2.0.0",
|
||||||
|
"@sveltejs/kit": "^1.5.0",
|
||||||
|
"@types/cookie": "^0.5.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||||
|
"@typescript-eslint/parser": "^5.45.0",
|
||||||
|
"eslint": "^8.28.0",
|
||||||
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"eslint-plugin-svelte3": "^4.0.0",
|
||||||
|
"prettier": "^2.8.0",
|
||||||
|
"prettier-plugin-svelte": "^2.8.1",
|
||||||
|
"svelte": "^3.54.0",
|
||||||
|
"svelte-check": "^3.0.1",
|
||||||
|
"tslib": "^2.4.1",
|
||||||
|
"typescript": "^4.9.3",
|
||||||
|
"vite": "^4.0.0"
|
||||||
|
},
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
12
examples/sveltekit-app/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// See https://kit.svelte.dev/docs/types#app
|
||||||
|
// for information about these interfaces
|
||||||
|
declare global {
|
||||||
|
namespace App {
|
||||||
|
// interface Error {}
|
||||||
|
// interface Locals {}
|
||||||
|
// interface PageData {}
|
||||||
|
// interface Platform {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
12
examples/sveltekit-app/src/app.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
16
examples/sveltekit-app/src/lib/images/github.svg
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-3 -3 30 30">
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5229 6.47715 22 12 22C17.5229 22 22 17.5229 22 12C22 6.47715 17.5229 2 12 2ZM0 12C0 5.3726 5.3726 0 12 0C18.6274 0 24 5.3726 24 12C24 18.6274 18.6274 24 12 24C5.3726 24 0 18.6274 0 12Z"
|
||||||
|
fill="rgba(0,0,0,0.7)"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="M9.59162 22.7357C9.49492 22.6109 9.49492 21.4986 9.59162 19.399C8.55572 19.4347 7.90122 19.3628 7.62812 19.1833C7.21852 18.9139 6.80842 18.0833 6.44457 17.4979C6.08072 16.9125 5.27312 16.8199 4.94702 16.6891C4.62091 16.5582 4.53905 16.0247 5.84562 16.4282C7.15222 16.8316 7.21592 17.9303 7.62812 18.1872C8.04032 18.4441 9.02572 18.3317 9.47242 18.1259C9.91907 17.9201 9.88622 17.1538 9.96587 16.8503C10.0666 16.5669 9.71162 16.5041 9.70382 16.5018C9.26777 16.5018 6.97697 16.0036 6.34772 13.7852C5.71852 11.5669 6.52907 10.117 6.96147 9.49369C7.24972 9.07814 7.22422 8.19254 6.88497 6.83679C8.11677 6.67939 9.06732 7.06709 9.73672 7.99999C9.73737 8.00534 10.6143 7.47854 12.0001 7.47854C13.386 7.47854 13.8777 7.90764 14.2571 7.99999C14.6365 8.09234 14.94 6.36699 17.2834 6.83679C16.7942 7.79839 16.3844 8.99999 16.6972 9.49369C17.0099 9.98739 18.2372 11.5573 17.4833 13.7852C16.9807 15.2706 15.9927 16.1761 14.5192 16.5018C14.3502 16.5557 14.2658 16.6427 14.2658 16.7627C14.2658 16.9427 14.4942 16.9624 14.8233 17.8058C15.0426 18.368 15.0585 19.9739 14.8708 22.6234C14.3953 22.7445 14.0254 22.8257 13.7611 22.8673C13.2924 22.9409 12.7835 22.9822 12.2834 22.9982C11.7834 23.0141 11.6098 23.0123 10.9185 22.948C10.4577 22.9051 10.0154 22.8343 9.59162 22.7357Z"
|
||||||
|
fill="rgba(0,0,0,0.7)"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
1
examples/sveltekit-app/src/lib/images/svelte-logo.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.1566,22.8189c-10.4-14.8851-30.94-19.2971-45.7914-9.8348L22.2825,29.6078A29.9234,29.9234,0,0,0,8.7639,49.6506a31.5136,31.5136,0,0,0,3.1076,20.2318A30.0061,30.0061,0,0,0,7.3953,81.0653a31.8886,31.8886,0,0,0,5.4473,24.1157c10.4022,14.8865,30.9423,19.2966,45.7914,9.8348L84.7167,98.3921A29.9177,29.9177,0,0,0,98.2353,78.3493,31.5263,31.5263,0,0,0,95.13,58.117a30,30,0,0,0,4.4743-11.1824,31.88,31.88,0,0,0-5.4473-24.1157" style="fill:#ff3e00"/><path d="M45.8171,106.5815A20.7182,20.7182,0,0,1,23.58,98.3389a19.1739,19.1739,0,0,1-3.2766-14.5025,18.1886,18.1886,0,0,1,.6233-2.4357l.4912-1.4978,1.3363.9815a33.6443,33.6443,0,0,0,10.203,5.0978l.9694.2941-.0893.9675a5.8474,5.8474,0,0,0,1.052,3.8781,6.2389,6.2389,0,0,0,6.6952,2.485,5.7449,5.7449,0,0,0,1.6021-.7041L69.27,76.281a5.4306,5.4306,0,0,0,2.4506-3.631,5.7948,5.7948,0,0,0-.9875-4.3712,6.2436,6.2436,0,0,0-6.6978-2.4864,5.7427,5.7427,0,0,0-1.6.7036l-9.9532,6.3449a19.0329,19.0329,0,0,1-5.2965,2.3259,20.7181,20.7181,0,0,1-22.2368-8.2427,19.1725,19.1725,0,0,1-3.2766-14.5024,17.9885,17.9885,0,0,1,8.13-12.0513L55.8833,23.7472a19.0038,19.0038,0,0,1,5.3-2.3287A20.7182,20.7182,0,0,1,83.42,29.6611a19.1739,19.1739,0,0,1,3.2766,14.5025,18.4,18.4,0,0,1-.6233,2.4357l-.4912,1.4978-1.3356-.98a33.6175,33.6175,0,0,0-10.2037-5.1l-.9694-.2942.0893-.9675a5.8588,5.8588,0,0,0-1.052-3.878,6.2389,6.2389,0,0,0-6.6952-2.485,5.7449,5.7449,0,0,0-1.6021.7041L37.73,51.719a5.4218,5.4218,0,0,0-2.4487,3.63,5.7862,5.7862,0,0,0,.9856,4.3717,6.2437,6.2437,0,0,0,6.6978,2.4864,5.7652,5.7652,0,0,0,1.602-.7041l9.9519-6.3425a18.978,18.978,0,0,1,5.2959-2.3278,20.7181,20.7181,0,0,1,22.2368,8.2427,19.1725,19.1725,0,0,1,3.2766,14.5024,17.9977,17.9977,0,0,1-8.13,12.0532L51.1167,104.2528a19.0038,19.0038,0,0,1-5.3,2.3287" style="fill:#fff"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
BIN
examples/sveltekit-app/src/lib/images/svelte-welcome.png
Normal file
|
After Width: | Height: | Size: 352 KiB |
BIN
examples/sveltekit-app/src/lib/images/svelte-welcome.webp
Normal file
|
After Width: | Height: | Size: 113 KiB |
53
examples/sveltekit-app/src/routes/+layout.svelte
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<script>
|
||||||
|
import Header from './Header.svelte';
|
||||||
|
import './styles.css';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="app">
|
||||||
|
<Header />
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to learn SvelteKit</p>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.app {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 64rem;
|
||||||
|
margin: 0 auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 480px) {
|
||||||
|
footer {
|
||||||
|
padding: 12px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
59
examples/sveltekit-app/src/routes/+page.svelte
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<script>
|
||||||
|
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>
|
||||||
|
<title>Home</title>
|
||||||
|
<meta name="description" content="Svelte demo app" />
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h1>
|
||||||
|
<span class="welcome">
|
||||||
|
<picture>
|
||||||
|
<source srcset={welcome} type="image/webp" />
|
||||||
|
<img src={welcome_fallback} alt="Welcome" />
|
||||||
|
</picture>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
to your new<br />SvelteKit app
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
try editing <strong>src/routes/+page.svelte</strong>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<Counter />
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
3
examples/sveltekit-app/src/routes/+page.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// 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;
|
||||||
102
examples/sveltekit-app/src/routes/Counter.svelte
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { spring } from 'svelte/motion';
|
||||||
|
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
const displayed_count = spring();
|
||||||
|
$: displayed_count.set(count);
|
||||||
|
$: offset = modulo($displayed_count, 1);
|
||||||
|
|
||||||
|
function modulo(n: number, m: number) {
|
||||||
|
// handle negative numbers
|
||||||
|
return ((n % m) + m) % m;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="counter">
|
||||||
|
<button on:click={() => (count -= 1)} aria-label="Decrease the counter by one">
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 1 1">
|
||||||
|
<path d="M0,0.5 L1,0.5" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="counter-viewport">
|
||||||
|
<div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
|
||||||
|
<strong class="hidden" aria-hidden="true">{Math.floor($displayed_count + 1)}</strong>
|
||||||
|
<strong>{Math.floor($displayed_count)}</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button on:click={() => (count += 1)} aria-label="Increase the counter by one">
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 1 1">
|
||||||
|
<path d="M0,0.5 L1,0.5 M0.5,0 L0.5,1" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.counter {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter button {
|
||||||
|
width: 2em;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
touch-action: manipulation;
|
||||||
|
font-size: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter button:hover {
|
||||||
|
background-color: var(--color-bg-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 25%;
|
||||||
|
height: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
path {
|
||||||
|
vector-effect: non-scaling-stroke;
|
||||||
|
stroke-width: 2px;
|
||||||
|
stroke: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter-viewport {
|
||||||
|
width: 8em;
|
||||||
|
height: 4em;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter-viewport strong {
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--color-theme-1);
|
||||||
|
font-size: 4rem;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter-digits {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
top: -100%;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
129
examples/sveltekit-app/src/routes/Header.svelte
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
<script>
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
import logo from '$lib/images/svelte-logo.svg';
|
||||||
|
import github from '$lib/images/github.svg';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<div class="corner">
|
||||||
|
<a href="https://kit.svelte.dev">
|
||||||
|
<img src={logo} alt="SvelteKit" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<svg viewBox="0 0 2 3" aria-hidden="true">
|
||||||
|
<path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" />
|
||||||
|
</svg>
|
||||||
|
<ul>
|
||||||
|
<li aria-current={$page.url.pathname === '/' ? 'page' : undefined}>
|
||||||
|
<a href="/">Home</a>
|
||||||
|
</li>
|
||||||
|
<li aria-current={$page.url.pathname === '/about' ? 'page' : undefined}>
|
||||||
|
<a href="/about">About</a>
|
||||||
|
</li>
|
||||||
|
<li aria-current={$page.url.pathname.startsWith('/sverdle') ? 'page' : undefined}>
|
||||||
|
<a href="/sverdle">Sverdle</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<svg viewBox="0 0 2 3" aria-hidden="true">
|
||||||
|
<path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" />
|
||||||
|
</svg>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="corner">
|
||||||
|
<a href="https://github.com/sveltejs/kit">
|
||||||
|
<img src={github} alt="GitHub" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner {
|
||||||
|
width: 3em;
|
||||||
|
height: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner img {
|
||||||
|
width: 2em;
|
||||||
|
height: 2em;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
--background: rgba(255, 255, 255, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 2em;
|
||||||
|
height: 3em;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
path {
|
||||||
|
fill: var(--background);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
position: relative;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
height: 3em;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
list-style: none;
|
||||||
|
background: var(--background);
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
li[aria-current='page']::before {
|
||||||
|
--size: 6px;
|
||||||
|
content: '';
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: calc(50% - var(--size));
|
||||||
|
border: var(--size) solid transparent;
|
||||||
|
border-top: var(--size) solid var(--color-theme-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
color: var(--color-text);
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.2s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: var(--color-theme-1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
26
examples/sveltekit-app/src/routes/about/+page.svelte
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<title>About</title>
|
||||||
|
<meta name="description" content="About this app" />
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<div class="text-column">
|
||||||
|
<h1>About this app</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the
|
||||||
|
following into your command line and following the prompts:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre>npm create svelte@latest</pre>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The page you're looking at is purely static HTML, with no client-side interactivity needed.
|
||||||
|
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening
|
||||||
|
the devtools network panel and reloading.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <a href="/sverdle">Sverdle</a> page illustrates SvelteKit's data loading and form handling. Try
|
||||||
|
using it with JavaScript disabled!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
9
examples/sveltekit-app/src/routes/about/+page.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
// 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;
|
||||||
107
examples/sveltekit-app/src/routes/styles.css
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
@import '@fontsource/fira-mono';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
|
||||||
|
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
--font-mono: 'Fira Mono', monospace;
|
||||||
|
--color-bg-0: rgb(202, 216, 228);
|
||||||
|
--color-bg-1: hsl(209, 36%, 86%);
|
||||||
|
--color-bg-2: hsl(224, 44%, 95%);
|
||||||
|
--color-theme-1: #ff3e00;
|
||||||
|
--color-theme-2: #4075a6;
|
||||||
|
--color-text: rgba(0, 0, 0, 0.7);
|
||||||
|
--column-width: 42rem;
|
||||||
|
--column-margin-top: 4rem;
|
||||||
|
font-family: var(--font-body);
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-color: var(--color-bg-1);
|
||||||
|
background-size: 100vw 100vh;
|
||||||
|
background-image: radial-gradient(
|
||||||
|
50% 50% at 50% 50%,
|
||||||
|
rgba(255, 255, 255, 0.75) 0%,
|
||||||
|
rgba(255, 255, 255, 0) 100%
|
||||||
|
),
|
||||||
|
linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 15%, var(--color-bg-2) 50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
p {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--color-theme-1);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
background-color: rgba(255, 255, 255, 0.45);
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 2px 2px 6px rgb(255 255 255 / 25%);
|
||||||
|
padding: 0.5em;
|
||||||
|
overflow-x: auto;
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-column {
|
||||||
|
display: flex;
|
||||||
|
max-width: 48rem;
|
||||||
|
flex: 0.6;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button {
|
||||||
|
font-size: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus:not(:focus-visible) {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 720px) {
|
||||||
|
h1 {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visually-hidden {
|
||||||
|
border: 0;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
height: auto;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
69
examples/sveltekit-app/src/routes/sverdle/+page.server.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import { fail } from '@sveltejs/kit';
|
||||||
|
import { Game } from './game';
|
||||||
|
import type { PageServerLoad, Actions } from './$types';
|
||||||
|
|
||||||
|
export const load = (({ cookies }) => {
|
||||||
|
const game = new Game(cookies.get('sverdle'));
|
||||||
|
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* The player's guessed words so far
|
||||||
|
*/
|
||||||
|
guesses: game.guesses,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of strings like '__x_c' corresponding to the guesses, where 'x' means
|
||||||
|
* an exact match, and 'c' means a close match (right letter, wrong place)
|
||||||
|
*/
|
||||||
|
answers: game.answers,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The correct answer, revealed if the game is over
|
||||||
|
*/
|
||||||
|
answer: game.answers.length >= 6 ? game.answer : null
|
||||||
|
};
|
||||||
|
}) satisfies PageServerLoad;
|
||||||
|
|
||||||
|
export const actions = {
|
||||||
|
/**
|
||||||
|
* Modify game state in reaction to a keypress. If client-side JavaScript
|
||||||
|
* is available, this will happen in the browser instead of here
|
||||||
|
*/
|
||||||
|
update: async ({ request, cookies }) => {
|
||||||
|
const game = new Game(cookies.get('sverdle'));
|
||||||
|
|
||||||
|
const data = await request.formData();
|
||||||
|
const key = data.get('key');
|
||||||
|
|
||||||
|
const i = game.answers.length;
|
||||||
|
|
||||||
|
if (key === 'backspace') {
|
||||||
|
game.guesses[i] = game.guesses[i].slice(0, -1);
|
||||||
|
} else {
|
||||||
|
game.guesses[i] += key;
|
||||||
|
}
|
||||||
|
|
||||||
|
cookies.set('sverdle', game.toString());
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify game state in reaction to a guessed word. This logic always runs on
|
||||||
|
* the server, so that people can't cheat by peeking at the JavaScript
|
||||||
|
*/
|
||||||
|
enter: async ({ request, cookies }) => {
|
||||||
|
const game = new Game(cookies.get('sverdle'));
|
||||||
|
|
||||||
|
const data = await request.formData();
|
||||||
|
const guess = data.getAll('guess') as string[];
|
||||||
|
|
||||||
|
if (!game.enter(guess)) {
|
||||||
|
return fail(400, { badGuess: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
cookies.set('sverdle', game.toString());
|
||||||
|
},
|
||||||
|
|
||||||
|
restart: async ({ cookies }) => {
|
||||||
|
cookies.delete('sverdle');
|
||||||
|
}
|
||||||
|
} satisfies Actions;
|
||||||
406
examples/sveltekit-app/src/routes/sverdle/+page.svelte
Normal file
@@ -0,0 +1,406 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { confetti } from '@neoconfetti/svelte';
|
||||||
|
import { enhance } from '$app/forms';
|
||||||
|
import type { PageData, ActionData } from './$types';
|
||||||
|
import { reduced_motion } from './reduced-motion';
|
||||||
|
|
||||||
|
export let data: PageData;
|
||||||
|
|
||||||
|
export let form: ActionData;
|
||||||
|
|
||||||
|
/** Whether or not the user has won */
|
||||||
|
$: won = data.answers.at(-1) === 'xxxxx';
|
||||||
|
|
||||||
|
/** The index of the current guess */
|
||||||
|
$: i = won ? -1 : data.answers.length;
|
||||||
|
|
||||||
|
/** Whether the current guess can be submitted */
|
||||||
|
$: submittable = data.guesses[i]?.length === 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A map of classnames for all letters that have been guessed,
|
||||||
|
* used for styling the keyboard
|
||||||
|
*/
|
||||||
|
let classnames: Record<string, 'exact' | 'close' | 'missing'>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A map of descriptions for all letters that have been guessed,
|
||||||
|
* used for adding text for assistive technology (e.g. screen readers)
|
||||||
|
*/
|
||||||
|
let description: Record<string, string>;
|
||||||
|
|
||||||
|
$: {
|
||||||
|
classnames = {};
|
||||||
|
description = {};
|
||||||
|
|
||||||
|
data.answers.forEach((answer, i) => {
|
||||||
|
const guess = data.guesses[i];
|
||||||
|
|
||||||
|
for (let i = 0; i < 5; i += 1) {
|
||||||
|
const letter = guess[i];
|
||||||
|
|
||||||
|
if (answer[i] === 'x') {
|
||||||
|
classnames[letter] = 'exact';
|
||||||
|
description[letter] = 'correct';
|
||||||
|
} else if (!classnames[letter]) {
|
||||||
|
classnames[letter] = answer[i] === 'c' ? 'close' : 'missing';
|
||||||
|
description[letter] = answer[i] === 'c' ? 'present' : 'absent';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify the game state without making a trip to the server,
|
||||||
|
* if client-side JavaScript is enabled
|
||||||
|
*/
|
||||||
|
function update(event: MouseEvent) {
|
||||||
|
const guess = data.guesses[i];
|
||||||
|
const key = (event.target as HTMLButtonElement).getAttribute(
|
||||||
|
'data-key'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (key === 'backspace') {
|
||||||
|
data.guesses[i] = guess.slice(0, -1);
|
||||||
|
if (form?.badGuess) form.badGuess = false;
|
||||||
|
} else if (guess.length < 5) {
|
||||||
|
data.guesses[i] += key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trigger form logic in response to a keydown event, so that
|
||||||
|
* desktop users can use the keyboard to play the game
|
||||||
|
*/
|
||||||
|
function keydown(event: KeyboardEvent) {
|
||||||
|
if (event.metaKey) return;
|
||||||
|
|
||||||
|
document
|
||||||
|
.querySelector(`[data-key="${event.key}" i]`)
|
||||||
|
?.dispatchEvent(new MouseEvent('click', { cancelable: true }));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:window on:keydown={keydown} />
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>Sverdle</title>
|
||||||
|
<meta name="description" content="A Wordle clone written in SvelteKit" />
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<h1 class="visually-hidden">Sverdle</h1>
|
||||||
|
|
||||||
|
<form
|
||||||
|
method="POST"
|
||||||
|
action="?/enter"
|
||||||
|
use:enhance={() => {
|
||||||
|
// prevent default callback from resetting the form
|
||||||
|
return ({ update }) => {
|
||||||
|
update({ reset: false });
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<a class="how-to-play" href="/sverdle/how-to-play">How to play</a>
|
||||||
|
|
||||||
|
<div class="grid" class:playing={!won} class:bad-guess={form?.badGuess}>
|
||||||
|
{#each Array(6) as _, row}
|
||||||
|
{@const current = row === i}
|
||||||
|
<h2 class="visually-hidden">Row {row + 1}</h2>
|
||||||
|
<div class="row" class:current>
|
||||||
|
{#each Array(5) as _, column}
|
||||||
|
{@const answer = data.answers[row]?.[column]}
|
||||||
|
{@const value = data.guesses[row]?.[column] ?? ''}
|
||||||
|
{@const selected = current && column === data.guesses[row].length}
|
||||||
|
{@const exact = answer === 'x'}
|
||||||
|
{@const close = answer === 'c'}
|
||||||
|
{@const missing = answer === '_'}
|
||||||
|
<div class="letter" class:exact class:close class:missing class:selected>
|
||||||
|
{value}
|
||||||
|
<span class="visually-hidden">
|
||||||
|
{#if exact}
|
||||||
|
(correct)
|
||||||
|
{:else if close}
|
||||||
|
(present)
|
||||||
|
{:else if missing}
|
||||||
|
(absent)
|
||||||
|
{:else}
|
||||||
|
empty
|
||||||
|
{/if}
|
||||||
|
</span>
|
||||||
|
<input name="guess" disabled={!current} type="hidden" {value} />
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls">
|
||||||
|
{#if won || data.answers.length >= 6}
|
||||||
|
{#if !won && data.answer}
|
||||||
|
<p>the answer was "{data.answer}"</p>
|
||||||
|
{/if}
|
||||||
|
<button data-key="enter" class="restart selected" formaction="?/restart">
|
||||||
|
{won ? 'you won :)' : `game over :(`} play again?
|
||||||
|
</button>
|
||||||
|
{:else}
|
||||||
|
<div class="keyboard">
|
||||||
|
<button data-key="enter" class:selected={submittable} disabled={!submittable}>enter</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
on:click|preventDefault={update}
|
||||||
|
data-key="backspace"
|
||||||
|
formaction="?/update"
|
||||||
|
name="key"
|
||||||
|
value="backspace"
|
||||||
|
>
|
||||||
|
back
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{#each ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] as row}
|
||||||
|
<div class="row">
|
||||||
|
{#each row as letter}
|
||||||
|
<button
|
||||||
|
on:click|preventDefault={update}
|
||||||
|
data-key={letter}
|
||||||
|
class={classnames[letter]}
|
||||||
|
disabled={data.guesses[i].length === 5}
|
||||||
|
formaction="?/update"
|
||||||
|
name="key"
|
||||||
|
value={letter}
|
||||||
|
aria-label="{letter} {description[letter] || ''}"
|
||||||
|
>
|
||||||
|
{letter}
|
||||||
|
</button>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{#if won}
|
||||||
|
<div
|
||||||
|
style="position: absolute; left: 50%; top: 30%"
|
||||||
|
use:confetti={{
|
||||||
|
particleCount: $reduced_motion ? 0 : undefined,
|
||||||
|
force: 0.7,
|
||||||
|
stageWidth: window.innerWidth,
|
||||||
|
stageHeight: window.innerHeight,
|
||||||
|
colors: ['#ff3e00', '#40b3ff', '#676778']
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
form {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 1rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.how-to-play {
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.how-to-play::before {
|
||||||
|
content: 'i';
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-weight: 900;
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
padding: 0.2em;
|
||||||
|
line-height: 1;
|
||||||
|
border: 1.5px solid var(--color-text);
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 0.5em 0 0;
|
||||||
|
position: relative;
|
||||||
|
top: -0.05em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
--width: min(100vw, 40vh, 380px);
|
||||||
|
max-width: var(--width);
|
||||||
|
align-self: center;
|
||||||
|
justify-self: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid .row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
grid-gap: 0.2rem;
|
||||||
|
margin: 0 0 0.2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: no-preference) {
|
||||||
|
.grid.bad-guess .row.current {
|
||||||
|
animation: wiggle 0.5s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid.playing .row.current {
|
||||||
|
filter: drop-shadow(3px 3px 10px var(--color-bg-0));
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter {
|
||||||
|
aspect-ratio: 1;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-transform: lowercase;
|
||||||
|
border: none;
|
||||||
|
font-size: calc(0.08 * var(--width));
|
||||||
|
border-radius: 2px;
|
||||||
|
background: white;
|
||||||
|
margin: 0;
|
||||||
|
color: rgba(0, 0, 0, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter.missing {
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter.exact {
|
||||||
|
background: var(--color-theme-2);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.letter.close {
|
||||||
|
border: 2px solid var(--color-theme-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected {
|
||||||
|
outline: 2px solid var(--color-theme-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.controls {
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: min(18vh, 10rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard {
|
||||||
|
--gap: 0.2rem;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--gap);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard .row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.2rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button,
|
||||||
|
.keyboard button:disabled {
|
||||||
|
--size: min(8vw, 4vh, 40px);
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
width: var(--size);
|
||||||
|
border: none;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: calc(var(--size) * 0.5);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button.exact {
|
||||||
|
background: var(--color-theme-2);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button.missing {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button.close {
|
||||||
|
border: 2px solid var(--color-theme-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button:focus {
|
||||||
|
background: var(--color-theme-1);
|
||||||
|
color: white;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button[data-key='enter'],
|
||||||
|
.keyboard button[data-key='backspace'] {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: calc(1.5 * var(--size));
|
||||||
|
height: calc(1 / 3 * (100% - 2 * var(--gap)));
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: calc(0.3 * var(--size));
|
||||||
|
padding-top: calc(0.15 * var(--size));
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button[data-key='enter'] {
|
||||||
|
right: calc(50% + 3.5 * var(--size) + 0.8rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button[data-key='backspace'] {
|
||||||
|
left: calc(50% + 3.5 * var(--size) + 0.8rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard button[data-key='enter']:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.restart {
|
||||||
|
width: 100%;
|
||||||
|
padding: 1rem;
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
border-radius: 2px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.restart:focus,
|
||||||
|
.restart:hover {
|
||||||
|
background: var(--color-theme-1);
|
||||||
|
color: white;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes wiggle {
|
||||||
|
0% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
10% {
|
||||||
|
transform: translateX(-2px);
|
||||||
|
}
|
||||||
|
30% {
|
||||||
|
transform: translateX(4px);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateX(-6px);
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
transform: translateX(+4px);
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
transform: translateX(-2px);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
75
examples/sveltekit-app/src/routes/sverdle/game.ts
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
import { words, allowed } from './words.server';
|
||||||
|
|
||||||
|
export class Game {
|
||||||
|
index: number;
|
||||||
|
guesses: string[];
|
||||||
|
answers: string[];
|
||||||
|
answer: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a game object from the player's cookie, or initialise a new game
|
||||||
|
*/
|
||||||
|
constructor(serialized: string | undefined = undefined) {
|
||||||
|
if (serialized) {
|
||||||
|
const [index, guesses, answers] = serialized.split('-');
|
||||||
|
|
||||||
|
this.index = +index;
|
||||||
|
this.guesses = guesses ? guesses.split(' ') : [];
|
||||||
|
this.answers = answers ? answers.split(' ') : [];
|
||||||
|
} else {
|
||||||
|
this.index = Math.floor(Math.random() * words.length);
|
||||||
|
this.guesses = ['', '', '', '', '', ''];
|
||||||
|
this.answers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.answer = words[this.index];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update game state based on a guess of a five-letter word. Returns
|
||||||
|
* true if the guess was valid, false otherwise
|
||||||
|
*/
|
||||||
|
enter(letters: string[]) {
|
||||||
|
const word = letters.join('');
|
||||||
|
const valid = allowed.has(word);
|
||||||
|
|
||||||
|
if (!valid) return false;
|
||||||
|
|
||||||
|
this.guesses[this.answers.length] = word;
|
||||||
|
|
||||||
|
const available = Array.from(this.answer);
|
||||||
|
const answer = Array(5).fill('_');
|
||||||
|
|
||||||
|
// first, find exact matches
|
||||||
|
for (let i = 0; i < 5; i += 1) {
|
||||||
|
if (letters[i] === available[i]) {
|
||||||
|
answer[i] = 'x';
|
||||||
|
available[i] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// then find close matches (this has to happen
|
||||||
|
// in a second step, otherwise an early close
|
||||||
|
// match can prevent a later exact match)
|
||||||
|
for (let i = 0; i < 5; i += 1) {
|
||||||
|
if (answer[i] === '_') {
|
||||||
|
const index = available.indexOf(letters[i]);
|
||||||
|
if (index !== -1) {
|
||||||
|
answer[i] = 'c';
|
||||||
|
available[index] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.answers.push(answer.join(''));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize game state so it can be set as a cookie
|
||||||
|
*/
|
||||||
|
toString() {
|
||||||
|
return `${this.index}-${this.guesses.join(' ')}-${this.answers.join(' ')}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<title>How to play Sverdle</title>
|
||||||
|
<meta name="description" content="How to play Sverdle" />
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<div class="text-column">
|
||||||
|
<h1>How to play Sverdle</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Sverdle is a clone of <a href="https://www.nytimes.com/games/wordle/index.html">Wordle</a>, the
|
||||||
|
word guessing game. To play, enter a five-letter English word. For example:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="example">
|
||||||
|
<span class="close">r</span>
|
||||||
|
<span class="missing">i</span>
|
||||||
|
<span class="close">t</span>
|
||||||
|
<span class="missing">z</span>
|
||||||
|
<span class="exact">y</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <span class="exact">y</span> is in the right place. <span class="close">r</span> and
|
||||||
|
<span class="close">t</span>
|
||||||
|
are the right letters, but in the wrong place. The other letters are wrong, and can be discarded.
|
||||||
|
Let's make another guess:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="example">
|
||||||
|
<span class="exact">p</span>
|
||||||
|
<span class="exact">a</span>
|
||||||
|
<span class="exact">r</span>
|
||||||
|
<span class="exact">t</span>
|
||||||
|
<span class="exact">y</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>This time we guessed right! You have <strong>six</strong> guesses to get the word.</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Unlike the original Wordle, Sverdle runs on the server instead of in the browser, making it
|
||||||
|
impossible to cheat. It uses <code><form></code> and cookies to submit data, meaning you can
|
||||||
|
even play with JavaScript disabled!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
span {
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.8em;
|
||||||
|
width: 2.4em;
|
||||||
|
height: 2.4em;
|
||||||
|
background-color: white;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 2px;
|
||||||
|
border-width: 2px;
|
||||||
|
color: rgba(0, 0, 0, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.missing {
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
border-style: solid;
|
||||||
|
border-color: var(--color-theme-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.exact {
|
||||||
|
background: var(--color-theme-2);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin: 1rem 0;
|
||||||
|
gap: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example span {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p span {
|
||||||
|
position: relative;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 1px;
|
||||||
|
font-size: 0.4em;
|
||||||
|
transform: scale(2) translate(0, -10%);
|
||||||
|
margin: 0 1em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
// 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;
|
||||||
23
examples/sveltekit-app/src/routes/sverdle/reduced-motion.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { readable } from 'svelte/store';
|
||||||
|
import { browser } from '$app/environment';
|
||||||
|
|
||||||
|
const reduced_motion_query = '(prefers-reduced-motion: reduce)';
|
||||||
|
|
||||||
|
const get_initial_motion_preference = () => {
|
||||||
|
if (!browser) return false;
|
||||||
|
return window.matchMedia(reduced_motion_query).matches;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const reduced_motion = readable(get_initial_motion_preference(), (set) => {
|
||||||
|
if (browser) {
|
||||||
|
const set_reduced_motion = (event: MediaQueryListEvent) => {
|
||||||
|
set(event.matches);
|
||||||
|
};
|
||||||
|
const media_query_list = window.matchMedia(reduced_motion_query);
|
||||||
|
media_query_list.addEventListener('change', set_reduced_motion);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
media_query_list.removeEventListener('change', set_reduced_motion);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
12980
examples/sveltekit-app/src/routes/sverdle/words.server.ts
Normal file
BIN
examples/sveltekit-app/static/favicon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
3
examples/sveltekit-app/static/robots.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
17
examples/sveltekit-app/svelte.config.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import adapter from "@ptkdev/sveltekit-electron-adapter";
|
||||||
|
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||||
|
|
||||||
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
|
const config = {
|
||||||
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||||
|
// for more information about preprocessors
|
||||||
|
preprocess: vitePreprocess(),
|
||||||
|
|
||||||
|
kit: {
|
||||||
|
adapter: adapter({
|
||||||
|
strict: false,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
17
examples/sveltekit-app/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
||||||
|
//
|
||||||
|
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||||
|
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||||
|
}
|
||||||
6
examples/sveltekit-app/vite.config.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [sveltekit()]
|
||||||
|
});
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
"displayName": "SvelteKit Adapter for Desktop Apps with Electron",
|
"displayName": "SvelteKit Adapter for Desktop Apps with Electron",
|
||||||
"description": "Adapter for SvelteKit apps that prerenders your entire site as a collection of static files for use with Electron",
|
"description": "Adapter for SvelteKit apps that prerenders your entire site as a collection of static files for use with Electron",
|
||||||
"version": "0.2.2-nightly.0",
|
"version": "0.2.2-nightly.0",
|
||||||
"main": "./index.js",
|
"main": "./app/adapter/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./index.d.ts",
|
"types": "./app/adapter/index.d.ts",
|
||||||
"import": "./index.js"
|
"import": "./app/adapter/index.js"
|
||||||
},
|
},
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json"
|
||||||
},
|
},
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cp ./app/**/* . -r",
|
"build": "echo \"Compiling...\"",
|
||||||
"release": "npm run build",
|
"release": "npm run build",
|
||||||
"test": "jest app",
|
"test": "jest app",
|
||||||
"docs": "git submodule update --recursive && markserv ./README.md",
|
"docs": "git submodule update --recursive && markserv ./README.md",
|
||||||
|
|||||||