Update hight
This commit is contained in:
@@ -28,7 +28,7 @@ export default {
|
||||
},
|
||||
disableScroll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
class="flex items-center justify-between flex-wrap container mx-auto px-4 sm:px-0 py-4 transition-all transition-500"
|
||||
v-bind:class="{
|
||||
'opacity-100': !disableScroll && scrollPosition > headerHeight,
|
||||
'opacity-0': !disableScroll && scrollPosition < headerHeight
|
||||
}">
|
||||
'opacity-0': !disableScroll && scrollPosition < headerHeight,
|
||||
}"
|
||||
>
|
||||
<div class="block flex-grow flex items-center w-auto">
|
||||
<div class="inline-flex items-center flex-shrink-0 text-white mr-6">
|
||||
<img
|
||||
@@ -20,12 +21,16 @@
|
||||
</div>
|
||||
<div class="text-sm flex-grow uppercase">
|
||||
<ul
|
||||
class="list-none flex justify-left text-gray-300 uppercase transition-all transition-500">
|
||||
class="list-none flex justify-left text-gray-300 uppercase transition-all transition-500"
|
||||
>
|
||||
<li
|
||||
:key="element.name"
|
||||
v-for="(element,index) in $static.metadata.navigation"
|
||||
v-for="(element, index) in $static.metadata.navigation"
|
||||
class="hover:text-white"
|
||||
v-bind:class="{'mr-4' : index != Object.keys($static.metadata.navigation).length - 1}"
|
||||
v-bind:class="{
|
||||
'mr-4':
|
||||
index != Object.keys($static.metadata.navigation).length - 1,
|
||||
}"
|
||||
>
|
||||
<a
|
||||
:href="element.link"
|
||||
@@ -33,8 +38,11 @@
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="animated-link"
|
||||
>{{ element.name }}</a>
|
||||
<g-link v-else :to="element.link" class="animated-link">{{element.name}}</g-link>
|
||||
>{{ element.name }}</a
|
||||
>
|
||||
<g-link v-else :to="element.link" class="animated-link">{{
|
||||
element.name
|
||||
}}</g-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -42,23 +50,29 @@
|
||||
<div class="inline-block text-gray-400">
|
||||
<ul class="list-none flex justify-center md:justify-end">
|
||||
<li class="mr-0 sm:mr-6">
|
||||
<theme-switcher v-on="$listeners" :theme="theme"/>
|
||||
<theme-switcher v-on="$listeners" :theme="theme" />
|
||||
</li>
|
||||
<li
|
||||
:key="element.name"
|
||||
v-for="(element,index) in $static.metadata.social"
|
||||
v-for="(element, index) in $static.metadata.social"
|
||||
class="hover:text-white hidden sm:block"
|
||||
v-bind:class="{'mr-6' : index != Object.keys($static.metadata.social).length - 1}"
|
||||
v-bind:class="{
|
||||
'mr-6':
|
||||
index != Object.keys($static.metadata.social).length - 1,
|
||||
}"
|
||||
>
|
||||
<span class="text-sm">
|
||||
<a :href="element.link" target="_blank" rel="noopener noreferrer">
|
||||
<a
|
||||
:href="element.link"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<font-awesome :icon="['fab', element.icon]" />
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -74,25 +88,25 @@
|
||||
* css classes to show the sticky navbar
|
||||
*/
|
||||
|
||||
import ThemeSwitcher from '~/components/ThemeSwitcher'
|
||||
import ThemeSwitcher from "~/components/ThemeSwitcher";
|
||||
|
||||
export default {
|
||||
components : {
|
||||
ThemeSwitcher
|
||||
components: {
|
||||
ThemeSwitcher,
|
||||
},
|
||||
props: {
|
||||
disableScroll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: true
|
||||
},
|
||||
theme: {
|
||||
type: String
|
||||
}
|
||||
type: String,
|
||||
},
|
||||
data: function() {
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
scrollPosition: null,
|
||||
headerHeight: 0
|
||||
headerHeight: 0,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -106,12 +120,12 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if( !this.disableScroll ) {
|
||||
if (!this.disableScroll) {
|
||||
var height = document.getElementById("header").clientHeight;
|
||||
this.setHeaderHeight(height);
|
||||
window.addEventListener("scroll", this.updateScroll);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user