diff --git a/src/lib/form/Colabs.svelte b/src/lib/form/Colabs.svelte
new file mode 100644
index 0000000..e1ed355
--- /dev/null
+++ b/src/lib/form/Colabs.svelte
@@ -0,0 +1,110 @@
+
+
+
+ {#if $colabs[0]}
+ {#each $colabs as organization, i}
+
+
{
+ removecolabs(i);
+ }}
+ >
+ x
+
+
+
+
+ {/each}
+ {/if}
+
+
+
+ onFileSelected(e)}
+ bind:this={fileinput}
+/>
+
+
diff --git a/src/lib/form/Form.svelte b/src/lib/form/Form.svelte
index e2d32ee..16d5110 100644
--- a/src/lib/form/Form.svelte
+++ b/src/lib/form/Form.svelte
@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import html2canvas from 'html2canvas';
import Organized from '$lib/form/Organized.svelte';
+ import Colabs from './Colabs.svelte';
import {
title,
heading,
@@ -10,7 +11,7 @@
date,
address,
organizedBy,
- collabs,
+ colabs,
canvas
} from '$lib/stores/store';
@@ -26,12 +27,14 @@
console.log('no hay editor');
return;
}
- $content = editor.firstChild.innerHTML;
+ if (editor && editor.firstChild !== null) {
+ $content = editor.firstChild.innerHTML;
+ }
};
const downloadCanvas = async () => {
if ($canvas !== undefined) {
- const res = await html2canvas($canvas);
+ const res = await html2canvas($canvas, { backgroundColor: '#fffffff' });
const image = await res.toDataURL('image/png');
const link = document.createElement('a');
link.download = 'cartel.png';
@@ -95,6 +98,8 @@
+
+
@@ -134,13 +139,4 @@
font-size: 1.1rem;
cursor: pointer;
}
-
- .upload {
- max-width: 48px;
- cursor: pointer;
- }
-
- .chan {
- cursor: pointer;
- }
diff --git a/src/lib/form/Organized.svelte b/src/lib/form/Organized.svelte
index 66c2412..896acc5 100644
--- a/src/lib/form/Organized.svelte
+++ b/src/lib/form/Organized.svelte
@@ -7,13 +7,13 @@
date,
address,
organizedBy,
- collabs,
+ colabs,
canvas
} from '$lib/stores/store';
- let fileinput, avatar;
+ /** @type {HTMLInputElement} */ let fileinput;
- const onFileSelected = (e) => {
+ const onFileSelected = (/** @type {Event} */ e) => {
let image = e.target.files[0];
let reader = new FileReader();
reader.readAsDataURL(image);
@@ -22,7 +22,7 @@
};
};
- const removeOrganizer = (index) => {
+ const removeOrganizer = (/** @type {number} */ index) => {
if (index > -1) {
$organizedBy.splice(index, 1);
$organizedBy = $organizedBy;
@@ -65,7 +65,7 @@
diff --git a/src/lib/stores/store.js b/src/lib/stores/store.js
index 0b73f46..cb3a652 100644
--- a/src/lib/stores/store.js
+++ b/src/lib/stores/store.js
@@ -7,5 +7,5 @@ export const content = writable("");
export const date = writable("");
export const address = writable("");
export const organizedBy = writable([]);
-export const collabs = writable([]);
+export const colabs = writable([]);
export const canvas = writable();
diff --git a/src/routes/todos/+page.svelte b/src/routes/todos/+page.svelte
index adcbe22..992427a 100644
--- a/src/routes/todos/+page.svelte
+++ b/src/routes/todos/+page.svelte
@@ -89,7 +89,6 @@
}
input:focus-visible {
- box-shadow: inset 1px 1px 6px rgba(0, 0, 0, 0.1);
border: 1px solid #ff3e00 !important;
outline: none;
}