Compare commits

..

3 commits

Author SHA1 Message Date
c348ed5d46 Fix users with no profile record not being shown ()
Co-authored-by: Casey <hatkidchan@gmail.com>
Co-authored-by: Ari <ariadna@hey.com>
Reviewed-on: 
Reviewed-by: Ariadna <ariadna@hey.com>
2025-05-30 03:05:05 +00:00
273741d221
Update the info on theming in README.md 2025-05-29 20:19:25 +09:00
Ari
c77cdb4b79 Custom themes and config overrides ()
Co-authored-by: Astra <me@astrra.space>
Reviewed-on: 
Reviewed-by: Astra <me@astrra.space>
Co-authored-by: Ari <ariadna@hey.com>
Co-committed-by: Ari <ariadna@hey.com>
2025-05-29 08:38:03 +00:00
5 changed files with 38 additions and 21 deletions

View file

@ -46,16 +46,11 @@ we use our own CI/CD workflow at [`.forgejo/workflows/deploy.yaml`](.forgejo/wor
## theming
the colors are designated in [`src/app.css`](src/app.css) as variables, go crazy with them
themes are located in the `themes/` directory, you can create your own theme by copying one of the existing themes and modifying it to your liking.
the rest is done by editing the css files and style tags directly, good luck
currently, the name of the theme is determined by the directory name, and the theme itself is defined in `theme.css` inside that directory.
relevant files:
- [`src/App.svelte`](src/App.svelte)
- [`src/app.css`](src/app.css)
- [`src/lib/AccountComponent.svelte`](src/lib/AccountComponent.svelte)
- [`src/lib/PostComponent.svelte`](src/lib/PostComponent.svelte)
you can switch themes by changing the `theme` property in `config.ts`.
the favicon is located at [`public/favicon.ico`](public/favicon.ico)

View file

@ -12,10 +12,14 @@
alt="avatar of {account.displayName}"
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
/>
<div id="accountName">
{account.displayName || account.handle || account.did}
</div>
{:else}
<div id="accountName" class="no-avatar">
{account.displayName || account.handle || account.did}
</div>
{/if}
<div id="accountName">
{account.displayName || account.handle || account.did}
</div>
</div>
</a>

View file

@ -132,7 +132,13 @@ const getDidsFromPDS = async (): Promise<At.Did[]> => {
const getAccountMetadata = async (
did: `did:${string}:${string}`,
) => {
// gonna assume self exists in the app.bsky.actor.profile
const account: AccountMetadata = {
did: did,
handle: "", // Guaranteed to be filled out later
displayName: "",
avatarCid: null,
};
try {
const { data } = await rpc.get("com.atproto.repo.getRecord", {
params: {
@ -142,21 +148,22 @@ const getAccountMetadata = async (
},
});
const value = data.value as AppBskyActorProfile.Record;
const handle = await blueskyHandleFromDid(did);
const account: AccountMetadata = {
did: did,
handle: handle,
displayName: value.displayName || "",
avatarCid: null,
};
account.displayName = value.displayName || "";
if (value.avatar) {
account.avatarCid = value.avatar.ref["$link"];
}
return account;
} catch (e) {
console.error(`Error fetching metadata for ${did}:`, e);
console.warn(`Error fetching profile for ${did}:`, e);
}
try {
account.handle = await blueskyHandleFromDid(did);
} catch (e) {
console.error(`Error fetching handle for ${did}:`, e);
return null;
}
return account;
};
const getAllMetadataFromPds = async (): Promise<AccountMetadata[]> => {

View file

@ -237,6 +237,7 @@ a:hover {
margin-right: 4px;
border: 4px solid var(--border-color);
box-shadow: var(--border-color) 10px 10px;
min-height: 30px;
}
#accountName {
margin-left: 10px;
@ -249,6 +250,10 @@ a:hover {
white-space: nowrap;
}
.no-avatar {
margin-left: 40px !important;
}
/* App.Svelte */
/* desktop style */

View file

@ -235,6 +235,7 @@ a:hover {
padding: 0px;
margin-bottom: 15px;
border: 1px solid var(--border-color);
min-height: 30px;
}
#accountName {
margin-left: 10px;
@ -247,6 +248,11 @@ a:hover {
white-space: nowrap;
}
.no-avatar {
margin-left: 70px !important;
}
/* App.Svelte */
/* desktop style */