From ab474204ce6c34ee6bd9510391b3392b6c013b25 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:24:49 +0800 Subject: [PATCH] [+] Transition --- src/views/Photo.vue | 64 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/src/views/Photo.vue b/src/views/Photo.vue index 9660875..eb4703b 100644 --- a/src/views/Photo.vue +++ b/src/views/Photo.vue @@ -59,6 +59,23 @@ export default class Photos extends Vue { const angle = (detRandom(s) * 20) - 10 // -10 to +10 degrees return `rotate(${angle}deg)` } + + async clickPhoto(p: PhotoMetadata, e: MouseEvent) { + console.log("Clicked photo:", p.id) + const dom = e.currentTarget as HTMLDivElement + const photoEl = dom.querySelector('.photo-abs-container') as HTMLDivElement + + photoEl.style.viewTransitionName = `photo-${p.id}` + + const transition = document.startViewTransition(() => { + // Toggle .active on dom + dom.classList.toggle('active') + + }) + + await transition.finished + photoEl.style.viewTransitionName = '' + } } @@ -69,11 +86,15 @@ export default class Photos extends Vue {
-
- +
+ +
+ +
+
- +
@@ -95,15 +116,46 @@ export default class Photos extends Vue { gap: 0 .img-container - filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3)) margin: -0.5rem max-width: 50% + position: relative + + .blur + display: none + +.img-container.active + position: unset + + .blur + position: fixed + inset: 0 + backdrop-filter: blur(5px) + z-index: 2000 + display: block + img.pin + display: none + .photo-abs-container + position: fixed + z-index: 3000 + //transform: scale(1.5) + transform: rotate(0deg) !important + + img.photo + z-index: 3001 img.photo - clip-path: inset(3.2% 1.8%) + //clip-path: inset(4.3% 1.8%) pointer-events: none +div.photo-abs-container + position: absolute + inset: 0 + z-index: 1000 + filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3)) + + img.pin width: 40px height: 40px + z-index: 2000 \ No newline at end of file