Skip to content

Commit 6769e3a

Browse files
added FOSS header to the landing page.
1 parent 2d1bce4 commit 6769e3a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

components/landing/landingHeader.vue

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<div :class="!view.atTopOfPage?'hidden':''">
3+
<div class="h-8 bg-blue-700 flex justify-center items-center">
4+
<p class="font-bold text-gray-200 text-sm">We love open source. Star this <a href="https://github.com/AndronixApp/andronix-website-base" class="underline">website</a> and other projects @ <a
5+
href="https://git.andronix.app" class="underline">Github</a></p>
6+
</div>
7+
</div>
8+
</template>
9+
10+
<script>
11+
export default {
12+
name: "landingHeader",
13+
beforeMount() {
14+
window.addEventListener('scroll', this.handleScroll)
15+
},
16+
17+
methods: {
18+
// the function to call when the user scrolls, added as a method
19+
handleScroll() {
20+
// when the user scrolls, check the pageYOffset
21+
if (window.pageYOffset > 0) {
22+
// user is scrolled
23+
if (this.view.atTopOfPage) {
24+
this.view.atTopOfPage = false
25+
}
26+
} else {
27+
// user is at top of page
28+
if (!this.view.atTopOfPage) {
29+
this.view.atTopOfPage = true
30+
}
31+
}
32+
}
33+
},
34+
data: function () {
35+
return {
36+
view: {
37+
atTopOfPage: true
38+
}
39+
}
40+
}
41+
}
42+
</script>
43+
44+
<style scoped>
45+
46+
</style>

layouts/default.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="bg-background">
3+
<landing-header/>
34
<nav-bar/>
45
<side-bar/>
56
<Nuxt class="lg:max-w-screen-2xl pt-20 mx-auto"/>

0 commit comments

Comments
 (0)