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 {