feat: add more WIP
This commit is contained in:
parent
8aff5e7621
commit
95e3ee8d68
|
@ -1,6 +1,8 @@
|
||||||
<!-- svelte-ignore a11y-missing-attribute -->
|
<!-- svelte-ignore a11y-missing-attribute -->
|
||||||
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import "../node_modules/bulma/css/bulma.min.css"
|
import "../node_modules/bulma/css/bulma.min.css";
|
||||||
import Drink from "./lib/Drink.svelte";
|
import Drink from "./lib/Drink.svelte";
|
||||||
import Navbar from "./lib/Navbar.svelte";
|
import Navbar from "./lib/Navbar.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
@ -10,10 +12,4 @@
|
||||||
<div class="container" id="drink-container">
|
<div class="container" id="drink-container">
|
||||||
<Drink />
|
<Drink />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<style>
|
|
||||||
#drink-container {
|
|
||||||
margin: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,10 +1,30 @@
|
||||||
<!-- svelte-ignore a11y-missing-attribute -->
|
<!-- svelte-ignore a11y-missing-attribute -->
|
||||||
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {beers} from "../stores.js"
|
import { activeCategory, drinks } from "../stores.js";
|
||||||
|
import { fade, fly } from "svelte/transition";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main>
|
<section class="section">
|
||||||
{#each $beers as beer, name}
|
<div class="container">
|
||||||
<h1>{beer.name}</h1>
|
{#if $activeCategory == ""}
|
||||||
{/each}
|
<article class="message is-info">
|
||||||
</main>
|
<div class="message-header">
|
||||||
|
<p>hey!</p>
|
||||||
|
</div>
|
||||||
|
<div class="message-body">
|
||||||
|
<p>waehle oben eine kategorie aus, um mit der inventur loszulegen.</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
{:else}
|
||||||
|
{#each $drinks as drink, name}
|
||||||
|
{#if drink.type == $activeCategory}
|
||||||
|
<div in:fly="{{ x: 200, duration: 300 }}" out:fly="{{ y: 400, duration: 0 }}" class="box">
|
||||||
|
<h1>{drink.name}</h1>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</section>
|
|
@ -1,6 +1,14 @@
|
||||||
<!-- svelte-ignore a11y-missing-attribute -->
|
<!-- svelte-ignore a11y-missing-attribute -->
|
||||||
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let sparti_logo = "./src/assets/sparti_logo.png"
|
import { activeCategory } from "../stores";
|
||||||
|
|
||||||
|
let sparti_logo = "./src/assets/sparti_logo.png";
|
||||||
|
|
||||||
|
const setActiveCategory = (category: string) => {
|
||||||
|
$activeCategory = category;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
@ -12,16 +20,16 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar-menu">
|
<div id="navbar-menu">
|
||||||
<div class="navbar-start">
|
<div class="navbar-start">
|
||||||
<a class="navbar-item ">
|
<a class="navbar-item" on:click={() => setActiveCategory("beer")}>
|
||||||
Bier
|
Bier
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-item">
|
<a class="navbar-item" on:click={() => setActiveCategory("fizzyDrink")}>
|
||||||
Brause & Wasser
|
Brause & Wasser
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-item">
|
<a class="navbar-item" on:click={() => setActiveCategory("wine")}>
|
||||||
Wein & Sekt
|
Wein & Sekt
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-item">
|
<a class="navbar-item" on:click={() => setActiveCategory("spirit")}>
|
||||||
Schnaps & Sirup
|
Schnaps & Sirup
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
import { readable } from "svelte/store"
|
import { readable, writable } from "svelte/store"
|
||||||
|
|
||||||
export const beers = readable([
|
export const drinks = readable([
|
||||||
{
|
// Biere
|
||||||
name: "PU",
|
{ name: "PU", type: "beer" },
|
||||||
},
|
{ name: "Sterni", type: "beer" },
|
||||||
{
|
|
||||||
name: "Sterni"
|
// Brause & Wasser
|
||||||
},
|
{ name: "Brause 1", type: "fizzyDrink" },
|
||||||
]);
|
|
||||||
|
// Wein & Sekt
|
||||||
|
// ...
|
||||||
|
|
||||||
|
// Schnaps & Sirup
|
||||||
|
// ...
|
||||||
|
])
|
||||||
|
|
||||||
|
export const activeCategory = writable("")
|
Loading…
Reference in New Issue