full site update
This commit is contained in:
BIN
src/components/.DS_Store
vendored
Normal file
BIN
src/components/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,5 +1,8 @@
|
||||
---
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations, localizePath } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<section class="py-20 bg-gradient-to-br from-primary via-primary to-secondary text-primary-foreground relative overflow-hidden">
|
||||
@@ -25,7 +28,7 @@ import { t } from '../utils/i18n';
|
||||
<!-- CTA button -->
|
||||
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
|
||||
<a
|
||||
href="/contact"
|
||||
href={localizePath("/contact", lang)}
|
||||
class="bg-background text-foreground hover:bg-background/90 px-8 py-4 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105 inline-flex items-center group"
|
||||
>
|
||||
{t('cta.button')}
|
||||
@@ -53,4 +56,4 @@ import { t } from '../utils/i18n';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
@@ -1,5 +1,8 @@
|
||||
---
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<section class="py-20 bg-background">
|
||||
@@ -219,4 +222,4 @@ import { t } from '../utils/i18n';
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
@@ -1,6 +1,9 @@
|
||||
---
|
||||
import { NAVIGATION } from '../site.config';
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<footer class="bg-secondary-900 text-secondary-100 pt-16 pb-8">
|
||||
|
@@ -2,7 +2,10 @@
|
||||
import { NAVIGATION } from '../site.config';
|
||||
import ThemeToggle from './ThemeToggle.astro';
|
||||
import LanguageSwitcher from './LanguageSwitcher.astro';
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations, localizePath } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<header class="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||
@@ -10,7 +13,7 @@ import { t } from '../utils/i18n';
|
||||
<div class="flex h-16 items-center justify-between">
|
||||
<!-- Logo -->
|
||||
<div class="flex items-center">
|
||||
<a href="/" class="flex items-center space-x-2">
|
||||
<a href={localizePath("/", lang)} class="flex items-center space-x-2">
|
||||
<div class="h-8 w-8 flex items-center justify-center">
|
||||
<img
|
||||
src="/images/TIBER365.png"
|
||||
@@ -26,7 +29,7 @@ import { t } from '../utils/i18n';
|
||||
<div class="hidden md:flex items-center space-x-6">
|
||||
{NAVIGATION.map((item) => (
|
||||
<a
|
||||
href={item.href}
|
||||
href={item.type === 'external' ? item.href : localizePath(item.href, lang)}
|
||||
target={item.type === 'external' ? '_blank' : undefined}
|
||||
rel={item.type === 'external' ? 'noopener noreferrer' : undefined}
|
||||
class="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors relative group"
|
||||
@@ -69,7 +72,7 @@ import { t } from '../utils/i18n';
|
||||
<div class="px-2 pt-2 pb-3 space-y-1">
|
||||
{NAVIGATION.map((item) => (
|
||||
<a
|
||||
href={item.href}
|
||||
href={item.type === 'external' ? item.href : localizePath(item.href, lang)}
|
||||
target={item.type === 'external' ? '_blank' : undefined}
|
||||
rel={item.type === 'external' ? 'noopener noreferrer' : undefined}
|
||||
class="block px-3 py-2 text-base font-medium text-muted-foreground hover:text-foreground hover:bg-accent rounded-md transition-colors"
|
||||
@@ -116,4 +119,4 @@ import { t } from '../utils/i18n';
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
@@ -1,37 +1,35 @@
|
||||
---
|
||||
import { t } from '../utils/i18n';
|
||||
import { Trans } from 'astro-i18next/components';
|
||||
import i18next from 'i18next';
|
||||
import { getLangFromUrl, useTranslations, localizePath } from '../utils/i18n';
|
||||
|
||||
// Log the locale for debugging
|
||||
console.log('Hero component locale:', i18next.language);
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<section class="relative min-h-[calc(100vh-4rem)] flex items-center justify-center bg-gradient-to-br from-background via-background to-muted overflow-hidden">
|
||||
<div class="container-custom relative z-10">
|
||||
<div class="flex flex-col items-center justify-center w-full animate-on-scroll">
|
||||
<h1 class="text-4xl sm:text-5xl lg:text-6xl font-display font-bold text-foreground mb-6 text-center">
|
||||
{t('hero.title', 'en')}
|
||||
{t('hero.title')}
|
||||
</h1>
|
||||
<p class="text-lg sm:text-xl text-muted-foreground mb-8 max-w-2xl mx-auto text-center">
|
||||
{t('hero.subtitle', 'en')}
|
||||
{t('hero.subtitle')}
|
||||
</p>
|
||||
<div class="flex flex-col sm:flex-row gap-4 justify-center mb-8">
|
||||
<a
|
||||
href="/contact"
|
||||
href={localizePath("/contact", lang)}
|
||||
class="btn-primary px-8 py-4 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105"
|
||||
>
|
||||
{t('hero.cta.primary', 'en')}
|
||||
{t('hero.cta.primary')}
|
||||
</a>
|
||||
<a
|
||||
href="/services"
|
||||
href={localizePath("/services", lang)}
|
||||
class="btn-outline px-8 py-4 text-lg font-semibold rounded-xl transition-all duration-300 hover:scale-105"
|
||||
>
|
||||
{t('hero.cta.secondary', 'en')}
|
||||
{t('hero.cta.secondary')}
|
||||
</a>
|
||||
</div>
|
||||
<p class="mt-8 text-sm text-muted-foreground text-center">
|
||||
{t('hero.trusted', 'en')}
|
||||
{t('hero.trusted')}
|
||||
</p>
|
||||
<!-- Service Icons Row -->
|
||||
<div class="flex justify-center gap-6 mt-6 mb-4 text-3xl opacity-80">
|
||||
@@ -58,4 +56,4 @@ console.log('Hero component locale:', i18next.language);
|
||||
background-image: radial-gradient(circle, rgba(var(--color-foreground) / 0.1) 1px, transparent 1px);
|
||||
background-size: 30px 30px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
@@ -1,7 +0,0 @@
|
||||
import { LanguageSelector } from "astro-i18next/components";
|
||||
|
||||
<LanguageSelector
|
||||
showFlag={true}
|
||||
class="bg-white dark:bg-gray-800 text-gray-800 dark:text-white px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600"
|
||||
languageMapping={{ en: "English", nl: "Nederlands", it: "Italiano" }}
|
||||
/>
|
@@ -1,21 +1,23 @@
|
||||
---
|
||||
import { LANGUAGES } from '../site.config';
|
||||
import { localizePath } from 'astro-i18next';
|
||||
import { getLangFromUrl, languages, localizePath } from '../utils/i18n';
|
||||
|
||||
const { currentLocale } = Astro;
|
||||
const { pathname } = Astro.url;
|
||||
const currentLang = getLangFromUrl(Astro.url);
|
||||
const currentPath = Astro.url.pathname;
|
||||
|
||||
// Remove the current locale from the path to get the base path
|
||||
const basePath = currentPath.replace(/^\/[a-z]{2}(\/|$)/, '/').replace(/\/$/, '') || '/';
|
||||
---
|
||||
|
||||
<select
|
||||
class="language-selector bg-white dark:bg-gray-800 text-gray-800 dark:text-white px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600"
|
||||
onchange="window.location.href = this.value"
|
||||
>
|
||||
{Object.entries(LANGUAGES).map(([code, name]) => (
|
||||
{Object.entries(languages).map(([code, { name }]) => (
|
||||
<option
|
||||
value={localizePath(pathname, code)}
|
||||
selected={code === currentLocale}
|
||||
value={localizePath(basePath, code as any)}
|
||||
selected={code === currentLang}
|
||||
>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</select>
|
@@ -1,21 +1,71 @@
|
||||
---
|
||||
import LanguageSelector from './LanguageSelector.astro';
|
||||
import { getLangFromUrl, languages, localizePath } from '../utils/i18n';
|
||||
|
||||
const currentLang = getLangFromUrl(Astro.url);
|
||||
const currentPath = Astro.url.pathname;
|
||||
|
||||
// Remove the current locale from the path to get the base path
|
||||
const basePath = currentPath.replace(/^\/[a-z]{2}(\/|$)/, '/').replace(/\/$/, '') || '/';
|
||||
---
|
||||
|
||||
<div class="relative inline-block text-left">
|
||||
<LanguageSelector />
|
||||
<div class="relative inline-block text-left" id="language-switcher">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent focus:outline-none focus:ring-2 focus:ring-primary"
|
||||
id="language-menu-button"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
>
|
||||
<span class="mr-2">{languages[currentLang]?.flag || '🌐'}</span>
|
||||
<span class="hidden sm:inline">{languages[currentLang]?.name || 'Language'}</span>
|
||||
<svg class="ml-1 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div
|
||||
class="hidden absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-background shadow-lg ring-1 ring-border"
|
||||
id="language-menu"
|
||||
role="menu"
|
||||
aria-orientation="vertical"
|
||||
aria-labelledby="language-menu-button"
|
||||
>
|
||||
<div class="py-1" role="none">
|
||||
{Object.entries(languages).map(([lang, { name, flag }]) => (
|
||||
<a
|
||||
href={localizePath(basePath, lang as any)}
|
||||
class={`flex items-center px-4 py-2 text-sm hover:bg-accent transition-colors ${
|
||||
lang === currentLang ? 'bg-accent text-foreground font-medium' : 'text-muted-foreground'
|
||||
}`}
|
||||
role="menuitem"
|
||||
>
|
||||
<span class="mr-3">{flag}</span>
|
||||
{name}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
:global(.language-selector-wrapper) {
|
||||
@apply relative;
|
||||
}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const button = document.getElementById('language-menu-button');
|
||||
const menu = document.getElementById('language-menu');
|
||||
|
||||
:global(.language-selector) {
|
||||
@apply inline-flex items-center justify-center p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent focus:outline-none focus:ring-2 focus:ring-primary;
|
||||
}
|
||||
if (button && menu) {
|
||||
button.addEventListener('click', () => {
|
||||
const isExpanded = button.getAttribute('aria-expanded') === 'true';
|
||||
button.setAttribute('aria-expanded', (!isExpanded).toString());
|
||||
menu.classList.toggle('hidden');
|
||||
});
|
||||
|
||||
:global(.language-selector-flag) {
|
||||
@apply mr-2;
|
||||
}
|
||||
</style>
|
||||
// Close menu when clicking outside
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!button?.contains(e.target as Node) && !menu?.contains(e.target as Node)) {
|
||||
button?.setAttribute('aria-expanded', 'false');
|
||||
menu?.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
@@ -1,6 +1,9 @@
|
||||
---
|
||||
import { SERVICES } from '@config';
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations, localizePath } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<section id="services" class="py-20 bg-muted/30">
|
||||
@@ -52,7 +55,7 @@ import { t } from '../utils/i18n';
|
||||
<!-- Learn more link -->
|
||||
<div class="mt-6">
|
||||
<a
|
||||
href={`/services#${service.id}`}
|
||||
href={localizePath(`/services#${service.id}`, lang)}
|
||||
class="inline-flex items-center text-primary hover:text-primary/80 font-medium text-sm group-hover:translate-x-1 transition-all duration-200"
|
||||
>
|
||||
Learn more
|
||||
@@ -68,7 +71,7 @@ import { t } from '../utils/i18n';
|
||||
<!-- CTA section -->
|
||||
<div class="text-center animate-on-scroll">
|
||||
<a
|
||||
href="/services"
|
||||
href={localizePath("/services", lang)}
|
||||
class="btn-primary px-8 py-4 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105 inline-flex items-center group"
|
||||
>
|
||||
{t('services.viewAll')}
|
||||
@@ -78,4 +81,4 @@ import { t } from '../utils/i18n';
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
@@ -1,6 +1,9 @@
|
||||
---
|
||||
import { TESTIMONIALS } from '../site.config';
|
||||
import { t } from '../utils/i18n';
|
||||
import { getLangFromUrl, useTranslations } from '../utils/i18n';
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = await useTranslations(lang);
|
||||
---
|
||||
|
||||
<section class="py-20 bg-background">
|
||||
@@ -76,4 +79,4 @@ import { t } from '../utils/i18n';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
Reference in New Issue
Block a user