Skip to content

Commit 9b37676

Browse files
author
Jicheng Lu
committed
refine attachment
1 parent 4b5444d commit 9b37676

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/lib/common/FileGallery.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
/** @type {(args0: number) => void} */
1515
export let onDelete = () => {};
1616
17-
let isLite = false;
18-
const screenWidthThreshold = 500;
19-
20-
$: {
21-
isLite = Viewport.Width <= screenWidthThreshold;
22-
}
23-
2417
/**
2518
* @param {any} e
2619
* @param {number} idx
@@ -38,7 +31,7 @@
3831
<svelte:fragment slot="thumbnail">
3932
<div class="image-gallery-container">
4033
{#each files as file, idx (idx)}
41-
<div class={`gallery-item ${isLite ? 'lite-gallery-item' : ''}`}>
34+
<div class={`gallery-item`}>
4235
<GalleryThumbnail style="width: 100%; height: 100%; display: flex;" id={idx}>
4336
<div class="gallery-item-wrapper">
4437
{#if needDelete}

src/lib/scss/custom/components/_gallery.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
width: 8em;
99
height: 8em;
1010

11+
@media (max-width: 500px) {
12+
width: 5em;
13+
height: 5em;
14+
}
15+
1116
.gallery-item-wrapper {
1217
position: relative;
1318

@@ -27,11 +32,6 @@
2732
}
2833
}
2934
}
30-
31-
.lite-gallery-item {
32-
width: 5em;
33-
height: 5em;
34-
}
3535
}
3636

3737
.svelte-lightbox-footer p {

0 commit comments

Comments
 (0)