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 shadow_color = null;
|
||||||
export let show_tooltip = false;
|
export let show_tooltip = false;
|
||||||
export let tooltip_data = [];
|
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));
|
const white = shouldColorBeWhite(color.slice(1));
|
||||||
let style =
|
let style =
|
||||||
|
@ -140,6 +150,7 @@
|
||||||
{#each tooltip_data as td}
|
{#each tooltip_data as td}
|
||||||
<div>
|
<div>
|
||||||
<span>{td.title}</span>
|
<span>{td.title}</span>
|
||||||
|
{#if td.project_id != null}
|
||||||
<div class="pill-last">
|
<div class="pill-last">
|
||||||
<button
|
<button
|
||||||
class="pill-view"
|
class="pill-view"
|
||||||
|
@ -147,6 +158,7 @@
|
||||||
><SvgIcon size="20" path={mdiPlus} type="mdi" /></button
|
><SvgIcon size="20" path={mdiPlus} type="mdi" /></button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,5 +23,8 @@
|
||||||
"popup_description": "Description",
|
"popup_description": "Description",
|
||||||
"popup_dl_app": "Download App",
|
"popup_dl_app": "Download App",
|
||||||
"popup_dl_arc": "Download Archive",
|
"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_description": "Description",
|
||||||
"popup_dl_app": "Application",
|
"popup_dl_app": "Application",
|
||||||
"popup_dl_arc": "Archive ZIP",
|
"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}
|
color={pilldata.color}
|
||||||
show_tooltip={true}
|
show_tooltip={true}
|
||||||
tooltip_data={cv.project_programming[index]}
|
tooltip_data={cv.project_programming[index]}
|
||||||
|
{text}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -162,6 +163,7 @@
|
||||||
color={pilldata.color}
|
color={pilldata.color}
|
||||||
show_tooltip={true}
|
show_tooltip={true}
|
||||||
tooltip_data={cv.project_software[index]}
|
tooltip_data={cv.project_software[index]}
|
||||||
|
{text}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Add table
Reference in a new issue