feat(assets): ajout de nouvelles images et mise à jour des niveaux de compétences
- Ajout des images pour Bootstrap, PostgreSQL, Ruby et Ruby on Rails - Ajout des images pour Tailwind CSS - Mise à jour des niveaux de compétences pour plusieurs technologies dans le fichier techstack.ts - Amélioration du comportement de défilement dans le routeur pour une navigation plus fluide
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { nextTick } from 'vue'
|
||||
import HomePage from '../views/HomePage.vue'
|
||||
|
||||
const router = createRouter({
|
||||
@@ -30,18 +31,39 @@ const router = createRouter({
|
||||
component: () => import('../views/ContactPage.vue')
|
||||
}
|
||||
],
|
||||
scrollBehavior() {
|
||||
// Always scroll to top for consistent navigation
|
||||
return { top: 0 }
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
// If there's a saved position (back/forward navigation), use it
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
}
|
||||
|
||||
// If navigating to a hash anchor, scroll to that element
|
||||
if (to.hash) {
|
||||
return {
|
||||
el: to.hash,
|
||||
behavior: 'smooth'
|
||||
}
|
||||
}
|
||||
|
||||
// For all other navigation, scroll to top
|
||||
return {
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Force scroll to top on every navigation
|
||||
// Additional scroll to top handler for better compatibility
|
||||
router.afterEach(() => {
|
||||
// Use nextTick to ensure DOM is updated
|
||||
setTimeout(() => {
|
||||
window.scrollTo(0, 0)
|
||||
}, 0)
|
||||
// Use nextTick to ensure the DOM is fully updated
|
||||
nextTick(() => {
|
||||
// Smooth scroll to top
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export default router
|
||||
|
Reference in New Issue
Block a user