Better icon dimensions
This commit is contained in:
@@ -11,7 +11,7 @@ export const fs_file_url = (bucket, path) => {
|
|||||||
return fs_path_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
|
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") {
|
if (node.type === "dir") {
|
||||||
// Folders with an ID are publically shared, use the shared folder icon
|
// Folders with an ID are publically shared, use the shared folder icon
|
||||||
if (node.id) {
|
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)
|
||||||
}
|
}
|
||||||
|
@@ -103,7 +103,7 @@ const node_click = index => {
|
|||||||
class="node"
|
class="node"
|
||||||
>
|
>
|
||||||
<td>
|
<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>
|
||||||
<td class="node_name">
|
<td class="node_name">
|
||||||
{result}
|
{result}
|
||||||
|
@@ -19,7 +19,7 @@ export let show_hidden = false
|
|||||||
<div
|
<div
|
||||||
class="icon_container"
|
class="icon_container"
|
||||||
class:cover={fs_node_type(child) === "image" || fs_node_type(child) === "video"}
|
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>
|
</div>
|
||||||
{child.name}
|
{child.name}
|
||||||
</a>
|
</a>
|
||||||
|
@@ -25,7 +25,7 @@ export let show_hidden = false
|
|||||||
class:hidden={child.name.startsWith(".") && !show_hidden}
|
class:hidden={child.name.startsWith(".") && !show_hidden}
|
||||||
>
|
>
|
||||||
<td>
|
<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>
|
||||||
<td class="node_name">
|
<td class="node_name">
|
||||||
{child.name}
|
{child.name}
|
||||||
|
@@ -9,7 +9,7 @@ export let state
|
|||||||
|
|
||||||
<h1>{state.base.name}</h1>
|
<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/>
|
Type: {state.base.file_type}<br/>
|
||||||
No preview is available for this file type. Download to view it locally.
|
No preview is available for this file type. Download to view it locally.
|
||||||
<br/>
|
<br/>
|
||||||
|
@@ -75,7 +75,7 @@ const copy_magnet = () => {
|
|||||||
|
|
||||||
<h1>{state.base.name}</h1>
|
<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"}
|
{#if status === "finished"}
|
||||||
Created by: {torrent.created_by}<br/>
|
Created by: {torrent.created_by}<br/>
|
||||||
Comment: {torrent.comment}<br/>
|
Comment: {torrent.comment}<br/>
|
||||||
|
@@ -61,7 +61,7 @@ const recursive_size = (file) => {
|
|||||||
|
|
||||||
<h1>{state.base.name}</h1>
|
<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/>
|
Compressed size: {formatDataVolume(state.base.file_size, 3)}<br/>
|
||||||
Uncompressed size: {formatDataVolume(uncomp_size, 3)} (Ratio: {comp_ratio.toFixed(2)}x)<br/>
|
Uncompressed size: {formatDataVolume(uncomp_size, 3)} (Ratio: {comp_ratio.toFixed(2)}x)<br/>
|
||||||
Uploaded on: {formatDate(state.base.date_created, true, true, true)}
|
Uploaded on: {formatDate(state.base.date_created, true, true, true)}
|
||||||
|
Reference in New Issue
Block a user