Compare commits
8 Commits
master
..
d86ac40602
| Author | SHA1 | Date | |
|---|---|---|---|
| d86ac40602 | |||
| 395d77b71c | |||
| 5af2b996d6 | |||
| 119e458c14 | |||
| 8308049a90 | |||
| db91d91d05 | |||
| b4d0655f62 | |||
| 1430091143 |
@@ -1 +1,2 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
|
webapp2/
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
.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
|
|
||||||
+4
-20
@@ -1,31 +1,15 @@
|
|||||||
/** @type { import("eslint").Linter.Config } */
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: [
|
extends: ['eslint:recommended', 'prettier'],
|
||||||
'eslint:recommended',
|
plugins: ['svelte3'],
|
||||||
'plugin:@typescript-eslint/recommended',
|
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
||||||
'plugin:svelte/recommended',
|
|
||||||
'prettier'
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['@typescript-eslint'],
|
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020
|
||||||
extraFileExtensions: ['.svelte']
|
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es2017: true,
|
es2017: true,
|
||||||
node: true
|
node: true
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['*.svelte'],
|
|
||||||
parser: 'svelte-eslint-parser',
|
|
||||||
parserOptions: {
|
|
||||||
parser: '@typescript-eslint/parser'
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-2
@@ -6,5 +6,4 @@ node_modules
|
|||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
vite.config.js.timestamp-*
|
package-lock.json
|
||||||
vite.config.ts.timestamp-*
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Ignore files for PNPM, NPM and YARN
|
|
||||||
pnpm-lock.yaml
|
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
+1
-3
@@ -2,7 +2,5 @@
|
|||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"printWidth": 100,
|
"printWidth": 100
|
||||||
"plugins": ["prettier-plugin-svelte"],
|
|
||||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -1,6 +1,6 @@
|
|||||||
# create-svelte
|
# create-svelte
|
||||||
|
|
||||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/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
|
## Creating a project
|
||||||
|
|
||||||
@@ -8,12 +8,14 @@ If you're seeing this, you've probably already done this step. Congrats!
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# create a new project in the current directory
|
# create a new project in the current directory
|
||||||
npm create svelte@latest
|
npm init svelte@next
|
||||||
|
|
||||||
# create a new project in my-app
|
# create a new project in my-app
|
||||||
npm create svelte@latest my-app
|
npm init svelte@next my-app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> Note: the `@next` is temporary
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||||
@@ -27,12 +29,10 @@ npm run dev -- --open
|
|||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
To create a production version of your app:
|
Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
You can preview the production build with `npm run preview`.
|
> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
|
||||||
|
|
||||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"$lib": ["src/lib"],
|
||||||
|
"$lib/*": ["src/lib/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
|
||||||
|
}
|
||||||
Generated
+2310
-2668
File diff suppressed because it is too large
Load Diff
+18
-29
@@ -1,37 +1,26 @@
|
|||||||
{
|
{
|
||||||
"name": "webapp",
|
"name": "webapp",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"type": "module",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "svelte-kit dev",
|
||||||
"build": "vite build",
|
"build": "svelte-kit build",
|
||||||
"preview": "vite preview",
|
"package": "svelte-kit package",
|
||||||
"prepare": "svelte-kit sync || echo ''",
|
"preview": "svelte-kit preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
|
||||||
"lint": "prettier --check . && eslint .",
|
|
||||||
"format": "prettier --write ."
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^1.2.5",
|
"@sveltejs/adapter-auto": "next",
|
||||||
"@eslint/js": "^9.18.0",
|
"@sveltejs/kit": "next",
|
||||||
"@sveltejs/adapter-static": "^3.0.8",
|
"eslint": "^7.32.0",
|
||||||
"@sveltejs/kit": "^2.16.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
"eslint-plugin-svelte3": "^3.2.1",
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"prettier": "^2.4.1",
|
||||||
"eslint": "^9.18.0",
|
"prettier-plugin-svelte": "^2.4.0",
|
||||||
"eslint-config-prettier": "^10.0.1",
|
"svelte": "^3.44.0"
|
||||||
"eslint-plugin-svelte": "^2.46.1",
|
},
|
||||||
"globals": "^15.14.0",
|
"type": "module",
|
||||||
"prettier": "^3.4.2",
|
"dependencies": {
|
||||||
"prettier-plugin-svelte": "^3.3.3",
|
"@sveltejs/adapter-static": "^1.0.0-next.25"
|
||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
||||||
"svelte": "^5.0.0",
|
|
||||||
"svelte-check": "^4.0.0",
|
|
||||||
"tailwindcss": "^4.0.0",
|
|
||||||
"typescript": "^5.0.0",
|
|
||||||
"typescript-eslint": "^8.20.0",
|
|
||||||
"vite": "^6.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-13
@@ -1,13 +0,0 @@
|
|||||||
// See https://kit.svelte.dev/docs/types#app
|
|
||||||
// for information about these interfaces
|
|
||||||
declare global {
|
|
||||||
namespace App {
|
|
||||||
// interface Error {}
|
|
||||||
// interface Locals {}
|
|
||||||
// interface PageData {}
|
|
||||||
// interface PageState {}
|
|
||||||
// interface Platform {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export {};
|
|
||||||
+7
-5
@@ -1,12 +1,14 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
<meta name="description" content="" />
|
||||||
|
<link rel="icon" href="%svelte.assets%/favicon.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
%sveltekit.head%
|
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"/>
|
||||||
|
%svelte.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body>
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div id="svelte">%svelte.body%</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="@sveltejs/kit" />
|
||||||
@@ -1 +0,0 @@
|
|||||||
// place files you want to import through the `$lib` alias in this folder.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export const prerender = true;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<h1>Welcome to SvelteKit</h1>
|
|
||||||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<main class="p-4 text-gray-300">
|
||||||
|
<svg height="100%" width="100%">
|
||||||
|
<line x1=0 y1=4 x2=400 y2=4/>
|
||||||
|
<line x1=0 y1=34 x2=200 y2=34/>
|
||||||
|
<line x1=0 y1=64 x2=300 y2=64/>
|
||||||
|
<line x1=0 y1=94 x2=280 y2=94/>
|
||||||
|
</svg>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
svg line {
|
||||||
|
stroke: currentColor;
|
||||||
|
stroke-width: 12;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
import Navbar from "./menu/_Navbar.svelte";
|
||||||
|
import Sidebar from "./menu/_Sidebar.svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main class="w-full h-full">
|
||||||
|
<Sidebar bind:open/>
|
||||||
|
<Navbar bind:sidebar={open}/>
|
||||||
|
|
||||||
|
<slot></slot>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:global(body) {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
main {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<title>About</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<h1>About this site</h1>
|
||||||
|
<p>TODO ...</p>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
import Main from "./_Main.svelte";
|
||||||
|
|
||||||
|
export let name = "Test 2";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main class="w-full h-full">
|
||||||
|
<h1>Welcome to SvelteKit</h1>
|
||||||
|
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
||||||
|
|
||||||
|
<Main name={name} />
|
||||||
|
</main>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<script>
|
||||||
|
export let open = false
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button class="text-gray-500 hover:text-gray-700 cursor-pointer mr-4 border-none focus:outline-none" class:open on:click={() => open = !open}>
|
||||||
|
<svg width=32 height=24>
|
||||||
|
<line id="top" x1=0 y1=2 x2=32 y2=2/>
|
||||||
|
<line id="middle" x1=0 y1=12 x2=24 y2=12/>
|
||||||
|
<line id="bottom" x1=0 y1=22 x2=32 y2=22/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
svg {
|
||||||
|
min-height: 24px;
|
||||||
|
transition: transform 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg line {
|
||||||
|
stroke: currentColor;
|
||||||
|
stroke-width: 3;
|
||||||
|
transition: transform 0.3s ease-in-out
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
z-index: 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
.open svg {
|
||||||
|
transform: scale(0.7)
|
||||||
|
}
|
||||||
|
|
||||||
|
.open #top {
|
||||||
|
transform: translate(6px, 0px) rotate(45deg)
|
||||||
|
}
|
||||||
|
|
||||||
|
.open #middle {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.open #bottom {
|
||||||
|
transform: translate(-12px, 9px) rotate(-45deg)
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<svg width=auto height=30>
|
||||||
|
<text x=0 y=20>ACME</text>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
text {
|
||||||
|
fill: currentColor
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
After Width: | Height: | Size: 111 B |
@@ -0,0 +1,4 @@
|
|||||||
|
<nav class="hidden text-gray-500 uppercase text-bold sm:block">
|
||||||
|
<a href="/" class="hover:text-gray-700 hover:no-underline">Home</a>
|
||||||
|
<a href="/about" class="hover:text-gray-700 hover:no-underline">About</a>
|
||||||
|
</nav>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<script>
|
||||||
|
import Logo from './_Logo.svelte';
|
||||||
|
import Hamburger from './_Hamburger.svelte';
|
||||||
|
import Menu from './_Menu.svelte';
|
||||||
|
|
||||||
|
export let sidebar = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<header class="flex justify-between bg-gray-200 p-2 items-center text-gray-600 border-b-2">
|
||||||
|
<nav class="flex">
|
||||||
|
<Hamburger bind:open={sidebar}/>
|
||||||
|
<Logo/>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<Menu/>
|
||||||
|
</header>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
export let open = false
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
open = false
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<aside class="absolute w-full h-full bg-gray-200 border-r-2 shadow-lg" class:open>
|
||||||
|
<nav class="p-12 text-xl">
|
||||||
|
<a class="block" href="/" on:click={close}>Home</a>
|
||||||
|
<a class="block" href="/about" on:click={close}>About</a>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
aside {
|
||||||
|
left: -100%;
|
||||||
|
transition: left 0.3s ease-in-out
|
||||||
|
}
|
||||||
|
|
||||||
|
.open {
|
||||||
|
left: 0
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,17 +1,12 @@
|
|||||||
import adapter from '@sveltejs/adapter-static';
|
import adapter from '@sveltejs/adapter-static';
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
||||||
// for more information about preprocessors
|
|
||||||
preprocess: vitePreprocess(),
|
|
||||||
|
|
||||||
kit: {
|
kit: {
|
||||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
|
||||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
||||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
|
|
||||||
|
// hydrate the <div id="svelte"> element in src/app.html
|
||||||
|
target: '#svelte'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"strict": true,
|
|
||||||
"moduleResolution": "bundler"
|
|
||||||
}
|
|
||||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
|
||||||
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
|
|
||||||
//
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
|
||||||
import { defineConfig } from 'vite';
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [sveltekit()]
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user