Skip to content

Commit 75595f9

Browse files
authored
Wm2 9 component top navbar (#207)
* Add nav bar with simple scrolling * Clean up
1 parent aaf1c75 commit 75595f9

File tree

2 files changed

+96
-15
lines changed

2 files changed

+96
-15
lines changed

frontend/src/App.vue

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
<template>
22
<v-app id="main-app">
3-
<!-- Navigation bar/app bar goes here -->
4-
<v-app-bar app color="transparent" class="blend" elevation="0" width="100vw">
5-
<!-- Logo -->
6-
<RouterLink to="/" v-on:click.native="showMenu = false">
7-
<v-container class="fill-height" style="max-height: 64px; max-width:100px">
8-
<v-img src="@/assets/csesocwhiteblue.png" />
9-
</v-container>
10-
</RouterLink>
11-
12-
<div class="flex-grow-1"></div>
13-
14-
<!-- Menu button -->
15-
<v-app-bar-nav-icon color="white" class="ma-2" data-cy="menu-toggle" @click.stop="showMenu = !showMenu" />
16-
</v-app-bar>
3+
<Navbar />
174
<v-main class="pa-0">
185
<Menu v-if="showMenu" @shown="onMenuCollapse" />
196
<RouterView style="overflow-x: hidden" />
@@ -25,6 +12,7 @@
2512
<script>
2613
import Footer from '@/components/Footer';
2714
import Menu from '@/components/Menu';
15+
import Navbar from '@/components/Navbar';
2816
2917
export default {
3018
name: 'App',
@@ -34,6 +22,7 @@ export default {
3422
components: {
3523
Footer,
3624
Menu,
25+
Navbar,
3726
},
3827
methods: {
3928
onMenuCollapse(val) {
@@ -62,5 +51,4 @@ html, body {
6251
.blend{
6352
mix-blend-mode: exclusion;
6453
}
65-
6654
</style>

frontend/src/components/Navbar.vue

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<!--
2+
Navbar
3+
--
4+
This component is static on the top of the page and displays links to different parts
5+
the screen
6+
-->
7+
8+
<template>
9+
<v-app-bar app color="rgba(0,0,51,0.7)" elevation="0" width="100vw">
10+
<!-- Large screen display -->
11+
<v-container class="hidden-sm-and-down">
12+
<v-row class="d-flex justify-center">
13+
<v-col class="d-flex align-center justify-start">
14+
<a @click="goto('showcase')" style="text-decoration: none;">
15+
<v-img contain max-height="60px" max-width="100px" src="@/assets/csesocwhiteblue.png" />
16+
</a>
17+
</v-col>
18+
<v-col class="d-flex align-center justify-center">
19+
<a @click="goto('mission')" style="text-decoration: none;">
20+
<v-btn text color="white">ABOUT US</v-btn>
21+
</a>
22+
</v-col>
23+
<v-col class="d-flex align-center justify-center">
24+
<a @click="goto('student-resources')" style="text-decoration: none;">
25+
<v-btn text color="white">GET IN TOUCH</v-btn>
26+
</a>
27+
</v-col>
28+
<v-col class="d-flex align-center justify-center">
29+
<a @click="goto('student-resources')" style="text-decoration: none;">
30+
<v-btn text color="white">RESOURCES</v-btn>
31+
</a>
32+
</v-col>
33+
<v-col class="d-flex align-center justify-center">
34+
<v-btn text to="/sponsorship" color="white">SPONSORSHIP</v-btn>
35+
</v-col>
36+
</v-row>
37+
</v-container>
38+
39+
<!-- Smaller screen container -->
40+
<v-container class="hidden-md-and-up">
41+
<v-row class="d-flex justify-space-between">
42+
<v-col class="d-flex align-center">
43+
<RouterLink to="/" style="text-decoration: none;" v-on:click.native="showMenu = false">
44+
<v-img contain max-height="40px" max-width="100px" src="@/assets/csesocwhiteblue.png" />
45+
</RouterLink>
46+
</v-col>
47+
<v-col class="d-flex justify-end">
48+
<v-menu bottom left>
49+
<template v-slot:activator="{ on, attrs }">
50+
<v-btn dark icon v-bind="attrs" v-on="on">
51+
<v-icon>mdi-menu</v-icon>
52+
</v-btn>
53+
</template>
54+
<v-list>
55+
<v-list-item>
56+
<a @click="goto('mission')" style="text-decoration: none; color: black;">
57+
About us
58+
</a>
59+
</v-list-item>
60+
<v-list-item>
61+
<a @click="goto('community')" style="text-decoration: none; color: black;">
62+
Get in touch
63+
</a>
64+
</v-list-item>
65+
<v-list-item>
66+
<a @click="goto('student-resources')" style="text-decoration: none; color: black;">
67+
Resources
68+
</a>
69+
</v-list-item>
70+
<v-list-item>
71+
<RouterLink style="text-decoration: none; color: black;" to="/sponsorship">
72+
Sponsorship
73+
</RouterLink>
74+
</v-list-item>
75+
</v-list>
76+
</v-menu>
77+
</v-col>
78+
</v-row>
79+
</v-container>
80+
</v-app-bar>
81+
</template>
82+
83+
<script type="text/javascript">
84+
export default {
85+
name: 'Navbar',
86+
methods: {
87+
goto(refName) {
88+
const element = document.getElementById(refName);
89+
element.scrollIntoView({ block: 'start', behavior: 'smooth' });
90+
}
91+
}
92+
};
93+
</script>

0 commit comments

Comments
 (0)