Skip to content

A self-hosted media server and file management system

fix(visual): folder cards at sm screensize are outdated Fixes #225

aminnausina13097830af6
diff --git a/resources/js/components/cards/data/FolderCard.vue b/resources/js/components/cards/data/FolderCard.vue
index f010a671..4c32ca9c 100644
--- a/resources/js/components/cards/data/FolderCard.vue
+++ b/resources/js/components/cards/data/FolderCard.vue
@@ -59,7 +59,7 @@ const mediaType = computed(() => {
<template #trigger>
<SidebarCard
:to="`/${categoryName}/${data.name}`"
- class="text-foreground-1 p-0 sm:p-3"
+ class="text-foreground-1 p-0 lg:p-3"
@contextmenu="
(e: any) => {
setContextMenu(e, { items: contextMenuItems });
@@ -69,61 +69,72 @@ const mediaType = computed(() => {
<img
:src="handleStorageURL(data.series?.thumbnail_url) ?? '/storage/thumbnails/default.webp'"
alt="Folder Thumbnail"
- class="xs:block hidden aspect-square max-h-16 rounded-t-lg object-cover shadow-md sm:me-4 sm:w-12 sm:rounded-xs lg:hidden"
+ :class="['aspect-square max-h-16 rounded-t-lg object-cover', 'sm:aspect-2-3 sm:max-h-none sm:w-16 sm:rounded-t-none sm:rounded-l-sm sm:shadow-md', 'lg:hidden']"
loading="lazy"
/>
- <span class="relative flex w-full flex-1 flex-col flex-wrap gap-4 p-3 text-left sm:flex-row sm:p-0 lg:gap-2">
- <section class="flex w-full items-center justify-between gap-4">
- <h3
- class="text-foreground-0 w-full truncate"
- :title="`${data.id}: ${data.series?.title || data.name}\nCreated: ${toFormattedDate(data.created_at || '')}\nUpdated: ${toFormattedDate(data.updated_at || '')}\nScanned: ${toFormattedDate(data.scanned_at || '')}`"
- >
- {{ data.series?.title || data.name }}
- </h3>
- <div class="flex justify-end gap-1">
- <ButtonCorner
- class="hover:text-primary dark:hover:text-primary-muted hover:dark:bg-surface-1 hover:bg-surface-6 size-7"
- :label="'Share Folder'"
- :use-default-style="false"
- @click.stop.prevent="emit('otherAction', data.id, 'share')"
- >
- <template #icon>
- <CircumShare1 width="20" height="20" stroke-width="1" stroke="currentColor" />
- </template>
- </ButtonCorner>
- <ButtonCorner
- :label="'Open Folder'"
- :class="
- cn(
- data.name === props.stateFolderName ? 'text-primary' : 'hover:text-primary',
- 'dark:hover:text-primary-muted hover:dark:bg-surface-1 hover:bg-surface-6 size-7',
- )
- "
- :use-default-style="false"
- >
- <template #icon>
- <CircumFolderOn width="20" height="20" stroke-width="1" stroke="currentColor" />
- </template>
- </ButtonCorner>
- </div>
- </section>
- <section class="flex w-full flex-col flex-wrap gap-2 text-sm sm:flex-row sm:justify-between">
- <h4 class="w-full flex-1 truncate text-wrap sm:text-nowrap" :title="`${data.file_count} ${mediaType}${data.file_count !== 1 ? 's' : ''}`">
- {{ data.file_count }} {{ mediaType }}{{ data.file_count !== 1 ? 's' : '' }}
- </h4>
- <h4 class="w-fit truncate text-nowrap sm:text-right lg:hidden xl:block">
- {{ formatFileSize(data.total_size ?? 0) }}
- </h4>
- </section>
- </span>
- <section
- v-if="data.series?.folder_tags?.length"
- class="flex w-full flex-wrap gap-1 overflow-clip p-3 pt-0 transition-all group-hover:[overflow-clip-margin:4px] sm:max-h-0 sm:p-0 sm:group-hover:max-h-[26px] sm:group-hover:pt-1"
- title="Tags"
- >
- <MediaTag v-for="(tag, index) in data.series.folder_tags" :key="index" :label="tag.name" />
- </section>
+ <div class="flex w-full flex-1 flex-col sm:p-2 lg:contents lg:p-0">
+ <div
+ :class="[
+ 'relative flex w-full flex-1 flex-col flex-wrap gap-4 p-3 text-left',
+ 'sm:min-h-20 sm:justify-between sm:p-0',
+ 'lg:min-h-0 lg:flex-row lg:justify-normal lg:gap-2',
+ ]"
+ >
+ <section class="flex h-fit w-full items-center justify-between gap-4">
+ <h3
+ class="text-foreground-0 w-full truncate"
+ :title="`${data.id}: ${data.series?.title || data.name}\nCreated: ${toFormattedDate(data.created_at || '')}\nUpdated: ${toFormattedDate(data.updated_at || '')}\nScanned: ${toFormattedDate(data.scanned_at || '')}`"
+ >
+ {{ data.series?.title || data.name }}
+ </h3>
+ <div class="flex justify-end gap-1">
+ <ButtonCorner
+ class="hover:text-primary dark:hover:text-primary-muted hover:dark:bg-surface-1 hover:bg-surface-6 size-7"
+ :label="'Share Folder'"
+ :use-default-style="false"
+ @click.stop.prevent="emit('otherAction', data.id, 'share')"
+ >
+ <template #icon>
+ <CircumShare1 width="20" height="20" stroke-width="1" stroke="currentColor" />
+ </template>
+ </ButtonCorner>
+ <ButtonCorner
+ :label="'Open Folder'"
+ :class="
+ cn(
+ data.name === props.stateFolderName ? 'text-primary' : 'hover:text-primary',
+ 'dark:hover:text-primary-muted hover:dark:bg-surface-1 hover:bg-surface-6 size-7',
+ )
+ "
+ :use-default-style="false"
+ >
+ <template #icon>
+ <CircumFolderOn width="20" height="20" stroke-width="1" stroke="currentColor" />
+ </template>
+ </ButtonCorner>
+ </div>
+ </section>
+ <section class="flex h-fit w-full flex-col flex-wrap gap-2 text-sm sm:flex-row sm:justify-between">
+ <h4 class="w-full flex-1 truncate text-wrap sm:text-nowrap" :title="`${data.file_count} ${mediaType}${data.file_count !== 1 ? 's' : ''}`">
+ {{ data.file_count }} {{ mediaType }}{{ data.file_count !== 1 ? 's' : '' }}
+ </h4>
+ <h4 class="w-fit truncate text-nowrap sm:text-right lg:hidden xl:block">
+ {{ formatFileSize(data.total_size ?? 0) }}
+ </h4>
+ </section>
+ </div>
+ <div
+ v-if="data.series?.folder_tags?.length"
+ :class="[
+ 'flex w-full flex-wrap gap-1 overflow-clip p-3 pt-0 transition-all duration-200 group-hover:[overflow-clip-margin:4px]',
+ 'sm:max-h-0 sm:p-0 sm:group-hover:max-h-[26px] sm:group-hover:pt-1',
+ ]"
+ title="Tags"
+ >
+ <MediaTag v-for="(tag, index) in data.series.folder_tags" :key="index" :label="tag.name" />
+ </div>
+ </div>
</SidebarCard>
</template>
</RelativeHoverCard>