mirror of
https://github.com/Damillora/Shioriko.git
synced 2024-11-22 04:17:33 +00:00
feat: add image resize percent
This commit is contained in:
parent
2c56336c4f
commit
31763528bf
@ -56,7 +56,7 @@
|
|||||||
<strong>Original:</strong>
|
<strong>Original:</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a href={post.image_path}>Image</a>
|
<a href={post.image_path} target="_blank">Image</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-block column">
|
<div class="panel-block column">
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<strong>Original:</strong>
|
<strong>Original:</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a href={post.image_path}>Image</a>
|
<a href={post.image_path} target="_blank">Image</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-block column">
|
<div class="panel-block column">
|
||||||
|
@ -40,6 +40,13 @@
|
|||||||
const toggleEditMenu = () => {
|
const toggleEditMenu = () => {
|
||||||
editMenuShown = !editMenuShown;
|
editMenuShown = !editMenuShown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let imagePercentage = "0%";
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (post)
|
||||||
|
imagePercentage = ((1000 * 100) / post.width).toFixed(0) + "%";
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if post}
|
{#if post}
|
||||||
@ -82,8 +89,10 @@
|
|||||||
<div class="column box">
|
<div class="column box">
|
||||||
{#if post.width > 1000}
|
{#if post.width > 1000}
|
||||||
<div class="notification is-info">
|
<div class="notification is-info">
|
||||||
The image has been resized due to size. The original
|
Resized to {imagePercentage} of the original image.
|
||||||
image link is in the sidebar
|
<a href={post.image_path} target="_blank"
|
||||||
|
>View original</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<img alt={post.id} src={post.preview_path} />
|
<img alt={post.id} src={post.preview_path} />
|
||||||
@ -97,5 +106,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user