añado los rudimentos de form, de preview y las vinculo con una store

pull/2/head
Borja Robert 2 years ago
parent 92e2733961
commit 015172df86

@ -1,4 +1,9 @@
@import '@fontsource/fira-mono'; @import '@fontsource/fira-mono';
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root { :root {
font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,

@ -0,0 +1,34 @@
<script>
import {title} from '$lib/stores/store'
const handleSubmit = async () => {
console.log("submit");
}
</script>
<form on:submit|preventDefault={handleSubmit}>
<label for="title">Título</label>
<input bind:value={$title} type="text" name="title" placeholder="Título">
</form>
<style>
form {
margin: 1rem;
display: block;
}
input {
display: block;
width: 100%;
font-size: 1rem;
font-family: monospace;
padding: 0.5rem;
}
label {
display: block;
font-size: 1.5rem;
margin: 0.5rem 0;
}
</style>

@ -0,0 +1,7 @@
<script>
import {title} from '$lib/stores/store'
</script>
<div class="preview">
{$title}
</div>

@ -0,0 +1,3 @@
import {writable} from 'svelte/store'
export const title = writable("");

@ -8,10 +8,6 @@
<slot /> <slot />
</main> </main>
<footer>
<p><a href="https://dereechoamorir.org">derechoamorir.org</a></p>
</footer>
<style> <style>
main { main {
width: 100%; width: 100%;
@ -20,18 +16,6 @@
box-sizing: border-box; box-sizing: border-box;
} }
footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px;
}
footer a {
font-weight: bold;
}
@media (min-width: 480px) { @media (min-width: 480px) {
footer { footer {
padding: 40px 0; padding: 40px 0;

@ -1,4 +1,6 @@
<script> <script>
import Form from '$lib/form/Form.svelte'
import Preview from '$lib/preview/Preview.svelte'
import Header from '$lib/header/Header.svelte' import Header from '$lib/header/Header.svelte'
</script> </script>
@ -8,16 +10,16 @@
</svelte:head> </svelte:head>
<div class="main"> <div class="main">
<section class="form"> <!-- Form component --></section> <section class="form"><Form /></section>
<section class="preview"> <!-- Preview component --></section> <section class="preview"><Preview /></section>
</div> </div>
<style> <style>
.main { .main {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 2fr 3fr;
grid-gap: 0.5rem; grid-gap: 0.5rem;
min-height: calc(100vh - 4rem); min-height: calc(100vh - 5rem);
} }
.form { .form {
grid-column: 1/2; grid-column: 1/2;

Loading…
Cancel
Save