From a5449ff03c765f7f2bf31bee39fd0e7b1b6f24fa Mon Sep 17 00:00:00 2001 From: Minimata Date: Tue, 2 Dec 2025 16:31:50 +0100 Subject: [PATCH] transitions and buttons --- app/app.vue | 28 +++++++++++- app/assets/css/main.css | 2 +- app/components/ButtonLink.vue | 23 ++++++++++ app/components/GraphNode.vue | 16 +++++-- app/components/GraphView.vue | 12 ++++-- app/layouts/default.vue | 4 +- app/layouts/graph.vue | 6 +++ .../disable-vue-transitions.global.ts | 9 ++++ app/pages/index.vue | 4 ++ app/pages/who-am-i.vue | 43 +++++++++++++++++++ nuxt.config.ts | 6 +++ 11 files changed, 140 insertions(+), 13 deletions(-) create mode 100644 app/components/ButtonLink.vue create mode 100644 app/layouts/graph.vue create mode 100644 app/middleware/disable-vue-transitions.global.ts create mode 100644 app/pages/who-am-i.vue diff --git a/app/app.vue b/app/app.vue index 1e28c84..8350509 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,5 +1,29 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 4be193b..a1b97af 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -3,5 +3,5 @@ * { - font-family: Roboto, sans-serif; + font-family: Share Tech Mono, sans-serif; } \ No newline at end of file diff --git a/app/components/ButtonLink.vue b/app/components/ButtonLink.vue new file mode 100644 index 0000000..0434d5d --- /dev/null +++ b/app/components/ButtonLink.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/app/components/GraphNode.vue b/app/components/GraphNode.vue index 9a397d7..740067c 100644 --- a/app/components/GraphNode.vue +++ b/app/components/GraphNode.vue @@ -4,6 +4,7 @@ import {motion, frame} from "motion-v"; const { name, img = undefined, + link = '/', color = 'bg-white', textTop = false, moveFactor = undefined, @@ -12,8 +13,10 @@ const { initialHeight = undefined, topTextOffset = undefined, bottomTextOffset = undefined, + textSize = undefined, } = defineProps<{ name: string, + link?: string, img?: string, color?: string, textTop?: boolean, @@ -23,6 +26,7 @@ const { initialHeight?: string, topTextOffset?: string, bottomTextOffset?: string, + textSize?: string, }>() const emit = defineEmits(['positionChanged']) @@ -31,8 +35,8 @@ const isHoveringParent = ref(false) const imageMaskClass = `avatar mask mask-squircle ${initialWidth ? initialWidth : 'w-30'} ${initialHeight ? initialHeight : 'h-30'}` const roundedDivClass = `rounded-full absolute ${color} ${initialWidth ? initialWidth : 'w-30'} ${initialHeight ? initialHeight : 'h-30'}` -const topTextClass = `absolute w-full text-center ${topTextOffset ? topTextOffset : '-top-30'}` -const bottomTextClass = `absolute w-full text-center ${bottomTextOffset ? bottomTextOffset : '-bottom-30'}` +const topTextClass = `absolute w-full text-center ${textSize ? textSize : 'text-2xl'} ${topTextOffset ? topTextOffset : '-top-30'}` +const bottomTextClass = `absolute w-full text-center ${textSize ? textSize : 'text-2xl'} ${bottomTextOffset ? bottomTextOffset : '-bottom-30'}` function getRandomArbitrary(min: number, max: number): number { return Math.random() * (max - min) + min; @@ -88,14 +92,18 @@ onUnmounted(() => { :while-hover="{ scale: scaleFactor }" @hover-start="event => {isHoveringParent=true}" @hover-end="event => {isHoveringParent=false}"> - + + + + @hover-end="event => {isHoveringParent=false}"> + + { \ No newline at end of file diff --git a/app/layouts/graph.vue b/app/layouts/graph.vue new file mode 100644 index 0000000..785b79c --- /dev/null +++ b/app/layouts/graph.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/middleware/disable-vue-transitions.global.ts b/app/middleware/disable-vue-transitions.global.ts new file mode 100644 index 0000000..c0776f7 --- /dev/null +++ b/app/middleware/disable-vue-transitions.global.ts @@ -0,0 +1,9 @@ +export default defineNuxtRouteMiddleware((to) => { + if (import.meta.server || !document.startViewTransition) { + return + } + + // Disable built-in Vue transitions + // to.meta.pageTransition = false + // to.meta.layoutTransition = false +}) \ No newline at end of file diff --git a/app/pages/index.vue b/app/pages/index.vue index b0406cf..67a935a 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,4 +1,8 @@ + + + + \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index 64b17b2..e1f0356 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -16,6 +16,12 @@ export default defineNuxtConfig({ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, ], }, + + pageTransition: { name: 'page', mode: 'out-in' }, + layoutTransition: { name: 'layout', mode: 'out-in' }, + }, + experimental: { + viewTransition: true, }, site: {