Skip to content

Commit adbedec

Browse files
merge main into issue-69 to prepare for sparkle PR
1 parent e2ab4a1 commit adbedec

39 files changed

Lines changed: 1503 additions & 395 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Member Profiles
2+
3+
Profiles of club members can be added and edited at the row 'Member' of the GAME_DEV section on the main admin page.
4+
5+
### Fields
6+
7+
**Name:** Required field for the member's name. A character field (includes letters, numbers and symbols) of maximum length 200 characters.
8+
9+
**Active:** Checkbox to represent whether a member is an active participant in the club. If the checkbox is not ticked then the member's profile will not be displayed on the website.
10+
11+
**Profile Picture:** Optional field to upload a profile picture. Must be an image file, and will display best if the image is at least 128 by 128 px in size. If no profile picture is provided then the member's initials will be displayed instead.
12+
13+
**About:** Optional field for a bio. A character field of maximum length 256 characters.
14+
15+
**Pronouns:** Optional field for the member's pronouns. A character field of maximum length 20 characters.
16+
17+
**Social media links:** Optional section to display links to the member's social media profiles. Requires a link to the profile (character field of maximum length 2083) and, optionally, the profile username (character field of maximum length 200). If a username is not supplied then only a social media icon will be displayed with the link attached, otherwise the username will be placed next to the relevant icon. The type of icon to be displayed (e.g. instagram, linkedin, generic link) is inferred from the social media link provided.

client/package-lock.json

Lines changed: 52 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"@tanstack/react-query": "^5.80.7",
2323
"@tanstack/react-query-devtools": "^5.80.7",
2424
"autoprefixer": "^10.4.21",
25-
"axios": "^1.12.0",
25+
"axios": "^1.13.5",
2626
"class-variance-authority": "^0.7.1",
2727
"clsx": "^2.1.1",
2828
"framer-motion": "^12.23.24",
2929
"is-inside-container": "^1.0.0",
3030
"lucide-react": "^0.516.0",
31-
"next": "15.4.11",
31+
"next": "15.5.10",
3232
"react": "19.1.0",
3333
"react-dom": "19.1.0",
3434
"react-social-icons": "^6.25.0",

client/public/frame.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.

client/public/pixel-art-frame.svg

Lines changed: 9 additions & 0 deletions
Loading

client/src/components/main/MemberProfile.tsx

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import Image from "next/image";
4+
import { SocialIcon } from "react-social-icons";
45

56
// unused atm, as the member isnt linked a project on the backend
67
/* export type MemberProfileProject = {
@@ -15,6 +16,11 @@ export type MemberProfileData = {
1516
about: string;
1617
pronouns?: string;
1718
profile_picture?: string;
19+
social_media?: {
20+
link: string;
21+
socialMediaUserName: string;
22+
}[];
23+
pk: number;
1824
};
1925

2026
type MemberProfileProps = {
@@ -54,19 +60,49 @@ export function MemberProfile({ member }: MemberProfileProps) {
5460
)}
5561
</div>
5662
<Image
57-
src="/frame.svg"
63+
src="/pixel-art-frame.svg"
5864
alt="golden pixel art frame around profile picture"
59-
width={176}
60-
height={192}
61-
className="z-0 h-48 w-44"
65+
width={200}
66+
height={200}
67+
className="z-10"
6268
/>
6369
</div>
6470
<div className="flex w-4/5 flex-col gap-2 rounded-md p-2.5 font-firaCode">
6571
<div className="flex">
6672
<p className="min-w-fit font-jersey10 text-4xl">{member.name}</p>
6773
<hr className="ml-5 hidden w-full self-center border-light_2 lg:flex" />
6874
</div>
69-
<p className="text-lg">{member.pronouns}</p>
75+
<div className="flex items-center gap-2">
76+
{member.social_media && member.social_media.length > 0 && (
77+
<div className="w-full">
78+
<div className="mt-2 flex flex-wrap items-center gap-2">
79+
{member.social_media.map((sm) => (
80+
<span
81+
key={sm.link}
82+
className="ml-2 flex items-center gap-1"
83+
>
84+
<SocialIcon
85+
url={sm.link}
86+
style={{ height: 24, width: 24 }}
87+
/>
88+
<a
89+
href={sm.link}
90+
target="_blank"
91+
rel="noopener noreferrer"
92+
className="font-firaCode text-base underline hover:text-primary"
93+
>
94+
{sm.socialMediaUserName}
95+
</a>
96+
</span>
97+
))}
98+
</div>
99+
</div>
100+
)}
101+
</div>
102+
<div className="flex items-center gap-2">
103+
<p className="text-lg">{member.pronouns}</p>
104+
</div>
105+
70106
<p>{member.about}</p>
71107
</div>
72108
</div>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// notes:
2+
// - width and height don't match itch.io, making games look smaller
3+
// - you can just embed from itch.io, but only the developer can get the embed link as far as i can tell
4+
// - would need to save embed link, width and height to db
5+
// - this method is reliant on itch.io staying up and not changing anything
6+
// - would want a play button so it doesn't autoload (especially for bigger more intense games)
7+
import Image from "next/image";
8+
import React, { useState } from "react";
9+
10+
import { Button } from "./button";
11+
12+
type GameEmbedProps = {
13+
embedID: string;
14+
gameWidth: number;
15+
gameHeight: number;
16+
gameImage: string;
17+
};
18+
19+
export function GameEmbed({
20+
embedID,
21+
gameWidth,
22+
gameHeight,
23+
gameImage,
24+
}: GameEmbedProps) {
25+
const [isPlaying, setIsPlaying] = useState(false);
26+
27+
return (
28+
<div
29+
className={`retroBorder flex items-center justify-center bg-background`}
30+
style={{ width: gameWidth + 26 * 2, height: gameHeight + 26 * 2 }}
31+
>
32+
{!isPlaying ? (
33+
<div>
34+
<Image
35+
src={gameImage}
36+
alt="Game Cover"
37+
width={gameWidth}
38+
height={gameHeight}
39+
className="absolute translate-x-[-50%] translate-y-[calc(-50%)] blur-sm"
40+
style={{ width: "auto", height: gameHeight - 52 }}
41+
/>
42+
<Button
43+
onClick={() => setIsPlaying(!isPlaying)}
44+
size={"lg"}
45+
className="absolute translate-x-[-50%] translate-y-[calc(-50%)] text-3xl"
46+
>
47+
Play
48+
</Button>
49+
</div>
50+
) : (
51+
<div>
52+
<iframe
53+
src={`https://itch.io/embed-upload/${embedID}?color=110e1a`}
54+
width={gameWidth}
55+
height={gameHeight}
56+
></iframe>
57+
</div>
58+
)}
59+
</div>
60+
);
61+
}

0 commit comments

Comments
 (0)