Stundenaufzeichnung/src/routes/+layout.svelte

98 lines
1.3 KiB
Svelte
Raw Normal View History

2024-12-25 01:48:49 +01:00
<script lang="ts">
let { children } = $props();
</script>
2025-03-25 15:25:04 +01:00
{#snippet nav(classlist: string)}
<div class={classlist}>
<h1>Navigation</h1>
2025-01-17 13:32:28 +01:00
<ul>
<li><a href="/">Stundenliste</a></li>
<li><a href="/schaetzung">Stundenschätzung</a></li>
2025-03-25 15:25:04 +01:00
<li><a href="/dokumente">Dokumente</a></li>
2025-06-05 14:32:12 +02:00
<li style="height: 20px"></li>
<li>Benutzerverwaltung</li>
<li>
<form method="POST" action="/login?/logout">
<button type="submit">Logout</button>
</form>
</li>
2025-01-17 13:32:28 +01:00
</ul>
</div>
2025-03-25 15:25:04 +01:00
{/snippet}
2025-01-17 13:32:28 +01:00
2025-03-25 15:25:04 +01:00
<div style:display="flex">
{@render nav("navpos nav")}
{@render nav("navpseudo nav")}
<div class="content">
2024-12-25 01:48:49 +01:00
{@render children()}
2025-03-25 15:25:04 +01:00
</div>
</div>
2025-01-17 13:32:28 +01:00
<style>
2025-03-25 15:25:04 +01:00
.navpos {
position: fixed;
top: 0;
left: 0;
}
.navpseudo {
visibility: hidden;
}
2025-01-17 13:32:28 +01:00
.nav {
2025-03-25 15:25:04 +01:00
width: 10%;
height: 100%;
min-width: 130px;
2025-01-17 13:32:28 +01:00
2025-03-25 15:25:04 +01:00
padding: 8px;
border-right: 1px black solid;
2025-01-17 13:32:28 +01:00
}
.nav ul {
2025-03-25 15:25:04 +01:00
list-style-type: none;
padding: 0px;
margin: 0px;
2025-06-05 14:32:12 +02:00
height: 100%;
2025-03-25 15:25:04 +01:00
}
2025-01-17 13:32:28 +01:00
2025-03-25 15:25:04 +01:00
.nav ul li {
padding-bottom: 5px;
}
2025-06-05 14:32:12 +02:00
.nav button {
padding: 0;
border: none;
background: none;
font-family: arial, sans-serif;
text-decoration-line: underline;
color: blue;
cursor: pointer;
}
2025-03-25 15:25:04 +01:00
.nav h1 {
width: 100%;
2025-01-17 13:32:28 +01:00
margin-top: 10px;
2025-03-25 15:25:04 +01:00
text-align: center;
font-size: 25px;
2025-01-17 13:32:28 +01:00
}
2025-03-25 15:25:04 +01:00
.content {
flex: 1;
}
2025-01-17 13:32:28 +01:00
2025-03-25 15:25:04 +01:00
.content :global(h1) {
width: 100%;
text-align: center;
font-weight: bold;
2025-01-17 13:32:28 +01:00
}
</style>