mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-21 13:39:30 -07:00
click to center top image and let tailing images fade
This commit is contained in:
@@ -18,3 +18,20 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 0ms ease-in-out;
|
transition: opacity 0ms ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.trailingImage1 {
|
||||||
|
transition: opacity 0.5s ease-in-out 1s;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.trailingImage2 {
|
||||||
|
transition: opacity 0.5s ease-in-out 0.75s;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.trailingImage3 {
|
||||||
|
transition: opacity 0.5s ease-in-out 0.5s;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.trailingImage4 {
|
||||||
|
transition: opacity 0.5s ease-in-out 0.25s;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ function duper (num) {
|
|||||||
return ('0000' + num).slice(-4)
|
return ('0000' + num).slice(-4)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// threshold display update
|
||||||
function thresholdUpdate () {
|
function thresholdUpdate () {
|
||||||
thresholdNum.item(0).innerText = duper(threshold[thresholdIndex])
|
thresholdNum.item(0).innerText = duper(threshold[thresholdIndex])
|
||||||
}
|
}
|
||||||
@@ -77,8 +78,9 @@ const activate = (image, x, y) => {
|
|||||||
image.style.left = '50%'
|
image.style.left = '50%'
|
||||||
image.style.top = '50%'
|
image.style.top = '50%'
|
||||||
const activeImages = document.getElementsByClassName('active')
|
const activeImages = document.getElementsByClassName('active')
|
||||||
for (let i = 0; i <= 3; i++) {
|
const activeImagesCount = activeImages.length
|
||||||
activeImages.item(i).classList.add(`trailingImage${4 - i}`)
|
for (let i = activeImagesCount; i > 1; i--) {
|
||||||
|
activeImages.item(i - 2).classList.add(`trailingImage${(activeImagesCount - 1) - (i - 2)}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user