Frontend: Added Special tooltips, a json file to add custom messages to pills.
This commit is contained in:
parent
d1059eade6
commit
5beaa1d561
5 changed files with 33 additions and 2 deletions
|
@ -13,6 +13,16 @@
|
|||
export let shadow_color = null;
|
||||
export let show_tooltip = false;
|
||||
export let tooltip_data = [];
|
||||
export let text;
|
||||
|
||||
// Special data on pill
|
||||
import st_misc from "$lib/misc/special_tooltip.json";
|
||||
for (const st in st_misc) {
|
||||
if (st == name)
|
||||
tooltip_data.push({
|
||||
title: text[st_misc[st]],
|
||||
});
|
||||
}
|
||||
|
||||
const white = shouldColorBeWhite(color.slice(1));
|
||||
let style =
|
||||
|
@ -140,6 +150,7 @@
|
|||
{#each tooltip_data as td}
|
||||
<div>
|
||||
<span>{td.title}</span>
|
||||
{#if td.project_id != null}
|
||||
<div class="pill-last">
|
||||
<button
|
||||
class="pill-view"
|
||||
|
@ -147,6 +158,7 @@
|
|||
><SvgIcon size="20" path={mdiPlus} type="mdi" /></button
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
@ -23,5 +23,8 @@
|
|||
"popup_description": "Description",
|
||||
"popup_dl_app": "Download App",
|
||||
"popup_dl_arc": "Download Archive",
|
||||
"popup_dl_rep": "See Report"
|
||||
"popup_dl_rep": "See Report",
|
||||
|
||||
"backend": "This backend",
|
||||
"frontend": "This website"
|
||||
}
|
|
@ -23,5 +23,8 @@
|
|||
"popup_description": "Description",
|
||||
"popup_dl_app": "Application",
|
||||
"popup_dl_arc": "Archive ZIP",
|
||||
"popup_dl_rep": "Voir le Rapport"
|
||||
"popup_dl_rep": "Voir le Rapport",
|
||||
|
||||
"backend": "Ce serveur",
|
||||
"frontend": "Ce site web"
|
||||
}
|
11
frontend/src/lib/misc/special_tooltip.json
Normal file
11
frontend/src/lib/misc/special_tooltip.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"Rust": "backend",
|
||||
"PostgresSQL": "backend",
|
||||
"CSS": "frontend",
|
||||
"HTML": "frontend",
|
||||
"Svelte": "frontend",
|
||||
"JavaScript": "frontend",
|
||||
"VS Codium": "frontend",
|
||||
"Github": "frontend",
|
||||
"DBeaver": "backend"
|
||||
}
|
|
@ -147,6 +147,7 @@
|
|||
color={pilldata.color}
|
||||
show_tooltip={true}
|
||||
tooltip_data={cv.project_programming[index]}
|
||||
{text}
|
||||
/>
|
||||
{/each}
|
||||
{/if}
|
||||
|
@ -162,6 +163,7 @@
|
|||
color={pilldata.color}
|
||||
show_tooltip={true}
|
||||
tooltip_data={cv.project_software[index]}
|
||||
{text}
|
||||
/>
|
||||
{/each}
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Reference in a new issue