This commit is contained in:
Jack 2023-09-20 13:00:07 +02:00
commit e98bc6a688
18 changed files with 2061 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
engine-strict=true
resolution-mode=highest

38
README.md Normal file
View 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.

1870
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "wu2-m2",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"sass": "^1.67.0",
"svelte": "^4.0.5",
"svelte-preprocess": "^5.0.4",
"vite": "^4.4.2"
},
"type": "module"
}

12
src/app.html Normal file
View 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>

View File

@ -0,0 +1,9 @@
<footer>
<p>footer</p>
</footer>
<style lang="scss">
footer{
border: 1px solid blue;
}
</style>

View File

@ -0,0 +1,18 @@
<script>
import Nav from "$lib/components/Nav.svelte";
</script>
<header>
<h1>SvelteKit</h1>
<Nav />
</header>
<style lang="scss">
header{
border: 1px solid red;
h1{
font-size: 2.4rem;
}
}
</style>

View File

@ -0,0 +1,15 @@
<nav>
<ul>
<li><a href="/om">OM</a></li>
<li><a href="/kurs">KURS</a></li>
</ul>
</nav>
<style lang="scss">
nav{
border: 1px solid green;
}
</style>

10
src/lib/global.scss Normal file
View File

@ -0,0 +1,10 @@
h1{
color: purple
}
section{
p{
color: blue;
font-size: 30px;
}
}

1
src/lib/index.js Normal file
View File

@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@ -0,0 +1,8 @@
<script>
import '$lib/global.scss';
import Header from "$lib/components/Header.svelte";
import Footer from "$lib/components/Footer.svelte";
</script>
<Header />
<slot />
<Footer />

13
src/routes/+page.svelte Normal file
View File

@ -0,0 +1,13 @@
<main>
<h1>Welcome to SvelteKit med Jack</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
</main>
<style lang="scss">
main{
border: 1px solid black;
}
p{
color: blue;
}
</style>

View File

@ -0,0 +1 @@
<p>kurs</p>

View File

@ -0,0 +1,12 @@
<h2>Om SvelteKit</h2>
<div><p>Hej</p></div>
<section><p>På dig</p></section>
<style lang="scss">
div{
p{
color: red;
}
}
</style>

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

15
svelte.config.js Normal file
View File

@ -0,0 +1,15 @@
import adapter from '@sveltejs/adapter-node';
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: preprocess(),
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()
}
};
export default config;

6
vite.config.js Normal file
View File

@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});