separa la aplicación en dos mitades

pull/2/head
Borja Robert 2 years ago
parent 3bd2f3f51e
commit 92e2733961

2
.gitignore vendored

@ -8,3 +8,5 @@ node_modules
!.env.example !.env.example
.vercel .vercel
.output .output
*.swp
*/*.swp

@ -1,126 +1,19 @@
<script>
import { page } from '$app/stores';
import logo from './svelte-logo.svg';
</script>
<header> <header>
<div class="corner"> <h1>Cartelería DMD</h1>
<a href="https://kit.svelte.dev">
<img src={logo} alt="SvelteKit" />
</a>
</div>
<nav data-sveltekit-prefetch>
<svg viewBox="0 0 2 3" aria-hidden="true">
<path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" />
</svg>
<ul>
<li class:active={$page.url.pathname === '/'}>
<a href="/">Home</a>
</li>
<li class:active={$page.url.pathname === '/about'}>
<a href="/about">About</a>
</li>
<li class:active={$page.url.pathname === '/todos'}>
<a href="/todos">Todos</a>
</li>
</ul>
<svg viewBox="0 0 2 3" aria-hidden="true">
<path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" />
</svg>
</nav>
<div class="corner">
<!-- TODO put something else here? github link? -->
</div>
</header> </header>
<style> <style>
header { header {
display: flex; max-height: 4rem;
justify-content: space-between; margin: 0;
} padding: 0.5rem;
}
.corner { h1 {
width: 3em; font-size: 2rem;
height: 3em; font-weight: 500;
} color: firebrick;
font-family: 'Gill Sans', sans-serif;
.corner a { font-variant: small-caps;
display: flex; }
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.corner img {
width: 2em;
height: 2em;
object-fit: contain;
}
nav {
display: flex;
justify-content: center;
--background: rgba(255, 255, 255, 0.7);
}
svg {
width: 2em;
height: 3em;
display: block;
}
path {
fill: var(--background);
}
ul {
position: relative;
padding: 0;
margin: 0;
height: 3em;
display: flex;
justify-content: center;
align-items: center;
list-style: none;
background: var(--background);
background-size: contain;
}
li {
position: relative;
height: 100%;
}
li.active::before {
--size: 6px;
content: '';
width: 0;
height: 0;
position: absolute;
top: 0;
left: calc(50% - var(--size));
border: var(--size) solid transparent;
border-top: var(--size) solid var(--accent-color);
}
nav a {
display: flex;
height: 100%;
align-items: center;
padding: 0 1em;
color: var(--heading-color);
font-weight: 700;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.1em;
text-decoration: none;
transition: color 0.2s linear;
}
a:hover {
color: var(--accent-color);
}
</style> </style>

@ -1,45 +1,40 @@
<script> <script>
import Header from '$lib/header/Header.svelte'; import Header from '$lib/header/Header.svelte';
import '../app.css'; import '../app.css';
</script> </script>
<Header /> <Header />
<main> <main>
<slot /> <slot />
</main> </main>
<footer> <footer>
<p>visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to learn SvelteKit</p> <p><a href="https://dereechoamorir.org">derechoamorir.org</a></p>
</footer> </footer>
<style> <style>
main { main {
flex: 1; width: 100%;
display: flex; padding: 0;
flex-direction: column; margin: 0 auto;
padding: 1rem; box-sizing: border-box;
width: 100%; }
max-width: 1024px;
margin: 0 auto;
box-sizing: border-box;
}
footer { footer {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 40px; padding: 40px;
} }
footer a { footer a {
font-weight: bold; font-weight: bold;
} }
@media (min-width: 480px) { @media (min-width: 480px) {
footer { footer {
padding: 40px 0; padding: 40px 0;
}
} }
}
</style> </style>

@ -1,57 +1,51 @@
<script> <script>
import Counter from '$lib/Counter.svelte'; import Header from '$lib/header/Header.svelte'
</script> </script>
<svelte:head> <svelte:head>
<title>Home</title> <title>Home</title>
<meta name="description" content="Svelte demo app" /> <meta name="description" content="Svelte demo app" />
</svelte:head> </svelte:head>
<section> <div class="main">
<h1> <section class="form"> <!-- Form component --></section>
<span class="welcome"> <section class="preview"> <!-- Preview component --></section>
<picture> </div>
<source srcset="svelte-welcome.webp" type="image/webp" />
<img src="svelte-welcome.png" alt="Welcome" />
</picture>
</span>
to your new<br />SvelteKit app
</h1>
<h2>
try editing <strong>src/routes/+page.svelte</strong>
</h2>
<Counter />
</section>
<style> <style>
section { .main {
display: flex; display: grid;
flex-direction: column; grid-template-columns: 1fr 1fr;
justify-content: center; grid-gap: 0.5rem;
align-items: center; min-height: calc(100vh - 4rem);
flex: 1; }
} .form {
grid-column: 1/2;
h1 { background-color: rgb(230,240,240);
width: 100%; }
}
.preview {
.welcome { grid-column: 2/3;
display: block; min-height: 200px;
position: relative; background-color: rgb(240,238,240);
width: 100%; }
height: 0; h1 {
padding: 0 0 calc(100% * 495 / 2048) 0; width: 100%;
} }
.welcome img { .welcome {
position: absolute; display: block;
width: 100%; position: relative;
height: 100%; width: 100%;
top: 0; height: 0;
display: block; padding: 0 0 calc(100% * 495 / 2048) 0;
} }
.welcome img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
display: block;
}
</style> </style>

Loading…
Cancel
Save