Skip to content

Commit 39a3f21

Browse files
committed
Migrate demo to svelte-kit
1 parent b3d0086 commit 39a3f21

File tree

13 files changed

+532
-566
lines changed

13 files changed

+532
-566
lines changed

src/app.postcss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,25 @@
33
@tailwind base;
44
@tailwind components;
55
@tailwind utilities;
6+
7+
@layer base {
8+
html {
9+
@apply h-full bg-gray-50 text-gray-900 font-sans font-normal;
10+
-webkit-tap-highlight-color: transparent;
11+
}
12+
a {
13+
@apply text-blue-400 hover:text-blue-600 underline;
14+
}
15+
button {
16+
@apply w-40 h-12 text-gray-600 hover:text-gray-900 text-xs font-bold tracking-wide bg-white border border-gray-300 hover:border-blue-800 rounded-sm focus:outline-none focus:ring px-2 m-2;
17+
}
18+
button.selected {
19+
@apply bg-blue-200;
20+
}
21+
}
22+
23+
@layer components {
24+
.opacity-97 {
25+
opacity: 0.97;
26+
}
27+
}

src/routes/+layout.svelte

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,51 @@
11
<script>
2+
import '@fontsource/inter/variable.css'
23
import '../app.postcss'
34
import '../app.postcss'
5+
import 'prismjs/themes/prism-tomorrow.css'
6+
import { dev } from '$app/environment'
47
</script>
58

6-
<slot />
9+
<svelte:head>
10+
<title>svelte-toast | DEMO</title>
11+
<meta
12+
name="description"
13+
content="Simple elegant toast notifications for modern web frontends. Use in Vanilla JS or as a Svelte component."
14+
/>
15+
{#if !dev}
16+
<script>
17+
window.dataLayer = window.dataLayer || []
18+
function gtag() {
19+
window.dataLayer.push(arguments)
20+
}
21+
gtag('js', new Date())
22+
gtag('config', 'G-G9JC5N7N1H')
23+
location.protocol === 'https:' &&
24+
(function () {
25+
const script = document.createElement('script')
26+
script.async = true
27+
script.src = 'https://www.googletagmanager.com/gtag/js?id=G-G9JC5N7N1H'
28+
document.head.appendChild(script)
29+
})()
30+
</script>
31+
{/if}
32+
</svelte:head>
33+
34+
<div class="pt-8 pb-16">
35+
<h1 class="text-4xl text-center">svelte-toast</h1>
36+
<div class="h-16 flex flex-col items-center">
37+
<a href="https://github.com/zerodevx/svelte-toast" title="Fork me on Github">
38+
<img
39+
class="opacity-97 hover:opacity-75"
40+
src="https://img.shields.io/npm/v/@zerodevx/svelte-toast/latest?logo=github&style=for-the-badge&color=blue&label=github"
41+
alt="@zerodevx"
42+
/>
43+
</a>
44+
</div>
45+
<p class="container px-2 mb-4">
46+
Simple, elegant, generic, flexible and performant toast notifications. Because a demo helps
47+
better than a thousand API docs, so here it is. Use in Vanilla JS (8kb gzipped) or as a Svelte
48+
component.
49+
</p>
50+
<slot />
51+
</div>

src/routes/+page.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const prerender = true
2+
export const trailingSlash = 'always'

0 commit comments

Comments
 (0)