-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtransformed.out
64 lines (60 loc) · 1.1 KB
/
transformed.out
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
#^App.svelte&^<script>
import { onMount } from 'svelte';
import { get } from 'svelte/store';
import { names, selectedName } from './store.js';
onMount(async () => {
const response = await fetch('/api/names');
const data = await response.json();
names.set(data);
});
function selectName(name) {
selectedName.set(name);
}
</script>
<div class="flex">
<div class="w-1/4 bg-gray-200 p-4">
<h2 class="text-lg font-bold mb-4">Names</h2>
{#each $names as name}
<div class="cursor-pointer mb-2" on:click={() => selectName(name)}>
{name}
</div>
{/each}
</div>
<div class="w-3/4 p-4">
{#if $selectedName}
<NameDetails />
{/if}
</div>
</div>
<style>
.flex {
display: flex;
}
.bg-gray-200 {
background-color: #edf2f7;
}
.p-4 {
padding: 1rem;
}
.text-lg {
font-size: 1.125rem;
}
.font-bold {
font-weight: 700;
}
.mb-4 {
margin-bottom: 1rem;
}
.mb-2 {
margin-bottom: 0.5rem;
}
.cursor-pointer {
cursor: pointer;
}
.w-1/4 {
width: 25%;
}
.w-3/4 {
width: 75%;
}
</style>