fix: transition from png to apng leo

This commit is contained in:
gofnnp 2023-09-16 03:33:15 +04:00
parent 5ae5a524f0
commit 0616191f78
2 changed files with 37 additions and 8 deletions

View File

@ -102,12 +102,19 @@ function BreathPage(): JSX.Element {
<> <>
<section <section
className={`${styles.page} page`} className={`${styles.page} page`}
style={{ // style={{
backgroundImage: `url(${ // backgroundImage: `url(${!isOpenModal ? asset?.url : "none"})`,
!isOpenModal ? asset?.url : "none" // }}
})`,
}}
> >
{!isOpenModal && asset?.url && (
<div className={styles["leo-apng-container"]}>
<img
className={styles["leo-apng"]}
src={asset.url}
alt="leo apng"
/>
</div>
)}
{!isOpenModal && isShowPreview && ( {!isOpenModal && isShowPreview && (
<div className={styles.preview}> <div className={styles.preview}>
<img className={styles.leo} src="/leo.png" alt="leo" /> <img className={styles.leo} src="/leo.png" alt="leo" />

View File

@ -5,12 +5,25 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: #01010b; background-color: #01010b;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
flex: auto; flex: auto;
} }
.leo-apng-container {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.leo-apng {
animation-name: leo-apng;
animation-duration: 1.5s;
animation-iteration-count: 1;
animation-timing-function: linear;
}
.text-container { .text-container {
position: relative; position: relative;
width: 138px; width: 138px;
@ -60,6 +73,15 @@
animation-timing-function: linear; animation-timing-function: linear;
} }
@keyframes leo-apng {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes leo { @keyframes leo {
0% { 0% {
opacity: 0; opacity: 0;