{level.title}
diff --git a/src/lib/localization/ko/level.ftl b/src/lib/localization/ko/level.ftl
index 86f7f1a..6579bd5 100644
--- a/src/lib/localization/ko/level.ftl
+++ b/src/lib/localization/ko/level.ftl
@@ -1,3 +1,6 @@
song-length = 노래 길이
bpm = BPM
-tiles = 타일 수
\ No newline at end of file
+tiles = 타일 수
+
+artists = 아티스트
+creators = 레벨 제작자
\ No newline at end of file
diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts
index b14db58..1646259 100644
--- a/src/lib/types/index.ts
+++ b/src/lib/types/index.ts
@@ -3,6 +3,20 @@ export interface APITag {
name: string
}
+export interface APIMember {
+ id: number
+ displayName: string
+ username: string | null
+ totalPp: number
+ avatar: string | null
+}
+
+export interface APIMusic {
+ id: number
+ name: string
+ artists: APIMember[]
+}
+
export interface APILevel {
id: number
appendingTitle: string | null
@@ -21,7 +35,8 @@ export interface APILevel {
title: string
// file
// thumbnail
- // creators
+ creators: APIMember[]
tags: APITag[]
epilepsyWarning: boolean
+ music: APIMusic
}
diff --git a/src/lib/utils/avatar.ts b/src/lib/utils/avatar.ts
new file mode 100644
index 0000000..70f1b5e
--- /dev/null
+++ b/src/lib/utils/avatar.ts
@@ -0,0 +1,15 @@
+import type { APIMember } from '../types'
+import { env } from '$env/dynamic/public'
+import defaultDark from '$lib/assets/defaultAvatars/dark.png'
+import defaultLight from '$lib/assets/defaultAvatars/light.png'
+
+export const getAvatarUrl = (
+ user: APIMember,
+ usage: 'artist' | 'creator' | null = null
+): string => {
+ if (!user.username) {
+ return usage === 'artist' ? defaultDark : defaultLight
+ }
+
+ return `${env.PUBLIC_ACCOUNT_SERVICE_URL}/content/avatars/${user}/${user.avatar ?? 'default'}`
+}
diff --git a/src/lib/utils/converter.ts b/src/lib/utils/converter.ts
new file mode 100644
index 0000000..65f74c2
--- /dev/null
+++ b/src/lib/utils/converter.ts
@@ -0,0 +1,11 @@
+import type { User } from '@adofai-gg/ui'
+import type { APIMember } from '../types'
+import { getAvatarUrl } from './avatar'
+
+export const convertUser = (from: APIMember, usage: 'artist' | 'creator' | null = null): User => {
+ return {
+ avatarURL: getAvatarUrl(from, usage),
+ displayName: from.displayName,
+ isAdmin: false
+ }
+}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 4e30e76..cf244c3 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,4 +1,5 @@
@@ -20,6 +45,8 @@
+
+
@@ -38,7 +65,10 @@
}
.meta-area {
+ display: flex;
+ flex-direction: column;
grid-column: span 12;
+ gap: 20px;
}
@include breakpoint('md') {
diff --git a/src/routes/levels/[levelId]/+page.ts b/src/routes/levels/[levelId]/+page.ts
index 2ea034a..57bfc0c 100644
--- a/src/routes/levels/[levelId]/+page.ts
+++ b/src/routes/levels/[levelId]/+page.ts
@@ -14,6 +14,8 @@ export const load: PageLoad = async ({ params, fetch }) => {
const data: APILevel = await res.json()
+ console.log(data)
+
return {
level: data,
pageTitle: data.title