edited style of projects page entries; now fetching banner correctly, respecting both relative and absolute paths
This commit is contained in:
@@ -23,6 +23,14 @@
|
|||||||
link: "/art/music",
|
link: "/art/music",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function getBannerSrc(p: Project): string {
|
||||||
|
if (p.banner.startsWith("/")) {
|
||||||
|
return p.banner;
|
||||||
|
} else {
|
||||||
|
return `${p.category}/${p.id}/${p.banner}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -65,12 +73,22 @@
|
|||||||
|
|
||||||
{#snippet projectContent(p: Project)}
|
{#snippet projectContent(p: Project)}
|
||||||
<div class="project-content-container">
|
<div class="project-content-container">
|
||||||
<img class="project-banner" src={p.banner} alt={p.bannerAlt}>
|
<img class="project-banner" src={getBannerSrc(p)} alt={p.bannerAlt}>
|
||||||
<div class="project-text-container">
|
<div class="project-text-container">
|
||||||
<p class="project-title">{p.title}</p>
|
<div class="project-text-left">
|
||||||
|
<p class="project-title">
|
||||||
|
{#if p.isHighlight}
|
||||||
|
✿
|
||||||
|
{/if}
|
||||||
|
{p.title}
|
||||||
|
</p>
|
||||||
<p class="project-subtitle">{p.subtitle}</p>
|
<p class="project-subtitle">{p.subtitle}</p>
|
||||||
<p class="project-date">{p.date}</p>
|
<p class="project-date">{p.date}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="project-text-right">
|
||||||
|
<p class="project-category">{p.category}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
@@ -107,20 +125,23 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.project-container {
|
.project-container {
|
||||||
display: grid;
|
display: flex;
|
||||||
/* grid-template-columns: 1fr 1fr; */
|
/* grid-template-columns: 1fr 1fr; */
|
||||||
grid-template-columns: 1fr;
|
/* grid-template-columns: 1fr; */
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
margin: 0 auto;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-wrapper {
|
.project-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
/* border-radius: var(--border-radius); */
|
|
||||||
/* gap: 4px; */
|
/* gap: 4px; */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
transition: border-radius var(--duration-animation) var(--anim-curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-content-container {
|
.project-content-container {
|
||||||
@@ -136,7 +157,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
filter: brightness(60%) saturate(40%) blur(4px);
|
filter: brightness(40%) saturate(40%) blur(1px);
|
||||||
transition: filter var(--duration-animation) var(--anim-curve);
|
transition: filter var(--duration-animation) var(--anim-curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,8 +165,16 @@
|
|||||||
filter: brightness(60%) saturate(100%) blur(0);
|
filter: brightness(60%) saturate(100%) blur(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-wrapper:hover {
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
}
|
||||||
|
|
||||||
.project-text-container {
|
.project-text-container {
|
||||||
padding: 8px 16px;
|
padding: 16px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-text-container p {
|
.project-text-container p {
|
||||||
@@ -153,9 +182,14 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-highlight-marker {
|
||||||
|
color: aqua;
|
||||||
|
}
|
||||||
|
|
||||||
.project-title {
|
.project-title {
|
||||||
font-family: var(--font-mono);
|
font-family: var(--font-mono);
|
||||||
font-size: 1.4rem;
|
font-size: 1.5rem;
|
||||||
|
line-height: 1.8rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +202,24 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-category {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1.0rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.project-title {
|
||||||
|
font-size: 1.3rem;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-subtitle, .project-date, .project-category {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
line-height: 1.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* .project-subtitle {
|
/* .project-subtitle {
|
||||||
font-family: var(--font-mono);
|
font-family: var(--font-mono);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface Project {
|
|||||||
date: string;
|
date: string;
|
||||||
status: ProjectStatus;
|
status: ProjectStatus;
|
||||||
links: Link[]; // may pass an empty array
|
links: Link[]; // may pass an empty array
|
||||||
|
isHighlight?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface Link {
|
export interface Link {
|
||||||
@@ -63,7 +64,7 @@ export const projects: Project[] = [
|
|||||||
banner: "/projects/projectn5/banner2.webp",
|
banner: "/projects/projectn5/banner2.webp",
|
||||||
bannerAlt: "",
|
bannerAlt: "",
|
||||||
title: "Homesick",
|
title: "Homesick",
|
||||||
subtitle: "",
|
subtitle: "my main video game project",
|
||||||
description: "",
|
description: "",
|
||||||
isOngoing: true,
|
isOngoing: true,
|
||||||
date: "September 2023 – now",
|
date: "September 2023 – now",
|
||||||
@@ -82,6 +83,7 @@ export const projects: Project[] = [
|
|||||||
// link: "https://files.natconf.dev/public/projectn5",
|
// link: "https://files.natconf.dev/public/projectn5",
|
||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
|
isHighlight: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// 2026
|
// 2026
|
||||||
@@ -147,7 +149,7 @@ export const projects: Project[] = [
|
|||||||
banner: "/projects/projektike/banner.webp",
|
banner: "/projects/projektike/banner.webp",
|
||||||
bannerAlt: "",
|
bannerAlt: "",
|
||||||
title: "Projektike",
|
title: "Projektike",
|
||||||
subtitle: "PvP Game",
|
subtitle: "Local PvP Game",
|
||||||
description: "",
|
description: "",
|
||||||
isOngoing: false,
|
isOngoing: false,
|
||||||
date: "August 2024 – May 2025",
|
date: "August 2024 – May 2025",
|
||||||
@@ -363,7 +365,7 @@ export const projects: Project[] = [
|
|||||||
banner: "",
|
banner: "",
|
||||||
bannerAlt: "",
|
bannerAlt: "",
|
||||||
title: "A New Beginning",
|
title: "A New Beginning",
|
||||||
subtitle: "",
|
subtitle: "Coming-of-age EP",
|
||||||
description: "",
|
description: "",
|
||||||
isOngoing: false,
|
isOngoing: false,
|
||||||
date: "May – August 2018",
|
date: "May – August 2018",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Reference in New Issue
Block a user