mirror of
https://github.com/Lapikud/lapikud.github.io.git
synced 2026-09-22 16:25:35 +00:00
Modify router, remove contact pg and use footer
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -356,7 +356,7 @@ function handleResize() {
|
||||
)
|
||||
"
|
||||
:onClick="
|
||||
() => handleNavigation('/kontakt')
|
||||
() => handleNavigation('#kontakt')
|
||||
"
|
||||
>
|
||||
{{ text.contact }}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user