Skip to content

Commit

Permalink
feat: 💄 Highlight matches in coCites sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Oct 10, 2021
1 parent 270152b commit 1916a1a
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/Components/CoCitations.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@
<span class={TD_MEASURE}>{coCite.measure}</span>
</div>
<div class="CC-sentence">
${coCite.sentence}
{#if coCite.measure < 0.5}
<span>{coCite.sentence[0]}</span>
<mark>{coCite.sentence[1]}</mark>
<span>{coCite.sentence[2]}</span>
{:else}
<span>{coCite.sentence[0]}</span>
<mark>{coCite.sentence[1]}</mark>
<span>{coCite.sentence[2]}</span>
<mark>{coCite.sentence[3]}</mark>
<span>{coCite.sentence[4]}</span>
{/if}
</div>
{/each}
</div>
Expand Down Expand Up @@ -153,8 +163,12 @@
padding-left: 40px;
color: var(--text-muted);
}
/* .top-row {
display: flex;
justify-content: space-between;
} */
.top-row span + span {
float: right;
}
mark {
color: var(--text-normal);
background-color: var(--text-highlight-bg);
}
</style>

0 comments on commit 1916a1a

Please sign in to comment.