More robust and flexible layout.

This commit is contained in:
Leo Vasanko
2023-11-18 21:55:52 -08:00
parent 434e55f303
commit a9d713dbd0
7 changed files with 58 additions and 37 deletions
+1
View File
@@ -10,6 +10,7 @@
>
<a href="#/"
:ref="el => setLinkRef(0, el)"
class="home"
:class="{ current: !!isCurrent(0) }"
:aria-current="isCurrent(0)"
@click.prevent="navigate(0)"
+5 -4
View File
@@ -244,12 +244,13 @@ const contextMenu = (ev: MouseEvent, doc: Doc) => {
<style scoped>
.gallery {
padding: 1rem;
padding: 1em;
width: 100%;
display: grid;
gap: .5rem;
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
grid-auto-rows: 15rem;
gap: .5em;
grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
grid-template-rows: repeat(minmax(auto, 15em));
align-items: end;
}
.breadcrumb {
position: absolute;
+10 -7
View File
@@ -37,21 +37,24 @@ const m = ref<typeof MediaPreview | null>(null)
<style scoped>
.gallery figure {
height: 15rem;
max-height: 15em;
position: relative;
border-radius: .5rem;
border-radius: .5em;
overflow: hidden;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
justify-content: end;
overflow: hidden;
}
.icon {
justify-self: end;
}
figure caption {
font-weight: 600;
color: var(--text-color);
text-shadow: 0 0 .2rem var(--primary-background), 0 0 .2rem var(--primary-background);
text-shadow: 0 0 .2em var(--primary-background), 0 0 .2em var(--primary-background);
}
.cursor caption {
background: var(--accent-color);
@@ -73,15 +76,15 @@ caption label {
}
label span {
flex: 1 1;
margin-right: 2rem;
margin-right: 2em;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
label input[type='checkbox'] {
width: 2rem;
height: 2rem;
width: 2em;
height: 2em;
opacity: 0;
flex-shrink: 0;
}
+12 -13
View File
@@ -2,8 +2,8 @@
<img v-if=preview() :src="`${doc.previewurl}?${quality}&t=${doc.mtime}`" alt="">
<img v-else-if=doc.img :src=doc.url alt="">
<span v-else-if=doc.dir class="folder icon"></span>
<video ref=vid v-else-if=video() :src=doc.url :poster="`${doc.previewurl}?${quality}&t=${doc.mtime}`" controls preload=none @click.prevent>📄</video>
<audio ref=aud v-else-if=audio() :src=doc.url controls preload=metadata @click.stop>📄</audio>
<video ref=vid v-else-if=video() :src=doc.url :poster="`${doc.previewurl}?${quality}&t=${doc.mtime}`" controls preload=none @click.prevent>🎞</video>
<audio ref=aud v-else-if=audio() :src=doc.url controls preload=metadata @click.stop>🔈</audio>
<span v-else-if=archive() class="archive icon"></span>
<span v-else class="file icon" :class="`ext-${doc.ext}`"></span>
</template>
@@ -43,22 +43,21 @@ const preview = () => (
</script>
<style scoped>
img, embed, .icon {
img, embed, .icon, audio, video {
font-size: 10em;
border-radius: .5rem;
overflow: hidden;
text-align: center;
object-fit: cover;
object-position: center;
min-width: 50%;
height: 100%;
}
audio, video {
height: 100%;
min-width: 50%;
max-width: 100%;
min-height: 50%;
max-height: 100%;
object-fit: cover;
border-radius: .05em;
}
img {
justify-self: start;
}
audio, video {
padding-bottom: 2rem;
margin: auto;
}
.folder::before {
content: '📁';