Update hight

This commit is contained in:
samaradel
2020-11-12 03:15:19 +02:00
parent 40bd3fb105
commit 34187ac756
2 changed files with 54 additions and 40 deletions

View File

@@ -28,7 +28,7 @@ export default {
},
disableScroll: {
type: Boolean,
default: false
default: true
}
},
data: function() {

View File

@@ -1,31 +1,36 @@
<template>
<div class="fixed inset-0 h-16 bg-black">
<nav
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
}">
<nav
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,
}"
>
<div class="block flex-grow flex items-center w-auto">
<div class="inline-flex items-center flex-shrink-0 text-white mr-6">
<img
src="../../../static/img/ACI_icon-01.png"
class="mr-3"
width="50"
alt=""
/>
<span class="font-semibold text-xl tracking-tight">{{
$static.metadata.siteName
}}</span>
</div>
<div class="inline-flex items-center flex-shrink-0 text-white mr-6">
<img
src="../../../static/img/ACI_icon-01.png"
class="mr-3"
width="50"
alt=""
/>
<span class="font-semibold text-xl tracking-tight">{{
$static.metadata.siteName
}}</span>
</div>
<div class="text-sm flex-grow uppercase">
<ul
class="list-none flex justify-left text-gray-300 uppercase transition-all transition-500">
<ul
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,32 +38,41 @@
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>
<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>