Refactor CanvasCard to CardList
This commit is contained in:
parent
46c3fe3354
commit
70edf6f11e
3 changed files with 43 additions and 43 deletions
18
src/app.css
18
src/app.css
|
@ -30,3 +30,21 @@ body {
|
|||
background-color: #F2F6F5;
|
||||
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;
|
||||
}
|
|
@ -5,16 +5,26 @@
|
|||
let canvasRefs = [];
|
||||
</script>
|
||||
|
||||
{#each Array.from(files) as file, i}
|
||||
<div class="container">
|
||||
<div id="container" style="width: 100%; heigth: 100vh;">
|
||||
{#each Array.from(files) as file, i}
|
||||
<div class="canvas-container">
|
||||
<canvas bind:this={canvasRefs[i]} class="canvas" />
|
||||
<p>{file.name}</p>
|
||||
</div>
|
||||
{canvasRefs[i] && startFileRead(file, canvasRefs[i])}
|
||||
{/each}
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
#container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-evenly;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
@ -33,9 +43,13 @@
|
|||
}
|
||||
|
||||
@media only screen and (max-device-width: 812px) {
|
||||
.container {
|
||||
.canvas-container {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import CanvasCard from "./CanvasCard.svelte";
|
||||
import CardList from "./CardList.svelte";
|
||||
|
||||
let files;
|
||||
let filesRendered = false;
|
||||
|
@ -94,30 +94,10 @@
|
|||
{/if}
|
||||
|
||||
{#if files && files.length !== 0 && filesRendered}
|
||||
<div id="canvas-container" style="width: 100%; heigth: 100vh;">
|
||||
<CanvasCard {files} />
|
||||
</div>
|
||||
<CardList {files} />
|
||||
{/if}
|
||||
|
||||
<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 {
|
||||
display: flex;
|
||||
height: 100px;
|
||||
|
@ -143,14 +123,6 @@
|
|||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#canvas-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-evenly;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
#dropzone:hover {
|
||||
cursor: pointer;
|
||||
border: 5px dotted #05345f;
|
||||
|
@ -173,9 +145,5 @@
|
|||
#selected-file-card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#canvas-container {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue