Skip to content

Commit 834033a

Browse files
UI Improvements for GC Landing page (#35)
* feat: build out landing page * remove redudant styles * update apache * minor improvements * mobile language picker accordion + actually change language * Update i18n/locales/en.json Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update i18n/locales/en.json Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update pages/index.vue Co-authored-by: Rudo Kemper <[email protected]> * Update i18n/locales/en.json Co-authored-by: Rudo Kemper <[email protected]> * minor improvements and pnpm prettier * Revert Prettier formatting from unintended files (keep index.vue changes) * fix minor type issues * improveemnts and refinements to UI --------- Co-authored-by: Rudo Kemper <[email protected]>
1 parent 4b3cbe1 commit 834033a

File tree

9 files changed

+854
-161
lines changed

9 files changed

+854
-161
lines changed

assets/css/main.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,31 @@
2626
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2727
transition-duration: 150ms;
2828
}
29+
30+
/* Tab trigger styles */
31+
.tab-trigger {
32+
border: 0px;
33+
outline: none;
34+
padding: 0px 10px;
35+
height: 40px;
36+
display: flex;
37+
align-items: center;
38+
position: relative;
39+
background-color: #fff;
40+
}
41+
42+
.tab-trigger svg {
43+
position: absolute;
44+
height: 40px;
45+
color: #fff;
46+
}
47+
48+
.tab-trigger .left-curve {
49+
left: 1px;
50+
transform: translateX(-100%) rotateY(180deg);
51+
}
52+
53+
.tab-trigger .right-curve {
54+
right: 1px;
55+
transform: translateX(100%);
56+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<script lang="ts" setup>
2+
import { ref, computed, onMounted, onUnmounted } from "vue";
3+
import type { SupportedLocale } from "~/types/types";
4+
5+
const { locale, locales, setLocale } = useI18n();
6+
const { t } = useI18n();
7+
8+
interface Props {
9+
theme?: 'purple' | 'white' | 'dark';
10+
}
11+
12+
const props = withDefaults(defineProps<Props>(), {
13+
theme: 'white'
14+
});
15+
16+
// Populate available locales from i18n plugin
17+
const availableLocales = computed(() => locales.value);
18+
const currentLocaleName = computed(() => {
19+
const currentLocale = locales.value.find(
20+
(lang) => lang.code === locale.value,
21+
);
22+
return currentLocale?.name || "";
23+
});
24+
25+
const dropdownOpen = ref(false);
26+
27+
// Close dropdown when clicking outside
28+
const handleClickOutside = (event: MouseEvent) => {
29+
const target = event.target as HTMLElement;
30+
if (!target.closest('.language-picker-container')) {
31+
dropdownOpen.value = false;
32+
}
33+
};
34+
35+
// Load locale from session storage on mount and set up click outside handler
36+
onMounted(() => {
37+
const savedLocale = sessionStorage.getItem("locale");
38+
if (savedLocale && locales.value.some((lang) => lang.code === savedLocale)) {
39+
setLocale(savedLocale as SupportedLocale);
40+
}
41+
document.addEventListener('click', handleClickOutside);
42+
});
43+
44+
onUnmounted(() => {
45+
document.removeEventListener('click', handleClickOutside);
46+
});
47+
48+
const changeLocale = (locale: { code: string }): void => {
49+
setLocale(locale.code as SupportedLocale);
50+
sessionStorage.setItem("locale", locale.code);
51+
dropdownOpen.value = false;
52+
};
53+
54+
const dropdownClasses = computed(() => {
55+
switch (props.theme) {
56+
case 'white':
57+
return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50";
58+
case 'dark':
59+
return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-gray-800 ring-1 ring-gray-600 z-50";
60+
case 'purple':
61+
default:
62+
return "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-gray-200 z-50";
63+
}
64+
});
65+
66+
const itemClasses = computed(() => {
67+
switch (props.theme) {
68+
case 'white':
69+
return "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors";
70+
case 'dark':
71+
return "block px-4 py-2 text-sm text-white hover:bg-gray-700 transition-colors";
72+
case 'purple':
73+
default:
74+
return "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors";
75+
}
76+
});
77+
</script>
78+
79+
<template>
80+
<div class="relative inline-block text-left language-picker-container">
81+
<div>
82+
<button
83+
type="button"
84+
class="relative w-10 h-10 rounded-full bg-white flex items-center justify-center hover:bg-gray-50 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500"
85+
@click.stop="dropdownOpen = !dropdownOpen"
86+
:title="t('header.languagePicker')"
87+
>
88+
<svg
89+
class="w-5 h-5 text-gray-600"
90+
xmlns="http://www.w3.org/2000/svg"
91+
fill="none"
92+
viewBox="0 0 24 24"
93+
stroke="currentColor"
94+
>
95+
<path
96+
stroke-linecap="round"
97+
stroke-linejoin="round"
98+
stroke-width="2"
99+
d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
100+
/>
101+
</svg>
102+
</button>
103+
</div>
104+
<div
105+
v-if="dropdownOpen"
106+
:class="dropdownClasses"
107+
@click.stop
108+
>
109+
<div class="py-1">
110+
<a
111+
v-for="lang in availableLocales"
112+
:key="lang.code"
113+
href="#"
114+
:class="itemClasses"
115+
@click="
116+
($event.preventDefault(),
117+
$event.stopPropagation(),
118+
changeLocale(lang))
119+
"
120+
>
121+
{{ lang.name }}
122+
</a>
123+
</div>
124+
</div>
125+
</div>
126+
</template>

i18n/locales/en.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"app": {
33
"title": "Guardian Connector Landing Page",
44
"community": "Community",
5-
"welcome": "Welcome to the Guardian Connector platform for {communityName}",
6-
"welcomeSubtitle": "Access your community tools and resources in one place"
5+
"welcome": "Your community, your control.",
6+
"welcomeSubtitle": "Access your dashboards, manage workflows, and explore data securely within your Guardian Connector."
77
},
88
"auth": {
99
"signIn": "Sign In",
@@ -25,8 +25,26 @@
2525
"filebrowser": "Filebrowser",
2626
"filebrowserDescription": "Secure file management and sharing",
2727
"noServicesAvailable": "No Services Available",
28-
"noServicesDescription": "No community services are currently deployed or accessible.",
29-
"communityService": "Community service"
28+
"noServicesDescription": "No services are currently deployed or accessible.",
29+
"needHelp": "Need help? Visit the Guardian Connector",
30+
"documentationWebsite": "documentation website",
31+
"service": "Service",
32+
"tags": {
33+
"maps": "Maps",
34+
"alertsDashboard": "Alerts Dashboard",
35+
"wildlifeExplorer": "Wildlife Explorer",
36+
"mediaGalleries": "Media Galleries",
37+
"charts": "Charts",
38+
"analysis": "Analysis",
39+
"visualizations": "Visualizations",
40+
"dashboards": "Dashboards",
41+
"dataFlows": "Data Flows",
42+
"scheduledJobs": "Scheduled Jobs",
43+
"dataApps": "Data Apps",
44+
"files": "Files",
45+
"rawData": "Raw Data",
46+
"archives": "Archives"
47+
}
3048
},
3149
"userManagement": {
3250
"title": "User Management",
@@ -83,5 +101,9 @@
83101
"copyright": "© 2025 Guardian Connector.",
84102
"community": "Community: {communityName}",
85103
"services": "Services: {count}"
104+
},
105+
"header": {
106+
"adminAccess": "Admin Access",
107+
"languagePicker": "Language Picker"
86108
}
87109
}

