Better icon dimensions

This commit is contained in:
2023-05-25 20:31:29 +02:00
parent 4c9f3914b7
commit e23acf46be
7 changed files with 9 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ export const fs_file_url = (bucket, path) => {
return fs_path_url(bucket, path)
}
export const fs_thumbnail_url = (bucket, path, width = 128, height = 128) => {
export const fs_thumbnail_url = (bucket, path, width = 64, height = 64) => {
return fs_path_url(bucket, path) + "?thumbnail&width=" + width + "&height=" + height
}
@@ -50,7 +50,7 @@ export const fs_node_type = node => {
}
}
export const fs_node_icon = (bucket, node) => {
export const fs_node_icon = (bucket, node, width = 64, height = 64) => {
if (node.type === "dir") {
// Folders with an ID are publically shared, use the shared folder icon
if (node.id) {
@@ -60,5 +60,5 @@ export const fs_node_icon = (bucket, node) => {
}
}
return fs_thumbnail_url(bucket, node.path)
return fs_thumbnail_url(bucket, node.path, width, height)
}

View File

@@ -103,7 +103,7 @@ const node_click = index => {
class="node"
>
<td>
<img src={fs_thumbnail_url(state.root.id, result)} class="node_icon" alt="icon"/>
<img src={fs_thumbnail_url(state.root.id, result, 32, 32)} class="node_icon" alt="icon"/>
</td>
<td class="node_name">
{result}

View File

@@ -19,7 +19,7 @@ export let show_hidden = false
<div
class="icon_container"
class:cover={fs_node_type(child) === "image" || fs_node_type(child) === "video"}
style='background-image: url("{fs_node_icon(state.root.id, child)}");'>
style='background-image: url("{fs_node_icon(state.root.id, child, 256, 256)}");'>
</div>
{child.name}
</a>

View File

@@ -25,7 +25,7 @@ export let show_hidden = false
class:hidden={child.name.startsWith(".") && !show_hidden}
>
<td>
<img src={fs_node_icon(state.root.id, child)} class="node_icon" alt="icon"/>
<img src={fs_node_icon(state.root.id, child, 32, 32)} class="node_icon" alt="icon"/>
</td>
<td class="node_name">
{child.name}

View File

@@ -9,7 +9,7 @@ export let state
<h1>{state.base.name}</h1>
<IconBlock icon_href={fs_thumbnail_url(state.root.id, state.base.path)}>
<IconBlock icon_href={fs_thumbnail_url(state.root.id, state.base.path, 256, 256)}>
Type: {state.base.file_type}<br/>
No preview is available for this file type. Download to view it locally.
<br/>

View File

@@ -75,7 +75,7 @@ const copy_magnet = () => {
<h1>{state.base.name}</h1>
<IconBlock icon_href={fs_node_icon(state.root.id, state.base)}>
<IconBlock icon_href={fs_node_icon(state.root.id, state.base, 256, 256)}>
{#if status === "finished"}
Created by: {torrent.created_by}<br/>
Comment: {torrent.comment}<br/>

View File

@@ -61,7 +61,7 @@ const recursive_size = (file) => {
<h1>{state.base.name}</h1>
<IconBlock icon_href={fs_node_icon(state.root.id, state.base)}>
<IconBlock icon_href={fs_node_icon(state.root.id, state.base, 256, 256)}>
Compressed size: {formatDataVolume(state.base.file_size, 3)}<br/>
Uncompressed size: {formatDataVolume(uncomp_size, 3)} (Ratio: {comp_ratio.toFixed(2)}x)<br/>
Uploaded on: {formatDate(state.base.date_created, true, true, true)}