-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
- Loading branch information
1 parent
ec65ed9
commit abf0aa8
Showing
40 changed files
with
14,990 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "svelte", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"build": "vite build", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"dev": "vite dev", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@vercel/speed-insights": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@fontsource/fira-mono": "^4.5.10", | ||
"@neoconfetti/svelte": "^1.0.0", | ||
"@sveltejs/adapter-auto": "^2.0.0", | ||
"@sveltejs/kit": "^1.20.4", | ||
"@types/cookie": "^0.5.1", | ||
"svelte": "^4.0.5", | ||
"svelte-check": "^3.4.3", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0", | ||
"vite": "^4.4.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script> | ||
import Header from './Header.svelte'; | ||
import './styles.css'; | ||
import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; | ||
injectSpeedInsights(); | ||
</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> |
Oops, something went wrong.
abf0aa8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
speed-insights-remix – ./apps/remix
speed-insights-remix-vercel-analytics.vercel.app
speed-insights-remix-git-main-vercel-analytics.vercel.app
speed-insights-remix.vercel.app