added filter tags to projects; added zoom-out animation when hovering over a project page
This commit is contained in:
@@ -454,5 +454,61 @@
|
|||||||
font-family: var(--font-sans-serif);
|
font-family: var(--font-sans-serif);
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO this should be in a component! */
|
||||||
|
.post-tag {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
background-color: var(--color-background-highlight-alt);
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px;
|
||||||
|
border-radius: 8px;
|
||||||
|
line-height: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter-header {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
/* margin-left: 10px;
|
||||||
|
margin-right: 10px; */
|
||||||
|
margin: 12px 10px 4px;
|
||||||
|
color: var(--color-text-highlight-alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px 12px;
|
||||||
|
margin: 0 10px 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter {
|
||||||
|
width: fit-content;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: var(--color-text);
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color var(--duration-animation) var(--anim-curve);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter-selected {
|
||||||
|
background-color: var(--color-highlight-alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter:hover {
|
||||||
|
background-color: var(--color-background-highlight-hover-alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.tag-filter-container {
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-filter {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<script>
|
|
||||||
let { children } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{@render children()}
|
|
||||||
|
|
||||||
<style>
|
|
||||||
:global {
|
|
||||||
.post-tag {
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-size: 0.8rem;
|
|
||||||
background-color: var(--color-background-highlight-alt);
|
|
||||||
margin: 0;
|
|
||||||
padding: 4px;
|
|
||||||
border-radius: 8px;
|
|
||||||
line-height: 1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let a: BlogPostLink[] = posts.filter((post) => post.post.tags.includes(filter))
|
let a: BlogPostLink[] = posts.filter((post) => post.post.tags.includes(filter))
|
||||||
console.log(a);
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -45,50 +44,4 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<BlogGallery posts={filterPosts()} />
|
<BlogGallery posts={filterPosts()} />
|
||||||
</Content>
|
</Content>
|
||||||
|
|
||||||
<style>
|
|
||||||
.tag-filter-header {
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-size: 0.9rem;
|
|
||||||
/* margin-left: 10px;
|
|
||||||
margin-right: 10px; */
|
|
||||||
margin: 12px 10px 4px;
|
|
||||||
color: var(--color-text-highlight-alt);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-filter-container {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px 12px;
|
|
||||||
margin: 0 10px 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-filter {
|
|
||||||
width: fit-content;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
color: var(--color-text);
|
|
||||||
padding: 8px;
|
|
||||||
border-radius: 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background-color var(--duration-animation) var(--anim-curve);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-filter-selected {
|
|
||||||
background-color: var(--color-highlight-alt);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-filter:hover {
|
|
||||||
background-color: var(--color-background-highlight-hover-alt);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.tag-filter-container {
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-filter {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,28 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Banner2 from "$lib/banner2.svelte";
|
import Banner2 from "$lib/banner2.svelte";
|
||||||
import TableOfContents from "$lib/components/table-of-contents.svelte";
|
import { projects, type Project, ProjectCategory } from "./projects2";
|
||||||
// import { type Project, games, hardware, apps, music, getStatusText, getStatusCode } from './projects';
|
|
||||||
import { projects, type Project, getStatusCode } from "./projects2";
|
|
||||||
import LinkList from "$lib/lists/link-list.svelte";
|
|
||||||
import Content from "$lib/viewport/content.svelte";
|
import Content from "$lib/viewport/content.svelte";
|
||||||
import GalleryRow, { type GalleryRowEntry } from "$lib/lists/gallery-row.svelte";
|
|
||||||
|
|
||||||
const subpages: GalleryRowEntry[] = [
|
let filter = $state(ProjectCategory.NULL);
|
||||||
{
|
|
||||||
title: "Small Projects",
|
function setFilter(tag: ProjectCategory) {
|
||||||
description: "Showing off the projects that don't get the spotlight",
|
filter = tag;
|
||||||
img: "small/crate.webp",
|
}
|
||||||
altText: "A cardboard box filled with electronic components, tools, and screws. They are arranged in 3D printed Gridfinity containers.",
|
|
||||||
link: "small",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Discography",
|
|
||||||
description: "Small stories about my past music",
|
|
||||||
img: "/main/hypertext.webp",
|
|
||||||
altText: "",
|
|
||||||
link: "/art/music",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
function getBannerSrc(p: Project): string {
|
function getBannerSrc(p: Project): string {
|
||||||
if (p.banner.startsWith("/")) {
|
if (p.banner.startsWith("/")) {
|
||||||
@@ -31,6 +16,15 @@
|
|||||||
return `${p.category}/${p.id}/${p.banner}`;
|
return `${p.category}/${p.id}/${p.banner}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterProjects(): Project[] {
|
||||||
|
if (filter == ProjectCategory.NULL) {
|
||||||
|
return projects;
|
||||||
|
}
|
||||||
|
|
||||||
|
let a: Project[] = projects.filter((project) => project.category === filter)
|
||||||
|
return a;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -46,14 +40,22 @@
|
|||||||
|
|
||||||
<p>Welcome to my (new) projects page! Here I show off all the things I have done. Projects are ordered reverse-chronologically and have some other neat information displayed. have fun browsing~!</p>
|
<p>Welcome to my (new) projects page! Here I show off all the things I have done. Projects are ordered reverse-chronologically and have some other neat information displayed. have fun browsing~!</p>
|
||||||
|
|
||||||
<p>This page, in its current form, is inspired by <a href="https://deathsurplus.com/">DeathSurplus' art blog</a> – definitely go check out his website!</p>
|
<p>I'll add some more of my past projects, new projects, and more details about individual projects. Maybe I'll also split the content into pages.</p>
|
||||||
|
|
||||||
<p>I'll add some more of my past projects, new projects, and an option to filter by project type <i>soon™</i>. Maybe I'll also split the content into pages.</p>
|
<!-- TODO it would be nice if these were green here to separate them from the red tags on the blog page -->
|
||||||
|
<p class="tag-filter-header"># filter projects by category:</p>
|
||||||
<hr>
|
<div class="tag-filter-container">
|
||||||
|
{#each Object.values(ProjectCategory) as tag}
|
||||||
|
{#if tag == filter}
|
||||||
|
<button class="post-tag tag-filter tag-filter-selected" onclick={() => { setFilter(tag) }}>{tag}</button>
|
||||||
|
{:else}
|
||||||
|
<button class="post-tag tag-filter" onclick={() => { setFilter(tag) }}>{tag}</button>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="project-container">
|
<div class="project-container">
|
||||||
{#each projects as p}
|
{#each filterProjects() as p}
|
||||||
{@render project(p)}
|
{@render project(p)}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
@@ -93,42 +95,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<!-- {#snippet projectSummary({
|
|
||||||
project
|
|
||||||
}: {
|
|
||||||
project: Project;
|
|
||||||
})}
|
|
||||||
<h3 id="{project.id}">{project.title}</h3>
|
|
||||||
{#if project.subtitle}
|
|
||||||
<p class="project-subtitle">[ {project.subtitle} ]</p>
|
|
||||||
{/if}
|
|
||||||
{#if project.banner}
|
|
||||||
<div class="project-banner-container">
|
|
||||||
<img class="project-banner" src="{project.banner}" alt="Overview banner for {project.title}">
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<p class="project-info blurred-background project-status-c-{getStatusCode(project)}">
|
|
||||||
{#if project.date}
|
|
||||||
{project.date} |
|
|
||||||
{/if}
|
|
||||||
{project}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{#if project.icon}
|
|
||||||
<img class="project-icon" src="{project.icon}" alt="Icon for {project.title}">
|
|
||||||
{/if}
|
|
||||||
{#each project.paragraphs as paragraph}
|
|
||||||
<p>{@html paragraph}</p>
|
|
||||||
{/each}
|
|
||||||
<LinkList entries={project.links} />
|
|
||||||
{/snippet} -->
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.project-container {
|
.project-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
/* grid-template-columns: 1fr 1fr; */
|
|
||||||
/* grid-template-columns: 1fr; */
|
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -159,11 +128,14 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
filter: brightness(40%) saturate(40%) blur(1px);
|
filter: brightness(40%) saturate(40%) blur(1px);
|
||||||
transition: filter var(--duration-animation) var(--anim-curve);
|
transition: filter var(--duration-animation) var(--anim-curve),
|
||||||
|
scale var(--duration-animation) var(--anim-curve);
|
||||||
|
scale: 1.05;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-wrapper:hover .project-banner {
|
.project-wrapper:hover .project-banner {
|
||||||
filter: brightness(60%) saturate(100%) blur(0);
|
filter: brightness(60%) saturate(100%) blur(0);
|
||||||
|
scale: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-wrapper:hover {
|
.project-wrapper:hover {
|
||||||
@@ -231,52 +203,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* .project-subtitle {
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-size: 1.0rem;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-banner-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-banner {
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
max-height: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-icon {
|
|
||||||
float: left;
|
|
||||||
margin: 16px 16px 16px 0;
|
|
||||||
width: 19%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-date-embed {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-info {
|
|
||||||
width: fit-content;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
margin-top: 16px;
|
|
||||||
background-color: color-mix(in srgb, var(--color-status) 6%, transparent);
|
|
||||||
border: var(--border-style) var(--border-dash-size) var(--color-status);
|
|
||||||
padding: 2px 8px;
|
|
||||||
|
|
||||||
font-family: var(--font-mono);
|
|
||||||
font-size: 1.0rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--color-status);
|
|
||||||
} */
|
|
||||||
|
|
||||||
/* #region Project Status Colours */
|
/* #region Project Status Colours */
|
||||||
.project-status-c-act {
|
.project-status-c-act {
|
||||||
--color-status: var(--color-highlight);
|
--color-status: var(--color-highlight);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export interface Link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum ProjectCategory {
|
export enum ProjectCategory {
|
||||||
|
NULL = "all",
|
||||||
DRAWINGS = "drawings",
|
DRAWINGS = "drawings",
|
||||||
GAMES = "games",
|
GAMES = "games",
|
||||||
ELECTRONICS = "electronics",
|
ELECTRONICS = "electronics",
|
||||||
|
|||||||
Reference in New Issue
Block a user