Skip to content

Commit b87d64d

Browse files
committed
fix: adjust layout properties for improved component structure and accessibility
1 parent a8a1a71 commit b87d64d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/client/views/components/file-card.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- File Card Component -->
2-
<div class="rounded-2xl bg-white hover:shadow-lg shadow-primary/10 transition-all duration-300 overflow-hidden group border border-foreground/10">
2+
<div class="rounded-2xl bg-white hover:shadow-lg shadow-primary/10 transition-all relative duration-300 overflow-hidden group border border-foreground/10">
33
<div class="relative aspect-video bg-slate-50 flex items-center justify-center">
44
<% if (typeof isImage !== 'undefined' && isImage && typeof imageSrc !== 'undefined') { %>
55
<img src="<%= imageSrc %>" alt="<%= title %>" loading="lazy" class="w-full bg-primary/5 h-full object-cover" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
@@ -75,4 +75,5 @@
7575
<p class="text-sm font-bold text-slate-900 mb-1 truncate" title="<%= title %>"><%= title %></p>
7676
<p class="text-xs text-foreground/60"><%= subtitle %></p>
7777
</div>
78+
<a href="<%= previewUrl %>" class="inset-0 z-10 absolute cursor-pointer"></a>
7879
</div>

src/client/views/pages/recent.ejs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
// Categorize files by date
257257
const categorizeFiles = (files) => {
258258
const categories = { today: [], yesterday: [], week: [], older: [] };
259-
259+
260260
files.forEach(file => {
261261
const date = new Date(file.uploadedAt || file.createdAt);
262262
if (isToday(date)) {
@@ -280,7 +280,7 @@
280280
const dropdownId = `recent-dropdown-${file.id || index}-${Math.random().toString(36).slice(2, 6)}`;
281281
282282
return `
283-
<div class="rounded-2xl bg-white hover:shadow-lg shadow-primary/10 transition-all duration-300 overflow-hidden group border border-foreground/10">
283+
<div class="rounded-2xl relative bg-white hover:shadow-lg shadow-primary/10 transition-all duration-300 overflow-hidden group border border-foreground/10">
284284
<div class="relative aspect-video bg-slate-50 flex items-center justify-center">
285285
${isImage ? `
286286
<img src="/api/image/${file.filename}?w=400&h=300" alt="${file.originalFilename || file.filename}" loading="lazy" class="w-full bg-primary/5 h-full object-cover" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
@@ -321,6 +321,7 @@
321321
<h4 class="text-sm font-bold text-slate-900 mb-1 truncate" title="${file.originalFilename || file.filename}">${file.originalFilename || file.filename}</h4>
322322
<p class="text-xs text-foreground/60">${formatBytes(file.size)} · ${timeAgo(file.uploadedAt)}</p>
323323
</div>
324+
<a href="/detail?file=${file.filename}" class="absolute inset-0 z-10 cursor-pointer"></a>
324325
</div>
325326
`;
326327
};
@@ -331,7 +332,7 @@
331332
const dropdownId = `recent-list-dropdown-${file.id || index}-${Math.random().toString(36).slice(2, 6)}`;
332333
333334
return `
334-
<div class="flex items-center justify-between p-4 hover:bg-slate-50 border-b border-slate-100 last:border-b-0 group">
335+
<div class="flex items-center justify-between p-4 hover:bg-slate-50 border-b border-slate-100 last:border-b-0 group relative">
335336
<div class="flex items-center gap-4 min-w-0">
336337
<div class="w-10 h-10 rounded-lg flex items-center justify-center ${typeColors[fileType]}">
337338
<svg class="size-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>

0 commit comments

Comments
 (0)