-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Kerosene-Labs/feat/add-navbar
Add navigation bar
- Loading branch information
Showing
16 changed files
with
182 additions
and
142 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"></script> | ||
|
||
<div class="flex w-full h-full items-center justify-center"> | ||
<slot/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script lang="ts"> | ||
import NavbarButton from './NavbarButton.svelte'; | ||
import NavbarContent from './NavbarContent.svelte'; | ||
import NavbarLink from './NavbarLink.svelte'; | ||
let isDrawerOpen: boolean = false; | ||
</script> | ||
|
||
<div class="navbar-container"> | ||
<div class="navbar"> | ||
<!-- only show navbar on small screens --> | ||
<div class="w-min flex md:hidden"> | ||
<NavbarButton | ||
on:click={() => { | ||
isDrawerOpen = !isDrawerOpen; | ||
}} | ||
/> | ||
</div> | ||
<!-- responsive drawer/flex row --> | ||
<NavbarContent {isDrawerOpen}> | ||
<NavbarLink text="Home" url="/" /> | ||
<NavbarLink text="Projects" url="/projects" /> | ||
<NavbarLink text="Members" url="/members" /> | ||
</NavbarContent> | ||
</div> | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.navbar { | ||
@apply bg-neutral-100 rounded-[-10px]; | ||
@apply transition-all; | ||
} | ||
.navbar-container { | ||
@apply w-screen z-50; | ||
@apply fixed; | ||
@apply transition-all; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<button on:click class="btn btn-navbar"> | ||
<svg class="logo" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M4 18H10" stroke-width="2" stroke-linecap="round"/> | ||
<path d="M4 12L16 12" stroke-width="2" stroke-linecap="round"/> | ||
<path d="M4 6L20 6" stroke-width="2" stroke-linecap="round"/> | ||
</svg> | ||
</button> | ||
|
||
<style lang="postcss"> | ||
.btn { | ||
@apply select-none p-4; | ||
} | ||
.logo { | ||
@apply w-11 h-11 stroke-neutral-300 hover:stroke-neutral-400 active:stroke-neutral-400 focus:stroke-neutral-400; | ||
@apply transition-all; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
// If the drawer is open. Note, this only works on (sm)all screens. | ||
export let isDrawerOpen: boolean; | ||
let isNotMobileDisplay: boolean; | ||
function handleResize() { | ||
// determine if we're a "small" display | ||
isNotMobileDisplay = window.matchMedia('(min-width: 768px)').matches; | ||
// if we are a small display and the drawer is open, close it | ||
if (!isNotMobileDisplay && isDrawerOpen) { | ||
isDrawerOpen = false; | ||
return; | ||
} | ||
// if we're a big display and the drawer isn't open it, open it | ||
if (isNotMobileDisplay && !isDrawerOpen) { | ||
isDrawerOpen = true; | ||
return; | ||
} | ||
} | ||
onMount(() => { | ||
window.addEventListener('resize', handleResize); | ||
handleResize(); | ||
}); | ||
</script> | ||
|
||
<div class:hidden={!isDrawerOpen} id="navbarContent"> | ||
<div class="content"> | ||
<slot /> | ||
</div> | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.content { | ||
@apply flex flex-col; | ||
@apply transition-all; | ||
@apply md:flex-row; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts"> | ||
export let text: string; | ||
export let url: string; | ||
</script> | ||
|
||
<a href={url} class="navbar-item"> | ||
{text} | ||
</a> | ||
|
||
<style lang="postcss"> | ||
.navbar-item { | ||
@apply bg-inherit hover:bg-neutral-200; | ||
@apply p-4; | ||
@apply active:bg-inherit; | ||
@apply transition-all; | ||
@apply h-full; | ||
@apply text-4xl font-medium; | ||
@apply md:text-xl; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum ScreenSizes { | ||
sm = 300, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,16 @@ | ||
<script lang="ts"> | ||
import LandingCardGroup from '$lib/components/cardGroups/LandingCardGroup.svelte'; | ||
import MembersCardGroup from '$lib/components/cardGroups/MembersCardGroup.svelte'; | ||
import ProjectCardGroup from '$lib/components/cardGroups/ProjectCardGroup.svelte'; | ||
import PageSection from '$lib/components/PageSection.svelte'; | ||
import { PageSectionType } from '$lib/util/pageSection'; | ||
import CenterContainer from '$lib/components/layout/CenterContainer.svelte'; | ||
import Navbar from '$lib/components/navigation/Navbar.svelte'; | ||
if (typeof window !== 'undefined') { | ||
document.title = 'Kerosene Labs'; | ||
} | ||
</script> | ||
|
||
<PageSection type={PageSectionType.LANDING}> | ||
<div class="center-container"> | ||
<Navbar></Navbar> | ||
<div class="w-screen h-screen"> | ||
<CenterContainer> | ||
<LandingCardGroup /> | ||
</div> | ||
</PageSection> | ||
<PageSection type={PageSectionType.PROJECTS}> | ||
<div class="center-container"> | ||
<div class="sm:w-5/6 lg:w-1/2"> | ||
<ProjectCardGroup /> | ||
</div> | ||
</div> | ||
</PageSection> | ||
<PageSection type={PageSectionType.MEMBERS}> | ||
<div class="center-container"> | ||
<MembersCardGroup /> | ||
</div> | ||
</PageSection> | ||
|
||
<style lang="postcss"> | ||
div.center-container { | ||
@apply flex w-full h-full items-center justify-center; | ||
} | ||
</style> | ||
</CenterContainer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script> | ||
import Navbar from '$lib/components/navigation/Navbar.svelte'; | ||
import CenterContainer from '$lib/components/layout/CenterContainer.svelte'; | ||
import MembersCardGroup from '$lib/components/cardGroups/MembersCardGroup.svelte'; | ||
</script> | ||
|
||
<Navbar></Navbar> | ||
<div class="w-screen pt-[6rem]"> | ||
<CenterContainer> | ||
<MembersCardGroup></MembersCardGroup> | ||
</CenterContainer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
import ProjectCardGroup from '$lib/components/cardGroups/ProjectCardGroup.svelte'; | ||
import CenterContainer from '$lib/components/layout/CenterContainer.svelte'; | ||
import Navbar from '$lib/components/navigation/Navbar.svelte'; | ||
</script> | ||
|
||
<Navbar></Navbar> | ||
<div class="w-screen h-full pt-[6rem]"> | ||
<ProjectCardGroup></ProjectCardGroup> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters