Update shaded background color
This commit is contained in:
@@ -15,7 +15,7 @@ onMount(() => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.body.clientWidth < 700) {
|
if (document.body.clientWidth < 700 || document.body.clientHeight < 700) {
|
||||||
visible = false
|
visible = false
|
||||||
dispatch("visibility", false)
|
dispatch("visibility", false)
|
||||||
return
|
return
|
||||||
|
@@ -644,7 +644,6 @@ const keyboard_event = evt => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
box-shadow: none;
|
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.headerbar.embedded {
|
.headerbar.embedded {
|
||||||
|
@@ -9,6 +9,7 @@ export let file = {
|
|||||||
mime_type: "",
|
mime_type: "",
|
||||||
get_href: "",
|
get_href: "",
|
||||||
show_ads: false,
|
show_ads: false,
|
||||||
|
download_speed_limit: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
$: loop = file.name.includes(".loop.")
|
$: loop = file.name.includes(".loop.")
|
||||||
@@ -90,7 +91,7 @@ const toggle_play = () => playing ? player.pause() : player.play()
|
|||||||
|
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
{#if file.show_ads}
|
{#if file.show_ads}
|
||||||
<BandwidthUsage/>
|
<BandwidthUsage file={file}/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -4,6 +4,9 @@ import { formatDataVolume } from "../../util/Formatting.svelte";
|
|||||||
import TextBlock from "./TextBlock.svelte";
|
import TextBlock from "./TextBlock.svelte";
|
||||||
import ProgressBar from "../../util/ProgressBar.svelte";
|
import ProgressBar from "../../util/ProgressBar.svelte";
|
||||||
|
|
||||||
|
export let file = {
|
||||||
|
download_speed_limit: 0,
|
||||||
|
}
|
||||||
let limits = {
|
let limits = {
|
||||||
download_limit: 0,
|
download_limit: 0,
|
||||||
download_limit_used: 0,
|
download_limit_used: 0,
|
||||||
@@ -30,18 +33,19 @@ onMount(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if limits.transfer_limit_used > 0}
|
{#if limits.transfer_limit_used > 0}
|
||||||
<TextBlock width="700px" center={true}>
|
<TextBlock width="800px" center={true}>
|
||||||
<p>
|
<p>
|
||||||
You have used {formatDataVolume(limits.transfer_limit_used, 3)} of
|
You have used {formatDataVolume(limits.transfer_limit_used, 3)} of
|
||||||
your daily {formatDataVolume(limits.transfer_limit, 3)} download
|
your daily {formatDataVolume(limits.transfer_limit, 3)} transfer
|
||||||
limit. When the limit is exceeded your download speed will be
|
limit. Your download speed is currently limited to
|
||||||
reduced.
|
{file.download_speed_limit/(1<<20)} MiB/s. When the transfer limit
|
||||||
|
is exceeded your download speed will be reduced.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://www.patreon.com/join/pixeldrain/checkout?rid=5291427&cadence=12">
|
<a href="https://www.patreon.com/join/pixeldrain/checkout?rid=5291427&cadence=12">
|
||||||
Support Pixeldrain on Patreon
|
Support Pixeldrain on Patreon
|
||||||
</a>
|
</a>
|
||||||
to disable the download limit.
|
to disable the transfer and speed limits
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ProgressBar total={limits.transfer_limit} used={limits.transfer_limit_used}></ProgressBar>
|
<ProgressBar total={limits.transfer_limit} used={limits.transfer_limit_used}></ProgressBar>
|
||||||
|
@@ -12,6 +12,7 @@ let file = {
|
|||||||
mime_type: "",
|
mime_type: "",
|
||||||
icon_href: "",
|
icon_href: "",
|
||||||
show_ads: false,
|
show_ads: false,
|
||||||
|
download_speed_limit: 0,
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ let file = {
|
|||||||
|
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
{#if file.show_ads}
|
{#if file.show_ads}
|
||||||
<BandwidthUsage/>
|
<BandwidthUsage file={file}/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@@ -13,6 +13,7 @@ let file = {
|
|||||||
icon_href: "",
|
icon_href: "",
|
||||||
allow_video_player: true,
|
allow_video_player: true,
|
||||||
show_ads: false,
|
show_ads: false,
|
||||||
|
download_speed_limit: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
$: loop = file.name.includes(".loop.")
|
$: loop = file.name.includes(".loop.")
|
||||||
@@ -151,23 +152,26 @@ const fullscreen = () => {
|
|||||||
{:else}
|
{:else}
|
||||||
<h1>{file.name}</h1>
|
<h1>{file.name}</h1>
|
||||||
<img src={file.icon_href} class="video_icon" alt="Video icon">
|
<img src={file.icon_href} class="video_icon" alt="Video icon">
|
||||||
<TextBlock width="600px">
|
<TextBlock width="650px">
|
||||||
The online video player on pixeldrain is only available when the
|
The online video player on pixeldrain is only available for registered
|
||||||
uploader of the file is a Patreon supporter, or if you are a Patreon
|
users, or when the uploader of the video has a Pro account. You can
|
||||||
supporter. You can still download the video and watch it locally on your
|
still download the video and watch it locally on your computer without
|
||||||
computer.
|
an account.
|
||||||
<br/>
|
<br/>
|
||||||
|
<a href="https://www.patreon.com/join/pixeldrain/checkout?rid=5291427&cadence=12" target="_blank" class="button button_highlight">
|
||||||
|
<i class="icon">bolt</i> Get Pixeldrain Pro
|
||||||
|
</a>
|
||||||
<button on:click={download}>
|
<button on:click={download}>
|
||||||
<i class="icon">download</i> Download
|
<i class="icon">download</i> Download
|
||||||
</button>
|
</button>
|
||||||
<a href="https://www.patreon.com/join/pixeldrain/checkout?rid=5291427&cadence=12" class="button button_highlight">
|
<a href="/register" class="button">
|
||||||
<i class="icon">bolt</i> Support Pixeldrain on Patreon
|
<i class="icon">how_to_reg</i> Sign up
|
||||||
</a>
|
</a>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
{#if file.show_ads}
|
{#if file.show_ads}
|
||||||
<BandwidthUsage/>
|
<BandwidthUsage file={file}/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
@@ -494,7 +494,7 @@ const share = () => {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
transition: left 0.5s;
|
transition: left 0.5s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: inset 2px 2px 8px var(--shadow_color);
|
box-shadow: inset 1px 1px 4px -1px var(--shadow_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Toolbar */
|
/* Toolbar */
|
||||||
|
@@ -74,7 +74,7 @@ const node_icon = node => {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 1px 1px 6px 0 var(--shadow_color);
|
box-shadow: 1px 1px 4px -1px var(--shadow_color);
|
||||||
background: var(--input_background);
|
background: var(--input_background);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
@@ -279,7 +279,7 @@ onMount(() => {
|
|||||||
.feat_table > div > .feat_label {
|
.feat_table > div > .feat_label {
|
||||||
border-top-left-radius: 0.5em;
|
border-top-left-radius: 0.5em;
|
||||||
border-bottom-left-radius: 0.5em;
|
border-bottom-left-radius: 0.5em;
|
||||||
background: var(--shaded_background);
|
border: 2px solid var(--separator);
|
||||||
}
|
}
|
||||||
.feat_table > div > .feat_normal {
|
.feat_table > div > .feat_normal {
|
||||||
background-color: var(--card_color);
|
background-color: var(--card_color);
|
||||||
|
@@ -288,14 +288,14 @@ onMount(load_tranfer_used)
|
|||||||
.feat_table > div > .feat_label {
|
.feat_table > div > .feat_label {
|
||||||
border-top-left-radius: 0.5em;
|
border-top-left-radius: 0.5em;
|
||||||
border-bottom-left-radius: 0.5em;
|
border-bottom-left-radius: 0.5em;
|
||||||
background: var(--shaded_background);
|
border: 2px solid var(--separator);
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
.feat_table > div > .feat_normal {
|
.feat_table > div > .feat_normal {
|
||||||
background: var(--card_color);
|
background: var(--card_color);
|
||||||
}
|
}
|
||||||
.feat_table > div > .feat_highlight {
|
.feat_table > div > .feat_highlight {
|
||||||
border: 1px solid var(--highlight_color)
|
border: 2px solid var(--highlight_color)
|
||||||
}
|
}
|
||||||
|
|
||||||
.feat_table > div > div.round_tr { border-top-right-radius: 0.5em; }
|
.feat_table > div > div.round_tr { border-top-right-radius: 0.5em; }
|
||||||
|
@@ -81,7 +81,6 @@ type styleSheet struct {
|
|||||||
BodyBackground Color
|
BodyBackground Color
|
||||||
BodyText hsl
|
BodyText hsl
|
||||||
Separator Color
|
Separator Color
|
||||||
Shaded Color
|
|
||||||
CardColor hsl
|
CardColor hsl
|
||||||
CardText hsl
|
CardText hsl
|
||||||
|
|
||||||
@@ -120,7 +119,6 @@ func (s styleSheet) withDefaults() styleSheet {
|
|||||||
defaultColor(&s.BodyBackground, s.BodyColor)
|
defaultColor(&s.BodyBackground, s.BodyColor)
|
||||||
defaultHSL(&s.BackgroundText, s.BodyText)
|
defaultHSL(&s.BackgroundText, s.BodyText)
|
||||||
defaultColor(&s.Separator, s.BodyColor.Add(0, 0, .05))
|
defaultColor(&s.Separator, s.BodyColor.Add(0, 0, .05))
|
||||||
defaultColor(&s.Shaded, RGBA{0, 0, 0, 0.2})
|
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
@@ -184,7 +182,7 @@ func (s styleSheet) String() string {
|
|||||||
s.BodyBackground.CSS(),
|
s.BodyBackground.CSS(),
|
||||||
s.BodyText.CSS(),
|
s.BodyText.CSS(),
|
||||||
s.Separator.CSS(),
|
s.Separator.CSS(),
|
||||||
s.Shaded.CSS(),
|
s.BodyColor.WithAlpha(0.5).CSS(), // shaded_background
|
||||||
s.CardColor.CSS(),
|
s.CardColor.CSS(),
|
||||||
s.Chart1.CSS(),
|
s.Chart1.CSS(),
|
||||||
s.Chart2.CSS(),
|
s.Chart2.CSS(),
|
||||||
@@ -393,7 +391,6 @@ var nordLightStyle = styleSheet{
|
|||||||
ParallaxSlider: hsl{220, .16, .22}, // nord0 hsl(220, 16%, 22%)
|
ParallaxSlider: hsl{220, .16, .22}, // nord0 hsl(220, 16%, 22%)
|
||||||
BodyColor: hsl{219, .28, .88}, // nord4 hsl(219, 28%, 88%)
|
BodyColor: hsl{219, .28, .88}, // nord4 hsl(219, 28%, 88%)
|
||||||
BodyText: hsl{220, .17, .32}, // nord2 hsl(220, 17%, 32%)
|
BodyText: hsl{220, .17, .32}, // nord2 hsl(220, 17%, 32%)
|
||||||
Shaded: RGBA{255, 255, 255, 0.4},
|
|
||||||
BackgroundPattern: hsl{219, .28, .88}, // hsl(219, 28%, 88%)
|
BackgroundPattern: hsl{219, .28, .88}, // hsl(219, 28%, 88%)
|
||||||
CardColor: hsl{218, .27, .92}, // nord5 hsl(218, 27%, 92%)
|
CardColor: hsl{218, .27, .92}, // nord5 hsl(218, 27%, 92%)
|
||||||
|
|
||||||
@@ -448,7 +445,6 @@ var adwaitaLightStyle = styleSheet{
|
|||||||
BackgroundColor: hsl{0, 0, .92},
|
BackgroundColor: hsl{0, 0, .92},
|
||||||
BodyColor: hsl{0, 0, .98},
|
BodyColor: hsl{0, 0, .98},
|
||||||
BodyText: hsl{0, 0, .2},
|
BodyText: hsl{0, 0, .2},
|
||||||
Shaded: RGBA{0, 0, 0, 0.04},
|
|
||||||
CardColor: hsl{0, 0, 1},
|
CardColor: hsl{0, 0, 1},
|
||||||
|
|
||||||
Shadow: hsl{0, 0, 0.36},
|
Shadow: hsl{0, 0, 0.36},
|
||||||
@@ -485,7 +481,6 @@ var solarizedLightStyle = styleSheet{
|
|||||||
BodyColor: hsl{44, .87, .94}, // hsl(44, 87%, 94%)
|
BodyColor: hsl{44, .87, .94}, // hsl(44, 87%, 94%)
|
||||||
BodyText: hsl{194, .14, .40}, // hsl(194, 14%, 40%)
|
BodyText: hsl{194, .14, .40}, // hsl(194, 14%, 40%)
|
||||||
Separator: RGBA{0, 0, 0, 0.05},
|
Separator: RGBA{0, 0, 0, 0.05},
|
||||||
Shaded: RGBA{255, 255, 255, 0.2},
|
|
||||||
CardColor: hsl{44, .87, .96},
|
CardColor: hsl{44, .87, .96},
|
||||||
|
|
||||||
Shadow: hsl{0, 0, 0.36},
|
Shadow: hsl{0, 0, 0.36},
|
||||||
|
@@ -94,6 +94,22 @@ func (h hsl) Add(hue int, saturation float64, lightness float64) hsl {
|
|||||||
return new
|
return new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h hsl) WithAlpha(alpha float64) HSLA {
|
||||||
|
return HSLA{h, alpha}
|
||||||
|
}
|
||||||
|
|
||||||
|
type HSLA struct {
|
||||||
|
hsl
|
||||||
|
Alpha float64
|
||||||
|
}
|
||||||
|
|
||||||
|
func (hsla HSLA) CSS() string {
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"hsla(%d, %.2f%%, %.2f%%, %.2f)",
|
||||||
|
hsla.Hue, hsla.Saturation*100, hsla.Lightness*100, hsla.Alpha,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
type RGB struct {
|
type RGB struct {
|
||||||
R uint8
|
R uint8
|
||||||
G uint8
|
G uint8
|
||||||
|
Reference in New Issue
Block a user