Backend: Updated project database, Reworked Rust to add this feature. Frontend: Added pictures to project. Now uses date gathered for projects. reverse is an option for Slideshow.
This commit is contained in:
parent
dc6d1af0d9
commit
8aabdf7cde
13 changed files with 26 additions and 6 deletions
|
@ -11,6 +11,7 @@ CREATE TABLE public.project (
|
||||||
description text NULL,
|
description text NULL,
|
||||||
github_link text NULL,
|
github_link text NULL,
|
||||||
id_skills serial4 NOT NULL,
|
id_skills serial4 NOT NULL,
|
||||||
|
picture_name text NULL,
|
||||||
CONSTRAINT project_pkey PRIMARY KEY (id),
|
CONSTRAINT project_pkey PRIMARY KEY (id),
|
||||||
CONSTRAINT project_fk FOREIGN KEY (id_skills) REFERENCES public.skills(id)
|
CONSTRAINT project_fk FOREIGN KEY (id_skills) REFERENCES public.skills(id)
|
||||||
);
|
);
|
|
@ -44,6 +44,7 @@ pub struct Project {
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub github_link: Option<String>,
|
pub github_link: Option<String>,
|
||||||
pub id_skills: i64,
|
pub id_skills: i64,
|
||||||
|
pub picture_name: Option<String>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
|
|
|
@ -72,7 +72,7 @@ async fn skills(State(pool): State<PgPool>) -> Result<Json<(Vec<Project>, Vec<Sk
|
||||||
// Gathering skills
|
// Gathering skills
|
||||||
let skills = sqlx::query_as!(
|
let skills = sqlx::query_as!(
|
||||||
Skills,
|
Skills,
|
||||||
"SELECT id, programming_lang, software, languages FROM public.skills"
|
"SELECT * FROM public.skills"
|
||||||
)
|
)
|
||||||
.fetch_all(&pool)
|
.fetch_all(&pool)
|
||||||
.await
|
.await
|
||||||
|
@ -81,7 +81,7 @@ async fn skills(State(pool): State<PgPool>) -> Result<Json<(Vec<Project>, Vec<Sk
|
||||||
// Gathering Projects
|
// Gathering Projects
|
||||||
let projects = sqlx::query_as!(
|
let projects = sqlx::query_as!(
|
||||||
Project,
|
Project,
|
||||||
"SELECT id, date_done, title, description, github_link, id_skills FROM public.project"
|
"SELECT * FROM public.project ORDER BY date_done DESC"
|
||||||
)
|
)
|
||||||
.fetch_all(&pool)
|
.fetch_all(&pool)
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { onMount } from "svelte";
|
||||||
import SvgIcon from "@jamescoyle/svelte-icon";
|
import SvgIcon from "@jamescoyle/svelte-icon";
|
||||||
import { mdiCalendarRange, mdiPlus } from "@mdi/js";
|
import { mdiCalendarRange, mdiPlus } from "@mdi/js";
|
||||||
import "$lib/css/slide.css";
|
import "$lib/css/slide.css";
|
||||||
|
import { formatMonth } from "$lib/js/date.js";
|
||||||
|
|
||||||
export let active = false;
|
export let active = false;
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
const title = data.title;
|
const title = data.title;
|
||||||
const description = data.description;
|
const description = data.description;
|
||||||
const issued_date = "2023";
|
const issued_date = formatMonth(data.date_done).charAt(0).toUpperCase()+formatMonth(data.date_done).slice(1);
|
||||||
const picture = data.picture_url;
|
let picture;
|
||||||
|
onMount(async () => {
|
||||||
|
picture = (await import(`/src/lib/img/${data.picture_name}`)).default;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="slide-container">
|
<div class="slide-container">
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
export let data = [];
|
export let data = [];
|
||||||
export let type;
|
export let type;
|
||||||
export let timeline = false;
|
export let timeline = false;
|
||||||
|
export let reverse = false;
|
||||||
|
if(reverse) {
|
||||||
|
data = data.reverse();
|
||||||
|
}
|
||||||
|
|
||||||
// Slideshow global variables
|
// Slideshow global variables
|
||||||
|
|
||||||
|
@ -127,7 +131,6 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{@debug slideContainerCount}
|
|
||||||
<div class="slideshow" bind:this={slideshow}>
|
<div class="slideshow" bind:this={slideshow}>
|
||||||
<button class="slideshow_btn" on:click={slideCards}>
|
<button class="slideshow_btn" on:click={slideCards}>
|
||||||
<div>
|
<div>
|
||||||
|
@ -140,7 +143,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
{#each data.reverse() as selected_data, index (index)}
|
{#each data as selected_data, index (index)}
|
||||||
<svelte:component
|
<svelte:component
|
||||||
this={type}
|
this={type}
|
||||||
data={selected_data}
|
data={selected_data}
|
||||||
|
|
|
@ -25,6 +25,7 @@ html {
|
||||||
flex-basis: 20rem;
|
flex-basis: 20rem;
|
||||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
|
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
|
||||||
background-color: var(--color-special);
|
background-color: var(--color-special);
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-picture-container {
|
.profile-picture-container {
|
||||||
|
|
BIN
frontend/src/lib/img/feedback.jpg
Normal file
BIN
frontend/src/lib/img/feedback.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 MiB |
BIN
frontend/src/lib/img/i2c.jpg
Executable file
BIN
frontend/src/lib/img/i2c.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.3 MiB |
BIN
frontend/src/lib/img/morse.jpg
Executable file
BIN
frontend/src/lib/img/morse.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.8 MiB |
BIN
frontend/src/lib/img/rangefinder.png
Normal file
BIN
frontend/src/lib/img/rangefinder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 198 KiB |
BIN
frontend/src/lib/img/thermometer.jpg
Executable file
BIN
frontend/src/lib/img/thermometer.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.2 MiB |
|
@ -5,6 +5,13 @@ export function formatDate(date) {
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatMonth(date) {
|
||||||
|
const options = { month: 'long', year: 'numeric' };
|
||||||
|
const cool_date = new Date(date);
|
||||||
|
const formattedDate = cool_date.toLocaleDateString('fr-FR', options);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
export function formatYear(date) {
|
export function formatYear(date) {
|
||||||
const options = { year: 'numeric' };
|
const options = { year: 'numeric' };
|
||||||
const cool_date = new Date(date);
|
const cool_date = new Date(date);
|
||||||
|
|
|
@ -94,12 +94,14 @@
|
||||||
data={cv.education}
|
data={cv.education}
|
||||||
type={Education}
|
type={Education}
|
||||||
timeline="true"
|
timeline="true"
|
||||||
|
reverse="true"
|
||||||
/>
|
/>
|
||||||
<Section icon={mdiBriefcase} title="Experience" />
|
<Section icon={mdiBriefcase} title="Experience" />
|
||||||
<SlideShow
|
<SlideShow
|
||||||
data={cv.experiences}
|
data={cv.experiences}
|
||||||
type={Experience}
|
type={Experience}
|
||||||
timeline="true"
|
timeline="true"
|
||||||
|
reverse="true"
|
||||||
/>
|
/>
|
||||||
<Section icon={mdiWrench} title="Projects" />
|
<Section icon={mdiWrench} title="Projects" />
|
||||||
<SlideShow
|
<SlideShow
|
||||||
|
|
Loading…
Add table
Reference in a new issue