Files
fnx_web/svelte/src/file_viewer/viewers/SpeedLimit.svelte

74 lines
2.2 KiB
Svelte
Raw Normal View History

2022-03-05 10:49:12 +01:00
<script>
2023-01-17 22:53:51 +01:00
import { createEventDispatcher } from "svelte";
2022-03-05 10:49:12 +01:00
import { formatDataVolume, formatDuration } from "../../util/Formatting.svelte";
2022-12-24 11:37:02 +01:00
import { download_limits } from "../DownloadLimitStore";
2023-01-17 22:53:51 +01:00
import IconBlock from "./IconBlock.svelte";
2022-03-05 10:49:12 +01:00
import TextBlock from "./TextBlock.svelte";
let dispatch = createEventDispatcher()
2022-12-24 11:37:02 +01:00
export let file = {
2022-03-05 10:49:12 +01:00
name: "",
mime_type: "",
availability: "",
2022-12-24 11:37:02 +01:00
size: 0,
download_speed_limit: 0,
2022-03-05 10:49:12 +01:00
}
</script>
2023-01-17 19:03:14 +01:00
<TextBlock>
2022-03-05 10:49:12 +01:00
<img src="/res/img/slow_down.webp" class="header_image" alt="Yea, I'm gonna need you to slow down a bit"/>
<p>
2023-01-17 22:53:51 +01:00
Pixeldrain's free tier is supported by my Patrons (be grateful). There's
only so much that you can do with the budget they provide.
{formatDataVolume($download_limits.transfer_limit, 3)} per day is about
2023-01-17 22:53:51 +01:00
the most I can give away for free while keeping it fair for everyone,
and according to our records you have already downloaded
2022-12-24 11:37:02 +01:00
{formatDataVolume($download_limits.transfer_limit_used, 3)}.
2022-03-05 10:49:12 +01:00
</p>
<p>
It's not that I want to withold this file from you, it's just that I
don't want pixeldrain to fall into bankruptcy like so many of the
2022-03-28 12:34:28 +02:00
websites that came before me. So if you really want this file you have a
few options:
2022-03-05 10:49:12 +01:00
</p>
<ul>
<li>
Come back tomorrow when your free transfer limit resets
</li>
2022-03-05 10:49:12 +01:00
<li>
Download the file at a rate of {file.download_speed_limit/(1<<10)}
kiB/s. This will take at least
2022-03-05 18:11:13 +01:00
{formatDuration((file.size/file.download_speed_limit)*1000)}
2022-03-05 10:49:12 +01:00
</li>
<li>
2022-12-24 11:37:02 +01:00
<a href="https://www.patreon.com/join/pixeldrain" target="_blank" class="button button_highlight" rel="noreferrer">
2022-03-05 10:49:12 +01:00
<i class="icon">bolt</i> Support Pixeldrain on Patreon
</a>
and earn my eternal gratitude
{#if !window.user_authenticated}
(you will need a <a href="/register">pixeldrain account</a> to
receive the benefits)
{/if}
</li>
</ul>
2023-01-17 22:53:51 +01:00
</TextBlock>
<IconBlock icon_href={file.icon_href}>
Name: {file.name}<br/>
Type: {file.mime_type}<br/>
<button on:click={() => {dispatch("download")}}>
<i class="icon">download</i> Download
</button>
</IconBlock>
<TextBlock>
Also, I believe you have my stapler. Please give it back.
2022-03-05 10:49:12 +01:00
</TextBlock>
<style>
.header_image {
width: 100%;
border-radius: 8px;
}
</style>