-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
90 lines (77 loc) · 2.04 KB
/
Copy pathindex.html
File metadata and controls
90 lines (77 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>mita-dom - Dev Playground</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
background-color: #0a0a0a;
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
margin: 0;
padding: 2rem;
}
h1 {
color: #00e676;
margin-bottom: 1rem;
text-align: center;
}
nav {
margin-bottom: 2rem;
display: flex;
gap: 1rem;
}
nav a {
color: #ffab00;
text-decoration: none;
font-weight: bold;
padding: 0.5rem 1rem;
border: 1px solid #ffab00;
border-radius: 8px;
transition: background 0.2s;
}
nav a:hover {
background: rgba(255, 171, 0, 0.1);
}
.container {
display: flex;
gap: 2rem;
flex-wrap: wrap;
width: 100%;
max-width: 1000px;
justify-content: center;
}
</style>
</head>
<body>
<h1>mita-dom Playground</h1>
<!-- Enlaces normales, la Navigation API los interceptará automáticamente -->
<nav>
<a href="/">Inicio (Tarjetas)</a>
<a href="/perfil">Ver Perfil (Fetch & SPA)</a>
</nav>
<div id="vista-inicio" class="container">
<mita-tarjeta></mita-tarjeta>
<mita-tarjeta></mita-tarjeta>
</div>
<!-- El componente maneja internamente su ocultamiento al escuchar la ruta -->
<mita-perfil></mita-perfil>
<!-- Cargamos todo e implementamos la vista inicio modularmente -->
<script type="module">
import { rutaActual } from '/src/index.js';
// La vista de inicio es un simple div, así que usamos el Signal exportado para ocultarlo
const $inicio = document.getElementById('vista-inicio');
rutaActual.suscribir(ruta => {
if ($inicio) {
// Escondemos las tarjetas si no estamos en la raíz
$inicio.style.display = (ruta === '/') ? 'flex' : 'none';
}
});
</script>
</body>
</html>