Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/lib/components/Embed.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script lang="ts">
import LL from "$lib/i18n/i18n-svelte";
import { getContext } from "svelte"

interface Props {
description?: string,
thumbnailURL?: string,
url?: string,
layout?: boolean
}
let { description, thumbnailURL, url, layout } : Props = $props();

if (!layout) {
const embed = getContext("embed") as {
description: string,
thumbnailURL: string
};
if (description)
embed.description = description;
if (thumbnailURL)
embed.thumbnailURL = thumbnailURL;
}
</script>

<svelte:head>
{#if layout && url && description && thumbnailURL}
<meta name="title" content={$LL.meta.aquanet()} />
<meta name="description" content={description} />

<meta property="og:type" content="website" />
<meta property="og:title" content={$LL.meta.aquanet()} />
<meta property="og:description" content={description} />
<meta property="og:image" content={`${new URL(url).origin}/net/embed/${thumbnailURL}`} />
<meta property="og:url" content={url} />
<meta property="og:image:type" content="image/png" />

<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:title" content={$LL.meta.aquanet()} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={`${new URL(url).origin}/net/embed/${thumbnailURL}`} />
{ /if}
</svelte:head>
39 changes: 0 additions & 39 deletions src/lib/components/profile/ProfileThumbnailEmbed.svelte

This file was deleted.

16 changes: 13 additions & 3 deletions src/lib/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ const en = {
wacca: "Wacca"
},
embed: {
noGamesPlayed: "This user has not played any games",
description: "{user:string} is leaderboard rank #{rank:string} with rating {rating:string}",
descriptionNoGame: "{user:string} has not played on {aquadx:string}"
rankings: {
description: "{game:string} Rankings"
},
profile: {
rating: {
a: "Rating ",
b: "{rating:string}",
c: " rank ",
d: "{rank:string}"
},
description: "{user:string} is an {aquadx:string} user with rating {rating:string} and leaderboard rank #{rank:string}",
descriptionNoGame: "{user:string} is an {aquadx:string} user."
}
},
errors: {
generic: {
Expand Down
106 changes: 77 additions & 29 deletions src/lib/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,49 @@ type RootTranslation = {
wacca: string
}
embed: {
/**
* T​h​i​s​ ​u​s​e​r​ ​h​a​s​ ​n​o​t​ ​p​l​a​y​e​d​ ​a​n​y​ ​g​a​m​e​s
*/
noGamesPlayed: string
/**
* {​u​s​e​r​}​ ​i​s​ ​l​e​a​d​e​r​b​o​a​r​d​ ​r​a​n​k​ ​#​{​r​a​n​k​}​ ​w​i​t​h​ ​r​a​t​i​n​g​ ​{​r​a​t​i​n​g​}
* @param {string} rank
* @param {string} rating
* @param {string} user
*/
description: RequiredParams<'rank' | 'rating' | 'user'>
/**
* {​u​s​e​r​}​ ​h​a​s​ ​n​o​t​ ​p​l​a​y​e​d​ ​o​n​ ​{​a​q​u​a​d​x​}
* @param {string} aquadx
* @param {string} user
*/
descriptionNoGame: RequiredParams<'aquadx' | 'user'>
rankings: {
/**
* {​g​a​m​e​}​ ​R​a​n​k​i​n​g​s
* @param {string} game
*/
description: RequiredParams<'game'>
}
profile: {
rating: {
/**
* R​a​t​i​n​g​
*/
a: string
/**
* {​r​a​t​i​n​g​}
* @param {string} rating
*/
b: RequiredParams<'rating'>
/**
* ​r​a​n​k​
*/
c: string
/**
* {​r​a​n​k​}
* @param {string} rank
*/
d: RequiredParams<'rank'>
}
/**
* {​u​s​e​r​}​ ​i​s​ ​a​n​ ​{​a​q​u​a​d​x​}​ ​u​s​e​r​ ​w​i​t​h​ ​r​a​t​i​n​g​ ​{​r​a​t​i​n​g​}​ ​a​n​d​ ​l​e​a​d​e​r​b​o​a​r​d​ ​r​a​n​k​ ​#​{​r​a​n​k​}
* @param {string} aquadx
* @param {string} rank
* @param {string} rating
* @param {string} user
*/
description: RequiredParams<'aquadx' | 'rank' | 'rating' | 'user'>
/**
* {​u​s​e​r​}​ ​i​s​ ​a​n​ ​{​a​q​u​a​d​x​}​ ​u​s​e​r​.
* @param {string} aquadx
* @param {string} user
*/
descriptionNoGame: RequiredParams<'aquadx' | 'user'>
}
}
errors: {
generic: {
Expand Down Expand Up @@ -840,18 +866,40 @@ export type TranslationFunctions = {
wacca: () => LocalizedString
}
embed: {
/**
* This user has not played any games
*/
noGamesPlayed: () => LocalizedString
/**
* {user} is leaderboard rank #{rank} with rating {rating}
*/
description: (arg: { rank: string, rating: string, user: string }) => LocalizedString
/**
* {user} has not played on {aquadx}
*/
descriptionNoGame: (arg: { aquadx: string, user: string }) => LocalizedString
rankings: {
/**
* {game} Rankings
*/
description: (arg: { game: string }) => LocalizedString
}
profile: {
rating: {
/**
* Rating
*/
a: () => LocalizedString
/**
* {rating}
*/
b: (arg: { rating: string }) => LocalizedString
/**
* rank
*/
c: () => LocalizedString
/**
* {rank}
*/
d: (arg: { rank: string }) => LocalizedString
}
/**
* {user} is an {aquadx} user with rating {rating} and leaderboard rank #{rank}
*/
description: (arg: { aquadx: string, rank: string, rating: string, user: string }) => LocalizedString
/**
* {user} is an {aquadx} user.
*/
descriptionNoGame: (arg: { aquadx: string, user: string }) => LocalizedString
}
}
errors: {
generic: {
Expand Down
14 changes: 0 additions & 14 deletions src/lib/thumb/component.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/lib/thumb/component/background.ts

This file was deleted.

53 changes: 0 additions & 53 deletions src/lib/thumb/component/composition.ts

This file was deleted.

46 changes: 0 additions & 46 deletions src/lib/thumb/component/header.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/lib/thumb/component/profilePicture.ts

This file was deleted.

Loading