Skip to content

Commit

Permalink
adds lovely animation to mobile nav
Browse files Browse the repository at this point in the history
  • Loading branch information
stolinski committed Jul 6, 2023
1 parent 556e2a8 commit 75da609
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<Toaster />
<Loading />

{#if user?.roles?.includes('admin')}
<!-- {#if user?.roles?.includes('admin')}
<AdminMenu />
{/if}
{/if} -->
</div>

<style lang="postcss">
Expand Down
3 changes: 0 additions & 3 deletions src/routes/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import type { User } from '@prisma/client';
import MobileNav from './MobileNav.svelte';
export let user: User | null;
$: header_element = $page.route.id === '/' ? 'h1' : 'h2';
</script>

Expand Down
17 changes: 11 additions & 6 deletions src/routes/MobileNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
<button class="button-reset" on:click={toggle}>Menu</button>
{#if is_active}
<div
transition:fly={{ opacity: 0 }}
transition:fly={{ opacity: 0, x: "100%"}}
id="menu"
class="menu"
style="background-image: url({white_grit})"
>
<button class="button-reset close-button" on:click={toggle}>×</button>
<nav>
<a href="/shows">Podcast</a>
<a href="https://swag.syntax.fm">Swag</a>
<a transition:fly={{ opacity: 0, x: "100%", delay: 1}} on:click={toggle} href="/shows">Podcast</a>
<a transition:fly={{ opacity: 0, x: "100%", delay: 1}} on:click={toggle} href="https://swag.syntax.fm">Swag </a>
</nav>
<a
target="_blank"
Expand All @@ -46,6 +46,7 @@
color: var(--color);
text-decoration: none;
border-bottom: solid 3px transparent;
display: block;
transition: border-color 0.2s ease;
&:hover {
border-bottom: solid 3px var(--primary);
Expand All @@ -69,13 +70,17 @@
justify-content: space-between;
flex-direction: column;
z-index: 11;
display: flex;
padding: 2rem;
nav {
margin-top: 30vh;
font-size: var(--font-size-xxl);
a {
display: block;
margin-bottom: 2rem;
font-weight: 700;
text-shadow: 0 0 4px black;
}
}
> *:last-child {
Expand All @@ -84,11 +89,11 @@
}
.close-button {
font-size: 5rem;
font-size: 4rem;
margin: 0;
position: absolute;
top: 10px;
right: 10px;
top: 20px;
right: 20px;
display: block;
line-height: 0.5;
padding: 0;
Expand Down

1 comment on commit 75da609

@vercel
Copy link

@vercel vercel bot commented on 75da609 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sytnax-website-v2 – ./

beta.syntax.fm
sytnax-website-v2-git-v2-syntax.vercel.app
sytnax-website-v2-syntax.vercel.app

Please sign in to comment.