diff --git a/packages/ui/src/renderer/src/features/FlyingCompanyLogoList/index.vue b/packages/ui/src/renderer/src/features/FlyingCompanyLogoList/index.vue index 32ec793..100d380 100644 --- a/packages/ui/src/renderer/src/features/FlyingCompanyLogoList/index.vue +++ b/packages/ui/src/renderer/src/features/FlyingCompanyLogoList/index.vue @@ -17,25 +17,29 @@ const colCount = 6 const logoQueue: HTMLImageElement[] = [] const imageElContainer = ref() onMounted(async () => { - const res = (await Promise.all( - [...Object.values(import.meta.glob('./resources/*.png', { as: 'url' }))].map((it) => it()) - )).map((url) => { + const res = ( + await Promise.all( + [...Object.values(import.meta.glob('./resources/*.png', { as: 'url' }))].map((it) => it()) + ) + ).map((url) => { const img = new Image() img.src = url img.onanimationiteration = () => { const newImg = logoQueue.shift()! newImg.classList.add('dot') - Object.assign(newImg.style,{ + Object.assign(newImg.style, { position: 'relative', - left: (-40 * Math.random()) + 'px', - bottom: (-40 * Math.random()) + 'px' + left: (Math.random() > 0.5 ? -1 : 1) * (100 * Math.random()) + 'px', + bottom: (Math.random() > 0.5 ? -1 : 1) * (100 * Math.random()) + 'px', + transform: `translateZ(${-5000}px)` }) img.replaceWith(newImg) img.classList.remove('dot') - Object.assign(img.style,{ + Object.assign(img.style, { position: '', left: '', - bottom: '' + bottom: '', + transform: `` }) logoQueue.push(img as HTMLImageElement) } @@ -47,10 +51,11 @@ onMounted(async () => { for (let i = 0; i < rowCount * colCount; i++) { const img = logoQueue.shift()! - Object.assign(img.style,{ + Object.assign(img.style, { position: 'relative', - left: (-40 * Math.random()) + 'px', - bottom: (-40 * Math.random()) + 'px' + left: -40 * Math.random() + 'px', + bottom: -40 * Math.random() + 'px', + transform: `translateZ(${-5000}px)` }) img.classList.add('dot') @@ -74,14 +79,10 @@ onMounted(async () => {