- {#each $colabs as organization, i}
+ {#each $colabs as organization}
{organization.text}
@@ -96,5 +95,104 @@
diff --git a/src/lib/templates/Address.svelte b/src/lib/templates/Address.svelte
new file mode 100644
index 0000000..fc62f5e
--- /dev/null
+++ b/src/lib/templates/Address.svelte
@@ -0,0 +1,38 @@
+
+
+{#if templates[templateIndex] && $address}
+
+ {$address}
+
+{/if}
+
+
diff --git a/src/lib/templates/Content.svelte b/src/lib/templates/Content.svelte
new file mode 100644
index 0000000..6bba7f0
--- /dev/null
+++ b/src/lib/templates/Content.svelte
@@ -0,0 +1,36 @@
+
+
+{#if templates[templateIndex] && $content}
+
+ {@html $content}
+
+{/if}
+
+
diff --git a/src/lib/templates/Date.svelte b/src/lib/templates/Date.svelte
new file mode 100644
index 0000000..aab284b
--- /dev/null
+++ b/src/lib/templates/Date.svelte
@@ -0,0 +1,90 @@
+
+
+{#if templates[templateIndex] && newdate.date}
+
+ {newdate.date}
+
+{/if}
+{#if templates[templateIndex] && newdate.time}
+
+ {newdate.time}
+
+{/if}
+
+
diff --git a/src/lib/templates/Subtitle.svelte b/src/lib/templates/Subtitle.svelte
new file mode 100644
index 0000000..6c565e4
--- /dev/null
+++ b/src/lib/templates/Subtitle.svelte
@@ -0,0 +1,37 @@
+
+
+{#if templates[templateIndex] && $subtitle}
+
+ {$subtitle}
+
+{/if}
+
+
diff --git a/src/lib/templates/Template.svelte b/src/lib/templates/Template.svelte
deleted file mode 100644
index 49f5fcd..0000000
--- a/src/lib/templates/Template.svelte
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/src/lib/templates/Title.svelte b/src/lib/templates/Title.svelte
new file mode 100644
index 0000000..b47aa14
--- /dev/null
+++ b/src/lib/templates/Title.svelte
@@ -0,0 +1,38 @@
+
+
+{#if templates[templateIndex] && $title}
+
+ {$title}
+
+{/if}
+
+
diff --git a/src/lib/templates/Weekday.svelte b/src/lib/templates/Weekday.svelte
new file mode 100644
index 0000000..169cd6b
--- /dev/null
+++ b/src/lib/templates/Weekday.svelte
@@ -0,0 +1,34 @@
+
+
+{#if templates[templateIndex] && $weekday}
+
+ {$weekday}
+
+{/if}
+
+
diff --git a/src/lib/templates/azul.js b/src/lib/templates/azul.js
new file mode 100644
index 0000000..a7ec8ce
--- /dev/null
+++ b/src/lib/templates/azul.js
@@ -0,0 +1,104 @@
+import '$lib/templates/templates'
+
+/** @type {import('$lib/templates/templates').Template} */
+export const azul = {
+ name: "azul",
+ image: "azul.png",
+ heading: {
+ top: 440,
+ height: 2,
+ left: 10,
+ right: 1,
+ fontSize: 2,
+ color: "white",
+ fontFamily: "sans-serif",
+ lineHeight: 2,
+ textAlign: "right",
+ fontWeight: 700
+ },
+ title: {
+ top: 487,
+ height: 7.5,
+ left: 1,
+ right: 1,
+ fontSize: 3,
+ color: "firebrick",
+ fontFamily: "sans-serif",
+ lineHeight: 2.4,
+ textAlign: "right",
+ fontWeight: 700
+
+ },
+ subtitle: {
+ top: 620,
+ height: 1.4,
+ left: 1,
+ right: 2,
+ fontSize: 1.6,
+ color: "white",
+ fontFamily: "Gill Sans, sans-serif",
+ lineHeight: 1.5,
+ textAlign: "center",
+ fontWeight: 400
+ },
+ content: {
+ top: 480,
+ height: 8.5,
+ left: 1.5,
+ right: 17,
+ fontSize: 0,
+ color: "#222",
+ fontFamily: "sans-serif",
+ lineHeight: 1.1,
+ textAlign: "left",
+ fontWeight: 700
+ },
+ date: {
+ top: 25,
+ height: 4,
+ left: 5,
+ right: 1,
+ fontSize: 1.1,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 1,
+ textAlign: "right",
+ fontWeight: 700
+ },
+ time: {
+ top: 65,
+ height: 2,
+ left: 18.5,
+ right: 1,
+ fontSize: 1.8,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 2,
+ textAlign: "right",
+ fontWeight: 700
+ },
+ weekday: {
+ top: 25,
+ height: 1.5,
+ left: 1,
+ right: 10,
+ fontSize: 1.3,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 1.8,
+ textAlign: "left",
+ fontWeight: 700
+ },
+ address: {
+ top: 660,
+ height: 5.5,
+ left: 2,
+ right: 2,
+ fontSize: 1.2,
+ color: "white",
+ fontFamily: "sans-serif",
+ lineHeight: 1.8,
+ textAlign: "left",
+ fontWeight: 400
+ },
+}
\ No newline at end of file
diff --git a/src/lib/templates/heading.svelte b/src/lib/templates/heading.svelte
new file mode 100644
index 0000000..3a4d0e7
--- /dev/null
+++ b/src/lib/templates/heading.svelte
@@ -0,0 +1,34 @@
+
+
+{#if $heading && templates[templateIndex].heading}
+
+ {$heading}
+
+{/if}
+
+
diff --git a/src/lib/templates/templates.js b/src/lib/templates/templates.js
new file mode 100644
index 0000000..52d4954
--- /dev/null
+++ b/src/lib/templates/templates.js
@@ -0,0 +1,36 @@
+import { verde } from '$lib/templates/verde';
+import { azul } from '$lib/templates/azul';
+/**
+* @typedef {{
+* top: number;
+* height: number;
+* right: number;
+* left: number;
+* color: string;
+* fontSize: number;
+* fontFamily: string;
+* lineHeight: number;
+* textAlign: string;
+* fontWeight: number;
+* }} Element
+*/
+
+/**
+* @typedef {{
+* name: string;
+* image: string;
+* heading: Element;
+* title: Element;
+* subtitle: Element;
+* date: Element;
+* time: Element;
+* weekday: Element;
+* content: Element;
+* address: Element;
+* }} Template
+*/
+
+/** @type Array
*/
+export const templates = [];
+templates.push(verde);
+templates.push(azul);
diff --git a/src/lib/templates/verde.js b/src/lib/templates/verde.js
new file mode 100644
index 0000000..e28133a
--- /dev/null
+++ b/src/lib/templates/verde.js
@@ -0,0 +1,103 @@
+import '$lib/templates/templates'
+
+/** @type {import('$lib/templates/templates').Template} */
+export const verde = {
+ name: "verde",
+ image: "imagen01.png",
+ heading: {
+ top: 300,
+ height: 1.2,
+ left: 1,
+ right: 1,
+ fontSize: 1,
+ color: "grey",
+ fontFamily: "sans-serif",
+ lineHeight: 1.1,
+ textAlign: "left",
+ fontWeight: 400
+ },
+ title: {
+ top: 320,
+ height: 6,
+ left: 1,
+ right: 1,
+ fontSize: 2.9,
+ color: "firebrick",
+ fontFamily: "Gill Sans, sans-serif",
+ lineHeight: 2.1,
+ textAlign: "center",
+ fontWeight: 400
+ },
+ subtitle: {
+ top: 420,
+ height: 3,
+ left: 1,
+ right: 2,
+ fontSize: 1.4,
+ color: "#787",
+ fontFamily: "Gill Sans, sans-serif",
+ lineHeight: 1.5,
+ textAlign: "center",
+ fontWeight: 400
+ },
+ content: {
+ top: 480,
+ height: 8.5,
+ left: 1.5,
+ right: 17,
+ fontSize: 0.8,
+ color: "#222",
+ fontFamily: "sans-serif",
+ lineHeight: 1.1,
+ textAlign: "left",
+ fontWeight: 400
+ },
+ date: {
+ top: 625,
+ height: 1,
+ left: 18.5,
+ right: 4,
+ fontSize: 1.1,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 1,
+ textAlign: "center",
+ fontWeight: 700
+ },
+ time: {
+ top: 647,
+ height: 2,
+ left: 18.5,
+ right: 5,
+ fontSize: 1.8,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 1.5,
+ textAlign: "center",
+ fontWeight: 700
+ },
+ weekday: {
+ top: 600,
+ height: 1.5,
+ left: 18.5,
+ right: 5,
+ fontSize: 1.3,
+ color: "#fff",
+ fontFamily: "sans-serif",
+ lineHeight: 1.8,
+ textAlign: "center",
+ fontWeight: 700
+ },
+ address: {
+ top: 625,
+ height: 4.5,
+ left: 2,
+ right: 20,
+ fontSize: 1,
+ color: "firebrick",
+ fontFamily: "sans-serif",
+ lineHeight: 1.5,
+ textAlign: "center",
+ fontWeight: 700
+ },
+}
\ No newline at end of file
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 8954221..70c9107 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,8 +1,5 @@
@@ -12,28 +9,57 @@
content="Aplicación para la generación automática de carteles de actividades de DMD"
/>
-
-
+
+ Elige la plantilla que quieras usar para tu diseño
+
+
diff --git a/src/routes/[slug]/+error.svelte b/src/routes/[slug]/+error.svelte
new file mode 100644
index 0000000..d19e1de
--- /dev/null
+++ b/src/routes/[slug]/+error.svelte
@@ -0,0 +1,14 @@
+
+
+{#if $page.error}
+ {$page.status}: {$page.error.message}
+{/if}
+
+
diff --git a/src/routes/[slug]/+page.js b/src/routes/[slug]/+page.js
new file mode 100644
index 0000000..54b2ce7
--- /dev/null
+++ b/src/routes/[slug]/+page.js
@@ -0,0 +1,21 @@
+import { error } from '@sveltejs/kit';
+import { templates } from '$lib/templates/templates';
+
+/** @type {import('./$types').PageLoad} */
+export function load(event) {
+
+ /** @type {string} */
+ const slug = event.params.slug;
+
+ /** @type {number} */ const templateIndex = templates.map((e) => e.name).indexOf(slug);
+ /** @type {string} */ const templateImage = templates[templateIndex].image;
+ if (templateIndex !== -1) {
+ return {
+ slug,
+ templateIndex,
+ templateImage
+ }
+ }
+
+ throw error(404, "Not found");
+}
diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte
new file mode 100644
index 0000000..5c127ed
--- /dev/null
+++ b/src/routes/[slug]/+page.svelte
@@ -0,0 +1,53 @@
+
+
+
+ Carteles DMD - Plantilla {data.slug}
+
+
+
+
+
+ {#if templateIndex !== undefined}
+
+ {/if}
+
+
+
diff --git a/static/azul.png b/static/azul.png
new file mode 100644
index 0000000..092f5d1
Binary files /dev/null and b/static/azul.png differ