Remove excess divs and styles

This commit is contained in:
2022-01-17 14:10:50 +01:00
parent deba5060a9
commit 7777bf3810
10 changed files with 97 additions and 126 deletions

View File

@@ -671,7 +671,7 @@ const keyboard_event = evt => {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
transition: left 0.5s, right 0.5s; transition: left 0.5s, right 0.5s;
overflow: hidden; overflow: auto;
box-shadow: inset 2px 2px 10px 2px var(--shadow_color); box-shadow: inset 2px 2px 10px 2px var(--shadow_color);
border-radius: 16px; border-radius: 16px;
} }

View File

@@ -8,6 +8,7 @@ let file = {
} }
</script> </script>
<br/>
<div class="container"> <div class="container">
<h1>Unavailable for legal reasons</h1> <h1>Unavailable for legal reasons</h1>
<p> <p>
@@ -20,11 +21,10 @@ let file = {
<style> <style>
.container { .container {
position: relative; display: inline-block;
display: block; max-width: 100%;
height: 100%; background-color: rgba(0, 0, 0, 0.3);
width: 100%; border-radius: 16px;
text-align: center; padding: 8px;
overflow: hidden;
} }
</style> </style>

View File

@@ -93,11 +93,9 @@ const toggle_play = () => playing ? player.pause() : player.play()
<style> <style>
.container { .container {
height: 100%;
width: 100%; width: 100%;
margin: 50px 0 0 0; margin: 50px 0 0 0;
padding: 0; padding: 0;
overflow-y: auto;
text-align: center; text-align: center;
} }
.player { .player {

View File

@@ -14,10 +14,9 @@ let file = {
} }
</script> </script>
<div class="container"> <h1>You are viewing a file on pixeldrain</h1>
<h1>You are viewing a file on pixeldrain</h1> <img src={file.icon_href} alt="File icon" class="icon">
<img src={file.icon_href} alt="File icon" class="icon"> <div class="description">
<div class="description">
Name: {file.name}<br/> Name: {file.name}<br/>
Type: {file.mime_type}<br/> Type: {file.mime_type}<br/>
No preview is available for this file type. Download to view it locally. No preview is available for this file type. Download to view it locally.
@@ -26,10 +25,9 @@ let file = {
<i class="icon">save</i> <i class="icon">save</i>
<span>Download</span> <span>Download</span>
</button> </button>
</div>
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
</div> </div>
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
<style> <style>
.icon { .icon {
@@ -46,12 +44,4 @@ let file = {
border-radius: 16px; border-radius: 16px;
padding: 8px; padding: 8px;
} }
.container {
position: relative;
display: block;
height: 100%;
width: 100%;
text-align: center;
overflow: hidden;
}
</style> </style>

View File

@@ -1,6 +1,5 @@
<script> <script>
import { createEventDispatcher, tick } from "svelte"; import { createEventDispatcher, tick } from "svelte";
import Spinner from "../../util/Spinner.svelte"; import Spinner from "../../util/Spinner.svelte";
import Video from "./Video.svelte"; import Video from "./Video.svelte";
import Audio from "./Audio.svelte"; import Audio from "./Audio.svelte";
@@ -43,42 +42,38 @@ const loading = e => {dispatch("loading", e.detail)}
</script> </script>
<div class="file_container"> {#if viewer_type === "loading"}
{#if viewer_type === "loading"} <div class="center">
<div class="center" style="width: 100px; height: 100px;">
<Spinner></Spinner> <Spinner></Spinner>
</div> </div>
{:else if viewer_type === "abuse"} {:else if viewer_type === "abuse"}
<Abuse bind:this={viewer}></Abuse> <Abuse bind:this={viewer}></Abuse>
{:else if viewer_type === "rate_limit"} {:else if viewer_type === "rate_limit"}
<RateLimit bind:this={viewer} on:download={download}></RateLimit> <RateLimit bind:this={viewer} on:download={download}></RateLimit>
{:else if viewer_type === "image"} {:else if viewer_type === "image"}
<Image bind:this={viewer} on:loading={loading}></Image> <Image bind:this={viewer} on:loading={loading}></Image>
{:else if viewer_type === "video"} {:else if viewer_type === "video"}
<Video bind:this={viewer} on:loading={loading} on:download={download} on:prev={prev} on:next={next}></Video> <Video bind:this={viewer} on:loading={loading} on:download={download} on:prev={prev} on:next={next}></Video>
{:else if viewer_type === "audio"} {:else if viewer_type === "audio"}
<Audio bind:this={viewer} on:loading={loading} on:prev={prev} on:next={next}></Audio> <Audio bind:this={viewer} on:loading={loading} on:prev={prev} on:next={next}></Audio>
{:else if viewer_type === "pdf"} {:else if viewer_type === "pdf"}
<PDF bind:this={viewer}></PDF> <PDF bind:this={viewer}></PDF>
{:else if viewer_type === "text"} {:else if viewer_type === "text"}
<Text bind:this={viewer}></Text> <Text bind:this={viewer}></Text>
{:else if viewer_type === "torrent"} {:else if viewer_type === "torrent"}
<Torrent bind:this={viewer} on:loading={loading} on:download={download}></Torrent> <Torrent bind:this={viewer} on:loading={loading} on:download={download}></Torrent>
{:else if viewer_type === "file"} {:else if viewer_type === "file"}
<File bind:this={viewer} on:download={download}></File> <File bind:this={viewer} on:download={download}></File>
{/if} {/if}
</div>
<style> <style>
.file_container {
width: 100%;
height: 100%;
}
.center{ .center{
position: relative; position: relative;
display: block; display: block;
margin: auto; margin: auto;
width: 100px;
max-width: 100%; max-width: 100%;
height: 100px;
max-height: 100%; max-height: 100%;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);

View File

@@ -67,7 +67,6 @@ const mouseup = (e) => {
<style> <style>
.container { .container {
position: relative;
display: block; display: block;
height: 100%; height: 100%;
width: 100%; width: 100%;

View File

@@ -27,7 +27,6 @@ export let file = {
.description { .description {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
padding-left: 8px;
vertical-align: middle; vertical-align: middle;
max-width: 700px; max-width: 700px;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);

View File

@@ -1,5 +1,6 @@
<script> <script>
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import LargeFileMessage from "./LargeFileMessage.svelte";
let dispatch = createEventDispatcher() let dispatch = createEventDispatcher()
export const set_file = f => file = f export const set_file = f => file = f
@@ -54,6 +55,8 @@ let file = {
</a> </a>
</div> </div>
</div> </div>
<br/><br/>
<LargeFileMessage file={file}></LargeFileMessage>
<style> <style>
.container { .container {
@@ -61,9 +64,7 @@ let file = {
display: inline-block; display: inline-block;
width: 800px; width: 800px;
max-width: 100%; max-width: 100%;
max-height: 100%;
text-align: center; text-align: center;
overflow: auto;
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(0, 0, 0, 0.2);
border-radius: 16px; border-radius: 16px;
text-align: left; text-align: left;

View File

@@ -77,10 +77,9 @@ const copy_magnet = () => {
} }
</script> </script>
<div class="container"> <h1>{file.name}</h1>
<h1>{file.name}</h1> <img src={file.icon_href} alt="File icon" class="icon">
<img src={file.icon_href} alt="File icon" class="icon"> <div class="description" style="max-width: 650px">
<div class="description" style="max-width: 650px">
{#if status === "finished"} {#if status === "finished"}
Created by: {torrent.created_by}<br/> Created by: {torrent.created_by}<br/>
Comment: {torrent.comment}<br/> Comment: {torrent.comment}<br/>
@@ -121,16 +120,15 @@ const copy_magnet = () => {
<i class="icon">download</i> <i class="icon">download</i>
<span>Download torrent file</span> <span>Download torrent file</span>
</button> </button>
</div> </div>
{#if status === "finished"} {#if status === "finished"}
<br/> <br/>
<br/> <br/>
<div class="description"> <div class="description">
<h2>Files in this torrent</h2> <h2>Files in this torrent</h2>
<TorrentItem item={torrent.files} /> <TorrentItem item={torrent.files} />
</div> </div>
{/if} {/if}
</div>
<style> <style>
.icon { .icon {
@@ -147,12 +145,4 @@ const copy_magnet = () => {
border-radius: 16px; border-radius: 16px;
padding: 8px; padding: 8px;
} }
.container {
position: relative;
display: block;
height: 100%;
width: 100%;
text-align: center;
overflow: auto;
}
</style> </style>

View File

@@ -95,7 +95,6 @@ let download = () => { dispatch("download", {}) }
<style> <style>
.container{ .container{
position: relative;
display: block; display: block;
height: 100%; height: 100%;
width: 100%; width: 100%;