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 { .unclickable {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.4; opacity: 0.25;
} }
button, button,

View File

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

View File

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