Skip to content

Commit

Permalink
Added Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
jewpaltz committed Feb 26, 2024
1 parent f2824fe commit 8f14ff2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 73 deletions.
79 changes: 6 additions & 73 deletions client/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,83 +1,16 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import { RouterView } from 'vue-router'
import NavBar from './components/NavBar.vue';
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
<NavBar />
<div class="container">
<RouterView />
</div>

<div class="wrapper">
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>

<RouterView />
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
80 changes: 80 additions & 0 deletions client/src/components/NavBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<script setup lang="ts">
import { RouterLink } from 'vue-router';
</script>

<template>
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="https://bulma.io">
<img src="https://bulma.io/images/bulma-logo.png" width="112" height="28">
</a>

<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>

<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<RouterLink to="/" class="navbar-item">
Home
</RouterLink>

<a class="navbar-item">
Documentation
</a>

<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
More
</a>

<div class="navbar-dropdown">
<RouterLink to="/about" class="navbar-item">
About
</RouterLink>
<a class="navbar-item">
Jobs
</a>
<a class="navbar-item">
Contact
</a>
<hr class="navbar-divider">
<a class="navbar-item">
Report an issue
</a>
</div>
</div>
</div>

<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
<a class="button is-primary">
<strong>Sign up</strong>
</a>
<a class="button is-light">
Log in
</a>
</div>
</div>
</div>
</div>
</nav>
</template>

<style scoped>
.router-link-exact-active {
border-bottom: 2px solid #00d1b2;
}
.router-link-active {
background-color: aquamarine;
}
</style>

0 comments on commit 8f14ff2

Please sign in to comment.