Skip to content

Commit

Permalink
ability to hide members, fix default contributors, more game page pro…
Browse files Browse the repository at this point in the history
…gress
  • Loading branch information
ceitine committed Oct 22, 2024
1 parent c565d5b commit ee3e84d
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/lib/components/MemberCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
};
const getProjects = () => {
return Games.filter(
(proj) =>
proj.contributors == null ||
proj.contributors?.find((m) => m.toLowerCase() == member.name.toLocaleLowerCase())
return Games.filter((proj) =>
proj.contributors?.find((m) => m.toLowerCase() == member.name.toLocaleLowerCase())
).sort();
};
Expand Down
12 changes: 8 additions & 4 deletions src/lib/types/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface Member {
roles?: Record<string, string[]>;
socials?: string[];
classification?: Record<string, string[]>;
hidden?: boolean;
}

export const shrimplifyPath = (path: string) => {
Expand Down Expand Up @@ -221,7 +222,11 @@ export const Members: Member[] = [
},
point: { x: 365, y: 38 },
country: Countries.Russia,
socials: ['https://www.artstation.com/wheatleymf', 'https://wheatleymf.net', 'https://twitter.com/wheatleymf']
socials: [
'https://www.artstation.com/wheatleymf',
'https://wheatleymf.net',
'https://twitter.com/wheatleymf'
]
},

// Mungus
Expand Down Expand Up @@ -346,13 +351,12 @@ export const Members: Member[] = [
// yart
{
name: 'yart',
description:
'You are reading this.',
description: 'You are reading this.',
avatar: '/team/profiles/yart.png',
point: { x: 100, y: 80 },
country: Countries.US,
roles: {
Programmer: [Languages.CSharp, Languages.LUA],
Programmer: [Languages.CSharp, Languages.LUA]
},
socials: ['https://github.com/youarereadingthis'],
classification: {
Expand Down
61 changes: 57 additions & 4 deletions src/routes/games/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { type Game, Games, Placement } from '$lib/types/Games';
import { type Game, Games, GameState, Placement } from '$lib/types/Games';
import { Members } from '$lib/types/Member';
import Icon from '@iconify/svelte';
import { onMount } from 'svelte';
Expand Down Expand Up @@ -48,18 +49,18 @@

<!-- Information container -->
<div
class="flex h-full w-[35%] flex-shrink-0 flex-grow flex-col bg-transparentblack1 p-8 backdrop-blur-md"
class="flex h-full w-[35%] flex-shrink-0 flex-grow flex-col gap-12 bg-transparentblack1 p-8 backdrop-blur-md xl:px-14"
>
<!-- Contest -->
{#if game.contestDetails}
{@const placement = Placement[game.contestDetails.placement]}

<div
class="flex flex-row items-center gap-8 border-4 border-white p-4 placement-{placement}"
class="flex flex-row items-center gap-8 border-2 border-white p-2 px-2 xl:px-8 placement-{placement}"
>
<Icon class="hidden text-8xl lg:flex" icon="material-symbols:trophy" />
<div class="flex flex-col gap-1">
<p class="text-xl font-bold uppercase">{game.contestDetails.title}</p>
<p class="text-lg font-bold uppercase">{game.contestDetails.title}</p>
<p class="text-md brightness-90">
{#if game.contestDetails.placement == Placement.None}
This game was submitted for a gamejam didn't place :(
Expand All @@ -69,6 +70,58 @@
</p>
</div>
</div>
{:else}
<div class="h-[7.25rem]" />
{/if}

<!-- Title and summary -->
<div class="flex flex-col gap-4">
<p class="text-4xl font-bold text-white">{game.title}</p>

<div class="flex flex-row flex-wrap gap-4 text-lg text-white">
{#if game.date}
<p class="flex items-center justify-center bg-blue px-6">
{game.date.toLocaleString('default', { month: 'long', year: 'numeric' })}
</p>
{/if}
{#if game.state}
<p class="flex items-center justify-center bg-blue px-6">
{GameState[game.state]}
</p>
{/if}
</div>

<div class="h-60 overflow-y-auto">
<p class="text-lg text-gray">{game.summary}</p>
</div>
</div>

<!-- Developers -->
{#if game.contributors}
<div class="flex flex-col gap-2">
<p class="text-lg font-bold text-white">DEVELOPED BY</p>
<div class="flex flex-row flex-wrap gap-1">
{#each game.contributors as memberName}
{@const member = Members.find(
(m) => m.name.toLowerCase() == memberName.toLowerCase()
)}
{#if member}
<a
class="flex h-8 w-[32%] flex-row items-center gap-2 bg-white bg-opacity-10 transition-all hover:scale-[102%] hover:brightness-125"
href="/team/{member.name}"
target="_blank"
>
<img src={member.avatar} class="aspect-square h-full" alt="avatar" />
<p
class="inline-block overflow-hidden text-ellipsis whitespace-nowrap pr-2 text-sm text-gray"
>
{member.name}
</p>
</a>
{/if}
{/each}
</div>
</div>
{/if}
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/routes/team/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
// Create pins.
let count = 0;
Members.forEach((member) => {
if (member.hidden) return;
let image = new Image();
image.src = member.country;
Expand Down Expand Up @@ -142,7 +144,9 @@
}
const decodedName = decodeURI(name);
let target = Members.find((m) => m.name.toLowerCase() === decodedName.toLocaleLowerCase());
let target = Members.find(
(m) => !m.hidden && m.name.toLowerCase() === decodedName.toLocaleLowerCase()
);
if (target == null) return undefined;
member = target;
Expand Down
8 changes: 4 additions & 4 deletions src/routes/team/[slug]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Members, type Member } from '$lib/types/Member';

/** @type {import('./$types').EntryGenerator} */
export function entries() {
return Members.map( function(m) {
return { slug: decodeURI(m.name) }
} );
return Members.filter((m) => !m.hidden).map(function (m) {
return { slug: decodeURI(m.name) };
});
}

export const prerender = true;
export const prerender = true;
4 changes: 3 additions & 1 deletion src/routes/team/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
let slug = $page.params.slug;
const decodedName = decodeURI(slug);
let target = Members.find((m) => m.name.toLowerCase() === decodedName.toLocaleLowerCase());
let target = Members.find(
(m) => !m.hidden && m.name.toLowerCase() === decodedName.toLocaleLowerCase()
);
if (target == null) return false;
initialMember = target;
Expand Down

0 comments on commit ee3e84d

Please sign in to comment.