i18n/locales/es.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"app": {
33
"title": "Página de Inicio de Guardian Connector",
44
"community": "Comunidad",
5-
"welcome": "Bienvenido a la plataforma Guardian Connector para {communityName}",
6-
"welcomeSubtitle": "Accede a las herramientas y recursos de tu comunidad en un solo lugar"
5+
"welcome": "Tu comunidad, tu control.",
6+
"welcomeSubtitle": "Aquí puedes encontrar datos y gestionar los activos de {communityName}."
77
},
88
"auth": {
99
"signIn": "Iniciar Sesión",
@@ -26,7 +26,25 @@
2626
"filebrowserDescription": "Gestión y compartición segura de archivos",
2727
"noServicesAvailable": "No Hay Servicios Disponibles",
2828
"noServicesDescription": "No hay servicios de la comunidad actualmente desplegados o accesibles.",
29-
"communityService": "Servicio de la comunidad"
29+
"needHelp": "¿Necesitas ayuda? Visita el",
30+
"documentationWebsite": "sitio web de documentación de Guardian Connector",
31+
"communityService": "Servicio de la comunidad",
32+
"tags": {
33+
"maps": "Mapas",
34+
"alertsDashboard": "Panel de Alertas",
35+
"wildlifeExplorer": "Explorador de Vida Silvestre",
36+
"mediaGalleries": "Galerías de Medios",
37+
"charts": "Gráficos",
38+
"analysis": "Análisis",
39+
"visualizations": "Visualizaciones",
40+
"dashboards": "Paneles",
41+
"dataFlows": "Flujos de Datos",
42+
"scheduledJobs": "Trabajos Programados",
43+
"dataApps": "Aplicaciones de Datos",
44+
"files": "Archivos",
45+
"rawData": "Datos Sin Procesar",
46+
"archives": "Archivos"
47+
}
3048
},
3149
"userManagement": {
3250
"title": "Gestión de Usuarios",
@@ -83,5 +101,9 @@
83101
"copyright": "© 2025 Guardian Connector.",
84102
"community": "Comunidad: {communityName}",
85103
"services": "Servicios: {count}"
104+
},
105+
"header": {
106+
"adminAccess": "Acceso de Administrador",
107+
"languagePicker": "Selector de Idioma"
86108
}
87109
}

