refactor: improve chrome quality

This commit is contained in:
tglide committed 2023-05-01 18:41:04 +01:00
1 parent d9839541d0
commit 008b2c8b33
2 files changed
+38 -6

No files matched your search

+20 -3
View File
@@ -256,7 +256,8 @@
<div class="card__thick" style:--i={i + 1} />
{/each}
<div class="card__front" style:--thickness={THICKNESS}>
<img src={base64.front} alt="The front of the card" />
<img class="invisible" src={base64.front} alt="" />
<img class="abs" src={base64.front} alt="The front of the card" />
<div class="card__glare" />
</div>
</button>
@@ -264,6 +265,9 @@
</div>
<style lang="scss">
.invisible {
opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
.cb-card,
.cb-card * {
@@ -330,10 +334,10 @@
}
.card__rotator {
transform: rotateY(var(--rx)) rotateX(var(--ry)) rotateZ(var(--rz));
transform-style: preserve-3d;
-webkit-transform: rotateY(var(--rx)) rotateX(var(--ry)) rotateZ(var(--rz));
-webkit-transform-style: preserve-3d;
transform: rotateY(var(--rx)) rotateX(var(--ry)) rotateZ(var(--rz));
transform-style: preserve-3d;
box-shadow: 0px 10px 20px -5px var(--shadow-clr);
border-radius: var(--radius);
outline: none;
@@ -393,6 +397,19 @@
&::before {
--resolved-angle: calc(var(--angle) + 65deg);
}
.abs {
display: block;
position: absolute;
left: 50%;
top: 50%;
translate: -50% -50%;
width: 200%;
scale: calc(100 / 200);
// scale: 0.1;
max-inline-size: initial;
max-block-size: initial;
}
}
.card__front::before,
+18 -3
View File
@@ -83,7 +83,7 @@
<div class="wrapper">
<div class="card">
<h3 class="heading-level-3 u-flex u-cross-center u-gap-8">
<h3 class="heading-level-3 u-flex u-cross-center u-gap-8 no-text-select">
{title}
<button class="confetti-btn" on:click={() => triggerConfettiKey++}>
🎉
@@ -125,7 +125,7 @@
</p>
{#if variant === 'external'}
<a
href="/card"
href="/register"
class="button u-width-full-line u-main-center u-margin-block-start-16 external-btn-top"
>Claim your card</a>
{/if}
@@ -168,7 +168,7 @@
</div>
<div class="cbc-wrapper">
{#if !cardActive}
<div transition:fade>
<div class="cbc-confetti" transition:fade>
<Confetti
x={[-1.75, 1.85]}
y={[-1.875, 1]}
@@ -356,6 +356,17 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 500px;
position: relative;
}
.cbc-confetti {
position: absolute;
top: 30%;
left: 50%;
translate: -50% -50%;
}
@keyframes shake {
@@ -428,6 +439,10 @@
display: none;
}
.no-text-select {
user-select: none;
}
@media (max-width: 1024px) {
.external-btn-top {
display: flex;