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