Skip to content

Commit

Permalink
Add restrictions page
Browse files Browse the repository at this point in the history
  • Loading branch information
cr0wst committed Dec 30, 2024
1 parent c8987a1 commit a59f2fa
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body class="bg-zinc-900 text-zinc-100 flex items-center justify-center h-screen">
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
46 changes: 45 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
<script lang="ts">
import '../app.css';
import IndyLogo from '$lib/IndyLogo.svelte';
let { children } = $props();
</script>

{@render children()}
<svelte:head>
<title>ICCT - Indy Center Controller Tools</title>
</svelte:head>

<div class="flex min-h-screen flex-col">
<!-- Navbar -->
<nav
class="flex h-16 w-full items-center justify-between bg-gray-700 px-4 shadow-md dark:bg-gray-900"
>
<a href="/">
<div class="flex gap-x-2 items-center text-xl font-medium text-white hover:text-gray-200">
<div class="w-32"><IndyLogo/></div><div>Controller Tools</div>
</div>
</a>
<ul
class="flex list-none flex-row space-x-2 text-white hover:text-gray-200"
>
<li><a href="/restrictions">Restrictions</a></li>
</ul>
</nav>

<!-- Main Content Area -->
<div class="flex-grow bg-gray-50 p-6 dark:bg-gray-800">
{@render children()}
</div>

<!-- Footer -->
<footer
class="flex w-full flex-col items-center justify-center bg-gray-700 py-4 dark:bg-gray-900"
>
<span class="p-2 text-center text-sm text-gray-300 dark:text-gray-400">
This site is not affiliated with the Federal Aviation Administration or
any governing aviation body. All content is approved only for use on the
VATSIM network.
</span>
</footer>
</div>

<style>
:global(body) {
@apply bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200;
}
</style>
5 changes: 1 addition & 4 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
</script>

<div class="text-center">
<div class="flex items-center justify-center gap-x-1 mb-4">
<div class="w-1/3"><IndyLogo/></div><div class="text-2xl">Controller Tools</div>
</div>
<p class="text-zinc-400 text-lg sm:text-xl mb-8">
<p class="text-lg sm:text-xl mb-8">
We're working hard to bring something amazing your way.
</p>
</div>
32 changes: 32 additions & 0 deletions src/routes/restrictions/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
import IndyLogo from '$lib/IndyLogo.svelte';
const { data } = $props();
</script>

<div class="text-center">
<table>
<thead>
<tr>
<th>Airport</th>
<th>Route</th>
<th>From</th>
<th>To</th>
<th>Restriction</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
{#each data.restrictions as restriction}
<tr>
<td>{restriction.airport}</td>
<td>{restriction.route}</td>
<td>{restriction.from}</td>
<td>{restriction.to}</td>
<td>{restriction.restriction}</td>
<td>{restriction.notes}</td>
</tr>
{/each}
</tbody>
</table>
</div>
7 changes: 7 additions & 0 deletions src/routes/restrictions/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export async function load({ fetch }) {
const restrictions = await fetch('/api/restrictions');

return {
restrictions: await restrictions.json()
};
}

0 comments on commit a59f2fa

Please sign in to comment.