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: { disableScroll: {
type: Boolean, type: Boolean,
default: false default: true
} }
}, },
data: function() { data: function() {

View File

@@ -1,31 +1,36 @@
<template> <template>
<div class="fixed inset-0 h-16 bg-black"> <div class="fixed inset-0 h-16 bg-black">
<nav <nav
class="flex items-center justify-between flex-wrap container mx-auto px-4 sm:px-0 py-4 transition-all transition-500" 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="{ v-bind:class="{
'opacity-100': !disableScroll && scrollPosition > headerHeight, '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="block flex-grow flex items-center w-auto">
<div class="inline-flex items-center flex-shrink-0 text-white mr-6"> <div class="inline-flex items-center flex-shrink-0 text-white mr-6">
<img <img
src="../../../static/img/ACI_icon-01.png" src="../../../static/img/ACI_icon-01.png"
class="mr-3" class="mr-3"
width="50" width="50"
alt="" alt=""
/> />
<span class="font-semibold text-xl tracking-tight">{{ <span class="font-semibold text-xl tracking-tight">{{
$static.metadata.siteName $static.metadata.siteName
}}</span> }}</span>
</div> </div>
<div class="text-sm flex-grow uppercase"> <div class="text-sm flex-grow uppercase">
<ul <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 <li
:key="element.name" :key="element.name"
v-for="(element,index) in $static.metadata.navigation" v-for="(element, index) in $static.metadata.navigation"
class="hover:text-white" 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 <a
:href="element.link" :href="element.link"
@@ -33,32 +38,41 @@
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="animated-link" class="animated-link"
>{{ element.name }}</a> >{{ element.name }}</a
<g-link v-else :to="element.link" class="animated-link">{{element.name}}</g-link> >
<g-link v-else :to="element.link" class="animated-link">{{
element.name
}}</g-link>
</li> </li>
</ul> </ul>
</div> </div>
<div class="inline-block text-gray-400"> <div class="inline-block text-gray-400">
<ul class="list-none flex justify-center md:justify-end"> <ul class="list-none flex justify-center md:justify-end">
<li class="mr-0 sm:mr-6"> <li class="mr-0 sm:mr-6">
<theme-switcher v-on="$listeners" :theme="theme"/> <theme-switcher v-on="$listeners" :theme="theme" />
</li> </li>
<li <li
:key="element.name" :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" 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"> <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]" /> <font-awesome :icon="['fab', element.icon]" />
</a> </a>
</span> </span>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
</div> </div>
@@ -74,25 +88,25 @@
* css classes to show the sticky navbar * css classes to show the sticky navbar
*/ */
import ThemeSwitcher from '~/components/ThemeSwitcher' import ThemeSwitcher from "~/components/ThemeSwitcher";
export default { export default {
components : { components: {
ThemeSwitcher ThemeSwitcher,
}, },
props: { props: {
disableScroll: { disableScroll: {
type: Boolean, type: Boolean,
default: false default: true
}, },
theme: { theme: {
type: String type: String,
} },
}, },
data: function() { data: function () {
return { return {
scrollPosition: null, scrollPosition: null,
headerHeight: 0 headerHeight: 0,
}; };
}, },
@@ -106,12 +120,12 @@ export default {
}, },
mounted() { mounted() {
if( !this.disableScroll ) { if (!this.disableScroll) {
var height = document.getElementById("header").clientHeight; var height = document.getElementById("header").clientHeight;
this.setHeaderHeight(height); this.setHeaderHeight(height);
window.addEventListener("scroll", this.updateScroll); window.addEventListener("scroll", this.updateScroll);
} }
} },
}; };
</script> </script>