Modify router, remove contact pg and use footer

This commit is contained in:
2026-08-11 20:08:39 +03:00
parent 2060a76e0f
commit 31460f7398
5 changed files with 22 additions and 25 deletions

View File

@@ -11,7 +11,7 @@ import { text } from "../lib/index.js";
</script>
<template>
<Section bg="bg-gray-900" class="text-white">
<Section bg="bg-gray-900" class="text-white" id="kontakt">
<Grid>
<div>
<h3 class="text-3xl font-light pb-4">MTÜ Lapikud</h3>

View File

@@ -356,7 +356,7 @@ function handleResize() {
)
"
:onClick="
() => handleNavigation('/kontakt')
() => handleNavigation('#kontakt')
"
>
{{ text.contact }}

View File

@@ -12,6 +12,13 @@ export function navigate(path, options = {}) {
if (external) {
window.open(path, '_blank', 'noopener,noreferrer');
} else if (path.startsWith('#')) {
const hash = path;
const target = document.getElementById(hash.slice(1));
if (target) {
window.history.pushState({}, '', `${window.location.pathname}${window.location.search}${hash}`);
target.scrollIntoView({ behavior: 'smooth' });
}
} else {
const url = new URL(path, window.location.origin);
if (url.origin !== window.location.origin) {
@@ -29,12 +36,24 @@ export function navigate(path, options = {}) {
}
function commitNavigation(path) {
const hash = new URL(path, window.location.origin).hash;
window.history.pushState({}, '', path);
window.scrollTo(0, 0);
window.dispatchEvent(new PopStateEvent('popstate'));
const lang = getLanguageFromRoute(new URL(path, window.location.origin).pathname);
if (lang) switchLang(lang);
if (hash) {
const scrollToHash = () => {
const target = document.getElementById(hash.slice(1));
if (target) {
target.scrollIntoView({ behavior: 'smooth' });
}
};
requestAnimationFrame(scrollToHash);
} else {
window.scrollTo(0, 0);
}
}
/**

View File

@@ -1,19 +0,0 @@
<script setup>
import {
Section,
Grid,
Center,
} from "../components/index.js";
import { usePageText } from "../lib/index.js";
const text = usePageText("Contact");
</script>
<template>
<div class="safe-area-navbar">
<Section>
<p>In development...</p>
</Section>
</div>
</template>

View File

@@ -7,7 +7,6 @@ const loadMentors = () => import('./Mentors.vue');
const loadHelpdesk = () => import('./Helpdesk.vue');
const loadOurWork = () => import('./OurWork.vue');
const loadAboutUs = () => import('./AboutUs.vue');
const loadContact = () => import('./Contact.vue');
const loadManagment = () => import('./Managment.vue');
const loadStriim = () => import('./Striim.vue');
const loadCalendar = () => import('./Calendar.vue');
@@ -101,8 +100,6 @@ export const routes = {
'/ourwork': loadOurWork,
'/lapikutest': loadAboutUs,
'/aboutus': loadAboutUs,
'/kontakt': loadContact,
'/contact': loadContact,
'/juhatus': loadManagment,
'/management': loadManagment,
'/koolitused': loadWorkshops,