Bring back large file message and update dependencies

This commit is contained in:
2022-03-07 17:12:26 +01:00
parent b9ade1801c
commit 58bc2e112b
9 changed files with 62 additions and 23 deletions

View File

@@ -13,14 +13,11 @@ onMount(() => {
return
}
switch (Math.floor(Math.random()*3)) {
switch (Math.floor(Math.random()*2)) {
case 0:
set_ad_type("ads.plus")
break
case 1:
set_ad_type("pixfuture")
break
case 2:
case 1:
set_ad_type("nextmillennium")
break
}
@@ -138,8 +135,9 @@ head.valueimpression_loaded.subscribe(v => {
<div bind:this={banner} class="banner" id='div-gpt-ad-pixeldraincom728x90_1' style='width: 728px; height: 90px;'>
</div>
{:else if ad_type === "pixfuture"}
<!-- We don't bind the pixfuture ad to the banner variable because pixfuture does its own scaling -->
<!-- AuctionX Display platform tag START -->
<div bind:this={banner} class="banner" id="27517x728x90x4605x_ADSLOT1" clickTrack="%%CLICK_URL_ESC%%"></div>
<div class="banner" id="27517x728x90x4605x_ADSLOT1" clickTrack="%%CLICK_URL_ESC%%"></div>
<script type="text/javascript" async src="https://served-by.pixfuture.com/www/delivery/headerbid.js" slotId="27517x728x90x4605x_ADSLOT1" refreshTime="5" refreshInterval="60"></script>
<!-- AuctionX Display platform tag END -->
{:else if ad_type === "adaround"}

View File

@@ -1,5 +1,6 @@
<script>
import { createEventDispatcher, tick } from "svelte";
import LargeFileMessage from "./LargeFileMessage.svelte";
let dispatch = createEventDispatcher()
export let file = {
@@ -85,6 +86,9 @@ const toggle_play = () => playing ? player.pause() : player.play()
<source src={file.get_href} type={file.mime_type} />
</audio>
{/if}
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
</div>
<style>

View File

@@ -1,5 +1,6 @@
<script>
import { createEventDispatcher } from "svelte";
import LargeFileMessage from "./LargeFileMessage.svelte";
import TextBlock from "./TextBlock.svelte";
let dispatch = createEventDispatcher()
@@ -26,6 +27,9 @@ let file = {
</button>
</TextBlock>
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
<style>
h1 {
text-shadow: 1px 1px 3px var(--shadow_color);

View File

@@ -0,0 +1,29 @@
<script>
import { formatDuration } from "../../util/Formatting.svelte";
import TextBlock from "./TextBlock.svelte";
export let file = {
id: "",
name: "",
show_ads: false,
size: 0,
download_speed_limit: 0,
}
</script>
{#if file.show_ads && file.size > 1e8 && file.download_speed_limit > 0}
<!-- If the file is larger than 100 MB we show a warning about the transfer speed -->
<TextBlock width="700px" center={true}>
Your download speed is currently limited to
{file.download_speed_limit/(1<<20)} MiB/s. Though your download might be
slower if the servers are overloaded. Downloading this file for free
will take at least
{formatDuration((file.size/file.download_speed_limit)*1000)} (under
ideal conditions). You can
<a href="https://www.patreon.com/join/pixeldrain/checkout?rid=5291427&cadence=12">
support Pixeldrain on Patreon
</a>
to download at the highest speed available.
</TextBlock>
{/if}

View File

@@ -50,8 +50,8 @@ onMount(async () => {
<ul>
<li>Come back tomorrow when your free transfer limit resets</li>
<li>
Download the file at a rate of {file.download_speed_limit/(1<<20)}
MiB/s. This will take at least
Download the file at a rate of {file.download_speed_limit/(1<<10)}
kiB/s. This will take at least
{formatDuration((file.size/file.download_speed_limit)*1000)}
</li>
<li>

View File

@@ -1,5 +1,6 @@
<script>
import { onMount, createEventDispatcher, tick } from "svelte";
import LargeFileMessage from "./LargeFileMessage.svelte";
import TextBlock from "./TextBlock.svelte";
let dispatch = createEventDispatcher()
@@ -163,6 +164,9 @@ const fullscreen = () => {
<i class="icon">bolt</i> Support Pixeldrain on Patreon
</a>
</TextBlock>
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
{/if}
<style>

View File

@@ -45,8 +45,8 @@ onMount(() => {
Data transfer limit
</div>
<div class="feat_normal">
10 GB data transfer per 24 hours. When this threshold is reached
your download speed will be limited
5 GB data transfer per 24 hours. When this threshold is reached
your download speed will be reduced to 512 kiB/s
</div>
<div class="feat_pro">
Transfer limit of <span class="text_highlight">1 terabyte</span> per