[F] Fix animation
This commit is contained in:
+15
-21
@@ -63,14 +63,13 @@ export default class Photos extends Vue {
|
|||||||
async clickPhoto(p: PhotoMetadata, e: MouseEvent) {
|
async clickPhoto(p: PhotoMetadata, e: MouseEvent) {
|
||||||
console.log("Clicked photo:", p.id)
|
console.log("Clicked photo:", p.id)
|
||||||
const dom = e.currentTarget as HTMLDivElement
|
const dom = e.currentTarget as HTMLDivElement
|
||||||
const photoEl = dom.querySelector('.photo-abs-container') as HTMLDivElement
|
const photoEl = dom.querySelector('.photo-wrapper') as HTMLDivElement
|
||||||
|
|
||||||
photoEl.style.viewTransitionName = `photo-${p.id}`
|
photoEl.style.viewTransitionName = `photo-${p.id}`
|
||||||
|
|
||||||
const transition = document.startViewTransition(() => {
|
const transition = document.startViewTransition(() => {
|
||||||
// Toggle .active on dom
|
|
||||||
dom.classList.toggle('active')
|
dom.classList.toggle('active')
|
||||||
|
document.getElementsByClassName('blur')[0].toggleAttribute('hidden')
|
||||||
})
|
})
|
||||||
|
|
||||||
await transition.finished
|
await transition.finished
|
||||||
@@ -89,22 +88,27 @@ export default class Photos extends Vue {
|
|||||||
<div v-for="p in row" :key="p.id" @click.capture="async e => await clickPhoto(p, e)"
|
<div v-for="p in row" :key="p.id" @click.capture="async e => await clickPhoto(p, e)"
|
||||||
class="img-container" cursor-pointer>
|
class="img-container" cursor-pointer>
|
||||||
<img class="photo" w-full h-full object-contain opacity-0 :src="url(p.thumbnail_edited)" :alt="p.id"/>
|
<img class="photo" w-full h-full object-contain opacity-0 :src="url(p.thumbnail_edited)" :alt="p.id"/>
|
||||||
<div class="photo-abs-container" absolute inset-0 flex justify-center align-center :style="{transform: randomRotation(p.id)}">
|
<div class="photo-abs-container" absolute inset-0 flex justify-center items-center>
|
||||||
<img class="photo" w-full h-full object-contain :src="url(p.thumbnail_edited)" :alt="p.id" />
|
<div class="photo-wrapper" :style="{transform: randomRotation(p.id)}">
|
||||||
|
<img class="photo" w-full object-contain :src="url(p.thumbnail_edited)" :alt="p.id" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="blur"></div>
|
|
||||||
<div flex w-full justify-center absolute position-top-none>
|
<div flex w-full justify-center absolute position-top-none>
|
||||||
<img class="pin" src="/thumb%20tack%202%20plain.png" alt=""/>
|
<img class="pin" src="/thumb%20tack%202%20plain.png" alt=""/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="blur" hidden pos-fixed inset-0 backdrop-blur-sm z-5></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="sass">
|
<style scoped lang="sass">
|
||||||
@use "../css/colors"
|
@use "../css/colors"
|
||||||
@use "../css/responsive"
|
@use "../css/responsive"
|
||||||
|
|
||||||
|
.blur
|
||||||
|
z-index: 2500
|
||||||
|
|
||||||
.title
|
.title
|
||||||
margin-top: 8rem
|
margin-top: 8rem
|
||||||
margin-bottom: 6rem
|
margin-bottom: 6rem
|
||||||
@@ -112,47 +116,37 @@ export default class Photos extends Vue {
|
|||||||
.bold
|
.bold
|
||||||
font-size: 3em
|
font-size: 3em
|
||||||
|
|
||||||
.outer-grid
|
|
||||||
gap: 0
|
|
||||||
|
|
||||||
.img-container
|
.img-container
|
||||||
margin: -0.5rem
|
margin: -0.5rem
|
||||||
max-width: 50%
|
max-width: 50%
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
.blur
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.img-container.active
|
.img-container.active
|
||||||
position: unset
|
position: unset
|
||||||
|
|
||||||
.blur
|
|
||||||
position: fixed
|
|
||||||
inset: 0
|
|
||||||
backdrop-filter: blur(5px)
|
|
||||||
z-index: 2000
|
|
||||||
display: block
|
|
||||||
img.pin
|
img.pin
|
||||||
display: none
|
display: none
|
||||||
.photo-abs-container
|
.photo-abs-container
|
||||||
position: fixed
|
position: fixed
|
||||||
z-index: 3000
|
z-index: 3000
|
||||||
//transform: scale(1.5)
|
|
||||||
|
.photo-wrapper
|
||||||
transform: rotate(0deg) !important
|
transform: rotate(0deg) !important
|
||||||
|
|
||||||
img.photo
|
img.photo
|
||||||
z-index: 3001
|
z-index: 3001
|
||||||
|
|
||||||
img.photo
|
img.photo
|
||||||
//clip-path: inset(4.3% 1.8%)
|
clip-path: inset(2.8% 1.8% 2.4%)
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
|
|
||||||
div.photo-abs-container
|
div.photo-abs-container
|
||||||
position: absolute
|
position: absolute
|
||||||
inset: 0
|
inset: 0
|
||||||
z-index: 1000
|
z-index: 1000
|
||||||
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3))
|
|
||||||
|
|
||||||
|
div.photo-wrapper
|
||||||
|
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3))
|
||||||
|
|
||||||
img.pin
|
img.pin
|
||||||
width: 40px
|
width: 40px
|
||||||
|
|||||||
Reference in New Issue
Block a user