Refactor CanvasCard to CardList

This commit is contained in:
Leonardo Murça 2022-11-18 11:56:45 -03:00
parent 46c3fe3354
commit 70edf6f11e
3 changed files with 43 additions and 43 deletions

View file

@ -30,3 +30,21 @@ body {
background-color: #F2F6F5; background-color: #F2F6F5;
z-index: 10; z-index: 10;
} }
input[type="submit"] {
width: 100%;
font-size: 20px;
margin-top: 20px;
background-color: #05345f;
font-weight: 700;
color: white;
padding: 10px;
-webkit-appearance: none;
border-radius: 0;
}
input[type="submit"]:hover {
cursor: pointer;
background-color: black;
color: white;
}

View file

@ -5,16 +5,26 @@
let canvasRefs = []; let canvasRefs = [];
</script> </script>
{#each Array.from(files) as file, i} <div id="container" style="width: 100%; heigth: 100vh;">
<div class="container"> {#each Array.from(files) as file, i}
<canvas bind:this={canvasRefs[i]} class="canvas" /> <div class="canvas-container">
<p>{file.name}</p> <canvas bind:this={canvasRefs[i]} class="canvas" />
</div> <p>{file.name}</p>
{canvasRefs[i] && startFileRead(file, canvasRefs[i])} </div>
{/each} {canvasRefs[i] && startFileRead(file, canvasRefs[i])}
{/each}
</div>
<style> <style>
.container { #container {
display: flex;
width: 100%;
justify-content: space-evenly;
flex-wrap: wrap;
margin-top: 50px;
}
.canvas-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -33,9 +43,13 @@
} }
@media only screen and (max-device-width: 812px) { @media only screen and (max-device-width: 812px) {
.container { .canvas-container {
width: 100%; width: 100%;
height: 400px; height: 400px;
} }
#container {
width: 100%;
}
} }
</style> </style>

View file

@ -1,5 +1,5 @@
<script> <script>
import CanvasCard from "./CanvasCard.svelte"; import CardList from "./CardList.svelte";
let files; let files;
let filesRendered = false; let filesRendered = false;
@ -94,30 +94,10 @@
{/if} {/if}
{#if files && files.length !== 0 && filesRendered} {#if files && files.length !== 0 && filesRendered}
<div id="canvas-container" style="width: 100%; heigth: 100vh;"> <CardList {files} />
<CanvasCard {files} />
</div>
{/if} {/if}
<style> <style>
input[type="submit"] {
width: 100%;
font-size: 20px;
margin-top: 20px;
background-color: #05345f;
font-weight: 700;
color: white;
padding: 10px;
-webkit-appearance: none;
border-radius: 0;
}
input[type="submit"]:hover {
cursor: pointer;
background-color: black;
color: white;
}
#dropzone { #dropzone {
display: flex; display: flex;
height: 100px; height: 100px;
@ -143,14 +123,6 @@
margin-top: 10px; margin-top: 10px;
} }
#canvas-container {
display: flex;
width: 100%;
justify-content: space-evenly;
flex-wrap: wrap;
margin-top: 50px;
}
#dropzone:hover { #dropzone:hover {
cursor: pointer; cursor: pointer;
border: 5px dotted #05345f; border: 5px dotted #05345f;
@ -173,9 +145,5 @@
#selected-file-card { #selected-file-card {
width: 100%; width: 100%;
} }
#canvas-container {
width: 100%;
}
} }
</style> </style>