Frontend: Added a more button to show hidden skills.
This commit is contained in:
parent
71b1ec9263
commit
dc3fb116d1
5 changed files with 115 additions and 26 deletions
|
@ -125,10 +125,15 @@
|
||||||
pill_notification.style.top = `${main_pill.offsetTop}px`;
|
pill_notification.style.top = `${main_pill.offsetTop}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
export function updatePill() {
|
||||||
calculateOffsetUp();
|
calculateOffsetUp();
|
||||||
calculateHitbox();
|
calculateHitbox();
|
||||||
|
calculateOutOfBounds();
|
||||||
calculateNotification();
|
calculateNotification();
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
updatePill();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -136,10 +141,7 @@
|
||||||
bind:innerWidth
|
bind:innerWidth
|
||||||
bind:scrollY
|
bind:scrollY
|
||||||
on:resize={() => {
|
on:resize={() => {
|
||||||
calculateOffsetUp();
|
updatePill();
|
||||||
calculateHitbox();
|
|
||||||
calculateOutOfBounds();
|
|
||||||
calculateNotification();
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -195,3 +195,25 @@
|
||||||
background-color: var(--color-text);
|
background-color: var(--color-text);
|
||||||
box-shadow: 0px 8px 18px -1px #261C2C50;
|
box-shadow: 0px 8px 18px -1px #261C2C50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pill-more {
|
||||||
|
color: var(--color-text);
|
||||||
|
background-color: var(--color-background);
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0px 8px 18px -1px #261C2C30;
|
||||||
|
border: 0;
|
||||||
|
padding: 0.3rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-more:hover{
|
||||||
|
color: var(--color-background);
|
||||||
|
background-color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-more:active{
|
||||||
|
transform: translateY(4px);
|
||||||
|
box-shadow: 0px 4px 12px -1px #261C2C90;
|
||||||
|
}
|
|
@ -3,8 +3,7 @@
|
||||||
"experience": "Experiences",
|
"experience": "Experiences",
|
||||||
"projects": "Projects",
|
"projects": "Projects",
|
||||||
"skills": "Skills",
|
"skills": "Skills",
|
||||||
"programming_languages": "Programming Languages",
|
"more": "More",
|
||||||
"software": "Software",
|
|
||||||
"languages": "Languages",
|
"languages": "Languages",
|
||||||
|
|
||||||
"interests": "Interests",
|
"interests": "Interests",
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
"experience": "Expériences",
|
"experience": "Expériences",
|
||||||
"projects": "Projets",
|
"projects": "Projets",
|
||||||
"skills": "Compétences",
|
"skills": "Compétences",
|
||||||
"programming_languages": "Langages de programmation",
|
"more": "Plus",
|
||||||
"software": "Logiciels",
|
|
||||||
"languages": "Langues",
|
"languages": "Langues",
|
||||||
|
|
||||||
"interests": "Centres d'intérêt",
|
"interests": "Centres d'intérêt",
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import { showSidebar } from "$lib/js/topbar.js";
|
import { showSidebar } from "$lib/js/topbar.js";
|
||||||
import "$lib/css/base.css";
|
import "$lib/css/base.css";
|
||||||
import "$lib/css/cv.css";
|
import "$lib/css/cv.css";
|
||||||
|
import "$lib/css/pill.css";
|
||||||
import "/node_modules/flag-icons/css/flag-icons.min.css";
|
import "/node_modules/flag-icons/css/flag-icons.min.css";
|
||||||
|
|
||||||
// Main
|
// Main
|
||||||
|
@ -23,6 +24,8 @@
|
||||||
mdiAccount,
|
mdiAccount,
|
||||||
mdiEarth,
|
mdiEarth,
|
||||||
mdiHeart,
|
mdiHeart,
|
||||||
|
mdiArrowDown,
|
||||||
|
mdiArrowUp,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
|
@ -75,6 +78,35 @@
|
||||||
Sidebar = (await import("/src/lib/components/sidebar.svelte")).default;
|
Sidebar = (await import("/src/lib/components/sidebar.svelte")).default;
|
||||||
sidebarLoaded = true;
|
sidebarLoaded = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// More pill handler
|
||||||
|
let pillShowMore = [];
|
||||||
|
let pillInstances = [[], []];
|
||||||
|
$: pillActualIndex=0;
|
||||||
|
async function moreHandler(id) {
|
||||||
|
if (pillShowMore[id] === true) {
|
||||||
|
// show Less
|
||||||
|
pillShowMore[id] = false;
|
||||||
|
} else {
|
||||||
|
// Show More
|
||||||
|
pillShowMore[id] = true;
|
||||||
|
}
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 30));
|
||||||
|
for (const pills of pillInstances) {
|
||||||
|
for (const p of pills) {
|
||||||
|
p.updatePill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function needMore(skill)
|
||||||
|
{
|
||||||
|
for(const s of skill)
|
||||||
|
{
|
||||||
|
if(!s.is_shown) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window
|
||||||
|
@ -166,12 +198,17 @@
|
||||||
{text}
|
{text}
|
||||||
/>
|
/>
|
||||||
<Section icon={mdiPencil} title={text.skills} />
|
<Section icon={mdiPencil} title={text.skills} />
|
||||||
{#each cv.skills as skill, index (index)}
|
{#each cv.skills as skill, index}
|
||||||
<SubSection icon={cv.categories[index].icon} title={cv.categories[index].name} />
|
<SubSection
|
||||||
<div class="subsection">
|
icon={cv.categories[index].icon}
|
||||||
|
title={cv.categories[index].name}
|
||||||
|
/>
|
||||||
{#if sidebarLoaded}
|
{#if sidebarLoaded}
|
||||||
{#each skill as pilldata, index (index)}
|
<div class="subsection">
|
||||||
|
{#each skill as pilldata, pill_dataindex}
|
||||||
|
{#if pilldata.is_shown}
|
||||||
<Pill
|
<Pill
|
||||||
|
bind:this={pillInstances[index][pill_dataindex]}
|
||||||
name={pilldata.skill}
|
name={pilldata.skill}
|
||||||
type_icon={pilldata.type_icon}
|
type_icon={pilldata.type_icon}
|
||||||
icon={pilldata.icon}
|
icon={pilldata.icon}
|
||||||
|
@ -180,9 +217,39 @@
|
||||||
tooltip_data={cv.project_skills[pilldata.id - 1]}
|
tooltip_data={cv.project_skills[pilldata.id - 1]}
|
||||||
{text}
|
{text}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
{#if needMore(skill)}
|
||||||
|
<button
|
||||||
|
class="pill-container pill-more"
|
||||||
|
on:click={() => moreHandler(index)}
|
||||||
|
>
|
||||||
|
<SvgIcon
|
||||||
|
type="mdi"
|
||||||
|
path={pillShowMore[index] === true ? mdiArrowDown : mdiArrowUp}
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
<p>{text.more}</p>
|
||||||
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
<div class={pillShowMore[index] === true ? "subsection" : "none"}>
|
||||||
|
{#each skill as pilldata, pill_dataindex}
|
||||||
|
{#if !pilldata.is_shown}
|
||||||
|
<Pill
|
||||||
|
bind:this={pillInstances[index][pill_dataindex]}
|
||||||
|
name={pilldata.skill}
|
||||||
|
type_icon={pilldata.type_icon}
|
||||||
|
icon={pilldata.icon}
|
||||||
|
color={pilldata.color}
|
||||||
|
show_tooltip={true}
|
||||||
|
tooltip_data={cv.project_skills[pilldata.id - 1]}
|
||||||
|
{text}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
<SubSection icon={mdiEarth} title={text.languages} />
|
<SubSection icon={mdiEarth} title={text.languages} />
|
||||||
<div class="subsection flag-container end">
|
<div class="subsection flag-container end">
|
||||||
|
|
Loading…
Add table
Reference in a new issue