Commit a2089900 authored by timel's avatar timel

feat: add placeholder in card

parent ce6eb372
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
height: var(--card-height); height: var(--card-height);
aspect-ratio: var(--card-ratio); aspect-ratio: var(--card-ratio);
transform-style: preserve-3d; transform-style: preserve-3d;
.img-wrap { .container {
transform-style: preserve-3d; transform-style: preserve-3d;
position: relative; position: relative;
margin: auto auto; margin: auto auto;
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
transition: 0.2s scale; transition: 0.2s scale;
cursor: pointer; cursor: pointer;
.cover, .cover,
.back { .back,
.placeholder {
width: 100% !important; width: 100% !important;
height: 100%; height: 100%;
position: absolute; position: absolute;
...@@ -26,16 +27,21 @@ ...@@ -26,16 +27,21 @@
border-radius: 2px; border-radius: 2px;
overflow: hidden; overflow: hidden;
} }
.cover { .placeholder {
z-index: 1; z-index: 1;
transform: translateZ(0.5px); // transform: translateZ(0.5px);
background-color: gray;
}
.cover {
z-index: 2;
// transform: translateZ(0.5px);
} }
&.focusing .cover { &.focusing .cover {
animation: focus 0.6s ease-in-out; animation: focus 0.6s ease-in-out;
} }
.back { .back {
z-index: 0; z-index: 0;
transform: translateZ(0px); transform: rotateY(180deg);
} }
} }
.shadow { .shadow {
......
...@@ -305,15 +305,16 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -305,15 +305,16 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
trigger={["click"]} trigger={["click"]}
> >
<div <div
className={classnames(styles["img-wrap"], { className={classnames(styles.container, {
[styles.focusing]: classFocus, [styles.focusing]: classFocus,
})} })}
> >
<YgoCard className={styles.back} isBack />
<div className={styles.placeholder} />
<YgoCard <YgoCard
className={styles.cover} className={styles.cover}
code={snap.code === 0 ? snap.meta.id : snap.code} code={snap.code === 0 ? snap.meta.id : snap.code}
/> />
<YgoCard className={styles.back} isBack />
</div> </div>
</Dropdown> </Dropdown>
{snap.selected ? <div className={styles.streamer} /> : <></>} {snap.selected ? <div className={styles.streamer} /> : <></>}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment