Skip to content

Commit

Permalink
emphasize filename
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderStrike committed Dec 12, 2024
1 parent 741c0cf commit f9ed99a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ fetch("/filelist")
const result = fuse.search(query.toLowerCase()).reverse()
const elements = result.slice(0, 200).map(x => {
const file = x.item
const pathParts = file.path.split('/')
const filename = pathParts.pop()
const path = pathParts.length ? pathParts.join('/') + '/' : ''

return `<a href="${file.path}">
<li>
${getFileIcon(file.path)}
<span class="file-details">
<span class="filename">${file.path}</span>
<span class="filename">
<span class="filepath">${path}</span>${filename}
</span>
<span class="filesize">${file.size}</span>
</span>
</li>
Expand Down
7 changes: 7 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ li:hover {

.filename {
flex: 1;
color: #000;
font-weight: 500;
}

.filesize {
font-size: 0.8em;
color: #666;
white-space: nowrap;
}

.filepath {
color: #666;
font-weight: normal;
}

0 comments on commit f9ed99a

Please sign in to comment.