-
Notifications
You must be signed in to change notification settings - Fork 0
/
WrEntryGroup.svelte
89 lines (76 loc) · 1.53 KB
/
WrEntryGroup.svelte
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
<script>
export let entries;
</script>
{#each entries as entry}
<div class="entry">
<div class="source-column">
<div class="source-form">{entry.sourceForm}</div>
{#if entry.sense}
<div class="sense">
{#if entry.sense.note}
<span class="sense-note">{entry.sense.note}</span>
{/if}
({entry.sense.sense})
</div>
{/if}
</div>
<div class="target-column">
{#each entry.translations as translation}
<div class="translation-row">
<div class="note">
{#if translation.note}({translation.note}){/if}
</div>
<div class="translation">{translation.translation}</div>
</div>
{/each}
</div>
</div>
{/each}
<style>
.entry {
display: flex;
}
.entry:first-child {
margin-top: 0.5rem;
}
.entry:not(:last-child) {
margin-bottom: 0.75rem;
padding-bottom: 0.75rem;
border-bottom: 1px dashed var(--color-bg-darker-2);
}
.source-column,
.target-column {
display: flex;
flex-direction: column;
}
.source-column {
flex: 4;
}
.target-column {
flex: 6;
}
.translation-row {
display: flex;
flex-direction: row;
}
.source-form {
font-weight: bold;
}
.sense {
font-size: 0.85rem;
}
.sense-note {
font-style: italic;
}
.note {
flex: 1;
text-align: right;
font-style: italic;
padding-right: 0.35rem;
font-size: 0.85rem;
color: var(--color-fg-lighter);
}
.translation {
flex: 2;
}
</style>