i18n/locales/nl.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"app": {
33
"title": "Guardian Connector Startpagina",
44
"community": "Gemeenschap",
5-
"welcome": "Welkom bij het Guardian Connector‑platform voor {communityName}",
6-
"welcomeSubtitle": "Toegang tot uw gemeenschapstools en -bronnen op één plek"
5+
"welcome": "Uw gemeenschap, uw controle.",
6+
"welcomeSubtitle": "Hier kunt u gegevens vinden en de activa van {communityName} beheren."
77
},
88
"auth": {
99
"signIn": "Inloggen",
@@ -13,7 +13,7 @@
1313
"welcome": "Welkom, {user}",
1414
"userManagement": "Gebruikersbeheer",
1515
"secureAccessRequired": "Veilige Toegang Vereist",
16-
"pleaseSignInToAccess": "Gelieve in te loggen om toegang te krijgen tot uw gemeenschapstools"
16+
"pleaseSignInToAccess": "Gelieve in te loggen om toegang te krijgen tot uw gemeenschap tools"
1717
},
1818
"services": {
1919
"superset": "Superset",
@@ -26,7 +26,25 @@
2626
"filebrowserDescription": "Veilig bestandsbeheer en -deling",
2727
"noServicesAvailable": "Geen Services Beschikbaar",
2828
"noServicesDescription": "Geen gemeenschapsservices zijn momenteel geïmplementeerd of toegankelijk.",
29-
"communityService": "Gemeenschapsservice"
29+
"needHelp": "Hulp nodig? Bezoek de",
30+
"documentationWebsite": "Guardian Connector documentatie website",
31+
"communityService": "Gemeenschapsservice",
32+
"tags": {
33+
"maps": "Kaarten",
34+
"alertsDashboard": "Waarschuwingen Dashboard",
35+
"wildlifeExplorer": "Wildlife Verkenner",
36+
"mediaGalleries": "Media Galerijen",
37+
"charts": "Grafieken",
38+
"analysis": "Analyse",
39+
"visualizations": "Visualisaties",
40+
"dashboards": "Dashboards",
41+
"dataFlows": "Gegevensstromen",
42+
"scheduledJobs": "Geplande Taken",
43+
"dataApps": "Gegevens Apps",
44+
"files": "Bestanden",
45+
"rawData": "Ruwe Gegevens",
46+
"archives": "Archieven"
47+
}
3048
},
3149
"userManagement": {
3250
"title": "Gebruikersbeheer",
@@ -83,5 +101,9 @@
83101
"copyright": "© 2025 Guardian Connector.",
84102
"community": "Gemeenschap: {communityName}",
85103
"services": "Services: {count}"
104+
},
105+
"header": {
106+
"adminAccess": "Beheerders Toegang",
107+
"languagePicker": "Taal Selector"
86108
}
87109
}

i18n/locales/pt.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"app": {
33
"title": "Página Inicial do Guardian Connector",
44
"community": "Comunidade",
5-
"welcome": "Bem-vindo à plataforma Guardian Connector para {communityName}",
6-
"welcomeSubtitle": "Acesse suas ferramentas e recursos da comunidade em um só lugar"
5+
"welcome": "Sua comunidade, seu controle.",
6+
"welcomeSubtitle": "Aqui você pode encontrar dados e gerenciar os ativos de {communityName}."
77
},
88
"auth": {
99
"signIn": "Entrar",
@@ -26,7 +26,25 @@
2626
"filebrowserDescription": "Gerenciamento e compartilhamento seguro de arquivos",
2727
"noServicesAvailable": "Nenhum Serviço Disponível",
2828
"noServicesDescription": "Nenhum serviço da comunidade está atualmente implantado ou acessível.",
29-
"communityService": "Serviço da comunidade"
29+
"needHelp": "Precisa de ajuda? Visite o",
30+
"documentationWebsite": "site de documentação do Guardian Connector",
31+
"communityService": "Serviço da comunidade",
32+
"tags": {
33+
"maps": "Mapas",
34+
"alertsDashboard": "Painel de Alertas",
35+
"wildlifeExplorer": "Explorador de Vida Selvagem",
36+
"mediaGalleries": "Galeria de Mídia",
37+
"charts": "Gráficos",
38+
"analysis": "Análise",
39+
"visualizations": "Visualizações",
40+
"dashboards": "Painéis",
41+
"dataFlows": "Fluxos de Dados",
42+
"scheduledJobs": "Trabalhos Agendados",
43+
"dataApps": "Aplicativos de Dados",
44+
"files": "Arquivos",
45+
"rawData": "Dados Brutos",
46+
"archives": "Arquivos"
47+
}
3048
},
3149
"userManagement": {
3250
"title": "Gerenciamento de Usuários",
@@ -83,5 +101,9 @@
83101
"copyright": "© 2025 Guardian Connector.",
84102
"community": "Comunidade: {communityName}",
85103
"services": "Serviços: {count}"
104+
},
105+
"header": {
106+
"adminAccess": "Acesso de Administrador",
107+
"languagePicker": "Seletor de Idioma"
86108
}
87109
}

0 commit comments

Comments
 (0)