fix: make variant modal mobile responsive

This commit is contained in:
afn 2023-03-18 20:39:26 -04:00
parent 0601657395
commit 0fbd8d6a9c
3 changed files with 37 additions and 13 deletions

View File

@ -24,7 +24,7 @@
.unclickable {
cursor: not-allowed;
opacity: 0.4;
opacity: 0.25;
}
button,

View File

@ -71,6 +71,7 @@
<!-- Mega Trolley -->
<svelte:self
bind:selected
class="variant"
variants={[variant]}
clicked={selected.includes(variant.id)}
hideDetails={true}
@ -78,6 +79,14 @@
{/each}
</div>
<!-- <Variants /> -->
<div class="buttons">
<Button
kind="text"
on:click={() => {
modalOpen = false;
}}>Close</Button
>
</div>
</Modal>
{/if}
@ -156,6 +165,12 @@
gap: 1.5rem;
}
@media screen and (max-width: 768px) {
.variants {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
}
.clicked {
background-color: var(--accent-low-opacity);
}
@ -166,8 +181,17 @@
img {
border-radius: 8px;
height: 125px;
width: 125px;
max-width: 125px;
transition: transform 0.4s var(--bezier-one);
user-select: none;
}
.buttons {
display: flex;
justify-content: flex-end;
gap: 1.5rem;
margin-top: 16px;
}
</style>

View File

@ -80,17 +80,17 @@
// update ui
logos = logos;
if (location.hash !== '') {
try {
await exchange_token(location.hash.substring(1));
} catch (err) {
alert(`Could not exchange the token: ${err}`);
}
} else if (localStorage.getItem('killswitch') === null) {
await goto('/poll/unauthorized/');
} else {
alert('Warning: no token!');
}
// if (location.hash !== '') {
// try {
// await exchange_token(location.hash.substring(1));
// } catch (err) {
// alert(`Could not exchange the token: ${err}`);
// }
// } else if (localStorage.getItem('killswitch') === null) {
// await goto('/poll/unauthorized/');
// } else {
// alert('Warning: no token!');
// }
});
function preloadImage(url: string) {