-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic layout with localization support
- Loading branch information
Showing
25 changed files
with
191 additions
and
65 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
{} | ||
{ | ||
"layout": { | ||
"header": { | ||
"logo": "Logo of Ghent University", | ||
"navigation": { | ||
"dashboard": "Dashboard", | ||
"calendar": "Calendar", | ||
"courses": "Courses", | ||
"settings": "Preferences", | ||
"help": "Help" | ||
}, | ||
"language": { | ||
"nl": "Dutch", | ||
"en": "English" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,112 @@ | ||
<script setup lang="ts"> | ||
import enLogo from '@/assets/img/logo-en.png'; | ||
import nlLogo from '@/assets/img/logo-nl.png'; | ||
import nlFlag from '@/assets/img/flags/nl-flag.svg' | ||
import enFlag from '@/assets/img/flags/en-flag.svg' | ||
import Dropdown from 'primevue/dropdown'; | ||
import {useI18n} from 'vue-i18n'; | ||
import en from '@/assets/img/logo-en.png'; | ||
import nl from '@/assets/img/logo-nl.png'; | ||
import {computed} from 'vue'; | ||
const { t, locale } = useI18n(); | ||
/* Translation composable */ | ||
const { t, locale, availableLocales } = useI18n(); | ||
const logo: {[key: string]: string} = {nl, en}; | ||
/* Available localized images */ | ||
const logo: {[key: string]: string} = { nl: nlLogo, en: enLogo }; | ||
const flags: {[key: string]: string} = { nl: nlFlag, en: enFlag }; | ||
const items = [ | ||
/* Navigation items */ | ||
const items = computed(() => [ | ||
{icon: 'home', label: t('layout.header.navigation.dashboard'), path: ''}, | ||
{icon: 'calendar', label: t('layout.header.navigation.calendar'), path: ''}, | ||
{icon: 'book', label: t('layout.header.navigation.courses'), path: ''}, | ||
{icon: 'cog', label: t('layout.header.navigation.settings'), path: ''}, | ||
{icon: 'info-circle', label: t('layout.header.navigation.help'), path: ''} | ||
]; | ||
]); | ||
</script> | ||
|
||
<template> | ||
<div class="flex w-full"> | ||
<div class="w-full lg:w-2 flex align-items-center px-4 py-3"> | ||
<img class="w-full max-w-7rem" :src="logo[locale]" :alt="t('layout.header.logo')"> | ||
<div class="w-full lg:w-2 flex align-items-center py-3"> | ||
<img class="w-full max-w-9rem" :src="logo[locale]" :alt="t('layout.header.logo')"> | ||
</div> | ||
<div class="flex flex-column w-full lg:w-10 border-x-1 border-200"> | ||
<div id="header" class="w-full text-white p-4"> | ||
<div class="text-right text-sm"> | ||
Ingelogd als Lander Maes | ||
<div class="flex flex-column w-full lg:w-10"> | ||
<div id="header" class="w-full flex text-white p-4"> | ||
<div class="flex align-items-end"> | ||
<h1 class="text-white m-0">Ypovoli</h1> | ||
</div> | ||
<div class="text-right w-12rem ml-auto text-sm flex flex-column align-items-end gap-3"> | ||
<!-- Language selector --> | ||
<Dropdown id="language" v-model="locale" class="w-auto" :options="availableLocales" variant="outlined"> | ||
<template #option="{ option }"> | ||
<div class="flex align-items-center"> | ||
<img :alt="t('layout.header.language.' + option)" :src="flags[option]" class="h-1rem mr-3"/> | ||
<div> | ||
{{ t('layout.header.language.' + option) }} | ||
</div> | ||
</div> | ||
</template> | ||
<template #value="{ value }" class="pr-0"> | ||
<div class="uppercase text-sm">{{ value }}</div> | ||
</template> | ||
</Dropdown> | ||
<!-- User information --> | ||
<span> | ||
Ingelogd als Lander Maes | ||
</span> | ||
</div> | ||
</div> | ||
<div id="navigation" class="w-full h-full flex border-bottom-1 border-200"> | ||
<div class="flex align-items-center w-9rem flex justify-content-center p-3 border-right-1 border-200 cursor-pointer text-primary font-bold" v-for="item in items"> | ||
<span :class="'pi mr-2 pi-' + item.icon"/> {{ item.label }} | ||
<!-- Navigation --> | ||
<div id="navigation" class="w-full h-full flex"> | ||
<div class="flex align-items-center uppercase flex justify-content-center p-3 pl-0 cursor-pointer text-primary font-medium nav-item" v-for="item in items"> | ||
<span class="mr-2" :class="'pi pi-' + item.icon"/> {{ item.label }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
<style lang="scss"> | ||
#header { | ||
background: var(--primary-color); | ||
#language { | ||
background: transparent; | ||
color: var(--primary-color-text); | ||
border: none; | ||
padding: .25rem; | ||
.p-inputtext { | ||
padding: 0; | ||
color: var(--primary-color-text); | ||
} | ||
.p-dropdown-trigger { | ||
width: auto; | ||
color: var(--primary-color-text); | ||
margin-left: 0.5rem; | ||
} | ||
} | ||
} | ||
.nav-item { | ||
position: relative; | ||
z-index: 1; | ||
&::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
bottom: .25rem; | ||
left: 0; | ||
width: 0; | ||
height: 3px; | ||
background: var(--primary-color); | ||
transition: width .3s; | ||
margin-top: 0.5rem; | ||
} | ||
&:hover::after { | ||
width: calc(100% - 1rem); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<h1 class="title"> | ||
<slot/> | ||
</h1> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.title { | ||
margin-top: 0; | ||
color: var(--primary-color); | ||
position: relative; | ||
display: inline-block; | ||
&::after { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
bottom: -8px; | ||
display: block; | ||
width: 100%; | ||
border-top: 4px solid var(--primary-color);; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const environment = {}; | ||
export const environment = { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.