Compare commits
21 Commits
v0.9
..
2c87b8dde1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c87b8dde1 | |||
| e65f5955dd | |||
| fa6c94153f | |||
| 31a9d21b71 | |||
| c3b6c4c547 | |||
| b65f4b91f2 | |||
| 8301f34a91 | |||
| bfc0f5e872 | |||
| aab713de3a | |||
| 3d01f06936 | |||
| 5b26406011 | |||
| 6eb95435ce | |||
| eaf6d18bc7 | |||
| d86ac40602 | |||
| 395d77b71c | |||
| 5af2b996d6 | |||
| 119e458c14 | |||
| 8308049a90 | |||
| db91d91d05 | |||
| b4d0655f62 | |||
| 1430091143 |
@@ -1 +1,2 @@
|
||||
__pycache__
|
||||
webapp2/
|
||||
@@ -11,7 +11,7 @@ Run npm install in the webapp component to instanciate the modules required by s
|
||||
cd webapp
|
||||
# to use Typescript run:
|
||||
# Node scripts/setupTypeScrupt.js
|
||||
npm install
|
||||
npm ci
|
||||
# to start a local development server for the svelte app only:
|
||||
npm run dev
|
||||
```
|
||||
@@ -32,3 +32,11 @@ In the project folder do:
|
||||
```
|
||||
|
||||
Navigate to [http://127.0.0.1:5000/index.html](http://127.0.0.1:5000/index.html) to see the result
|
||||
|
||||
|
||||
# Thanks
|
||||
|
||||
Special thanks go to
|
||||
* [Joshua Nussbaum](https://dev.to/joshnuss/creating-a-sidebar-menu-in-svelte-ih2) for providing this beautiful slider menu
|
||||
* [Linus Benkner](https://linu.us/sveltekit-with-tailwindcss-v3) for providing the blueprint for the tailwind integration
|
||||
* [The SvelteKit project](https://kit.svelte.dev/) for providing the Framework
|
||||
+11
-2
@@ -3,6 +3,15 @@
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-svelte"],
|
||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||
"plugins": [
|
||||
"prettier-plugin-svelte"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.svelte",
|
||||
"options": {
|
||||
"parser": "svelte"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"$lib": ["src/lib"],
|
||||
"$lib/*": ["src/lib/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
|
||||
}
|
||||
Generated
+1851
-153
File diff suppressed because it is too large
Load Diff
+7
-2
@@ -12,7 +12,6 @@
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
@@ -26,9 +25,15 @@
|
||||
"prettier-plugin-svelte": "^3.1.2",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte-check": "^3.6.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^5.0.3"
|
||||
},
|
||||
"type": "module"
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"autoprefixer": "^10.4.19",
|
||||
"cssnano": "^7.0.1",
|
||||
"postcss": "^8.4.38"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const tailwindcss = require("tailwindcss")
|
||||
const autoprefixer = require("autoprefixer")
|
||||
const cssnano = require("cssnano")
|
||||
|
||||
const mode = process.env.NODE_ENV
|
||||
const dev = mode === "development"
|
||||
|
||||
const config = {
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
autoprefixer(),
|
||||
!dev &&
|
||||
cssnano({
|
||||
preset: "default",
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
@@ -0,0 +1,12 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
h1 {
|
||||
@apply text-2xl;
|
||||
}
|
||||
h2 {
|
||||
@apply text-xl;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
<!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>
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/// <reference types="@sveltejs/kit" />
|
||||
@@ -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=100% 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 z-10" 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>
|
||||
@@ -0,0 +1,26 @@
|
||||
<script>
|
||||
import Navbar from '$lib/menu/Navbar.svelte';
|
||||
import Sidebar from '$lib/menu/Sidebar.svelte';
|
||||
import '../app.css';
|
||||
|
||||
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>
|
||||
@@ -1,2 +1,4 @@
|
||||
<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>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<svelte:head>
|
||||
<title>About</title>
|
||||
</svelte:head>
|
||||
|
||||
<h1>About this site</h1>
|
||||
<p>TODO ...</p>
|
||||
@@ -0,0 +1,14 @@
|
||||
const config = {
|
||||
mode: "jit",
|
||||
content: ["./src/**/*.{html,js,svelte,ts}"],
|
||||
theme: {
|
||||
extend: {
|
||||
fontFamily: {
|
||||
sans: ["Baar Sophia", "Arial"],
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
Reference in New Issue
Block a user