Style still WIP but much better now
This commit is contained in:
parent
bf7fbdcb67
commit
037dea4e40
6 changed files with 113 additions and 61 deletions
|
@ -6,11 +6,17 @@ export class Config {
|
||||||
* The base URL of the PDS (Personal Data Server)
|
* The base URL of the PDS (Personal Data Server)
|
||||||
* @default "https://pds.witchcraft.systems"
|
* @default "https://pds.witchcraft.systems"
|
||||||
*/
|
*/
|
||||||
static readonly PDS_URL: string = "https://pds.witchcraft.systems";
|
static readonly PDS_URL: string = "https://ap.brid.gy";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base URL of the frontend service for linking to replies
|
* The base URL of the frontend service for linking to replies
|
||||||
* @default "https://deer.social"
|
* @default "https://deer.social"
|
||||||
*/
|
*/
|
||||||
static readonly FRONTEND_URL: string = "https://deer.social";
|
static readonly FRONTEND_URL: string = "https://deer.social";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum number of posts to fetch from the PDS per user
|
||||||
|
* @default 10
|
||||||
|
*/
|
||||||
|
static readonly MAX_POSTS_PER_USER: number = 1;
|
||||||
}
|
}
|
|
@ -14,9 +14,11 @@
|
||||||
<div id="Account">
|
<div id="Account">
|
||||||
<h1 id="Header">ATProto PDS</h1>
|
<h1 id="Header">ATProto PDS</h1>
|
||||||
<p>Home to {accountsData.length} accounts</p>
|
<p>Home to {accountsData.length} accounts</p>
|
||||||
|
<div id="accountsList">
|
||||||
{#each accountsData as accountObject}
|
{#each accountsData as accountObject}
|
||||||
<AccountComponent account={accountObject} />
|
<AccountComponent account={accountObject} />
|
||||||
{/each}
|
{/each}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:catch error}
|
{:catch error}
|
||||||
<p>Error: {error.message}</p>
|
<p>Error: {error.message}</p>
|
||||||
|
@ -26,9 +28,11 @@
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
{:then postsData}
|
{:then postsData}
|
||||||
<div id="Feed">
|
<div id="Feed">
|
||||||
|
<div id="spacer"></div>
|
||||||
{#each postsData as postObject}
|
{#each postsData as postObject}
|
||||||
<PostComponent post={postObject as Post} />
|
<PostComponent post={postObject as Post} />
|
||||||
{/each}
|
{/each}
|
||||||
|
<div id="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
{/await}
|
{/await}
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,19 +52,39 @@
|
||||||
}
|
}
|
||||||
#Feed {
|
#Feed {
|
||||||
width: 65%;
|
width: 65%;
|
||||||
height: 80vh;
|
height: 100vh;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
#spacer {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
height: 10vh;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
#Account {
|
#Account {
|
||||||
width: 35%;
|
width: 35%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
border: 1px solid #8054f0;
|
||||||
|
background-color: #0d0620;
|
||||||
height: 80vh;
|
height: 80vh;
|
||||||
overflow-y: scroll;
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #070311;
|
|
||||||
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
}
|
||||||
|
#accountsList {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow-y: scroll;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
#Header {
|
#Header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
|
|
27
src/app.css
27
src/app.css
|
@ -6,10 +6,27 @@
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 0px;
|
width: 0px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background: transparent;
|
||||||
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: none;
|
||||||
scrollbar-color: transparent transparent;
|
scrollbar-color: transparent transparent;
|
||||||
-ms-overflow-style: none; /* IE and Edge */
|
-ms-overflow-style: none; /* IE and Edge */
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
|
@ -45,8 +62,10 @@ h1 {
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
max-width: 1400px;
|
max-width: 1400px;
|
||||||
margin: 0 auto;
|
margin: 0;
|
||||||
padding: 2rem;
|
padding: 0;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,49 +1,48 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { AccountMetadata } from "./pdsfetch";
|
import type { AccountMetadata } from "./pdsfetch";
|
||||||
const { account }: { account: AccountMetadata } = $props();
|
const { account }: { account: AccountMetadata } = $props();
|
||||||
import { Config } from "../../config";
|
import { Config } from "../../config";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a id="link" href="{Config.FRONTEND_URL}/profile/{account.did}">
|
<a id="link" href="{Config.FRONTEND_URL}/profile/{account.did}">
|
||||||
<div id="accountContainer">
|
<div id="accountContainer">
|
||||||
{#if account.avatarCid}
|
{#if account.avatarCid}
|
||||||
<img
|
<img
|
||||||
id="avatar"
|
id="avatar"
|
||||||
alt="avatar of {account.displayName}"
|
alt="avatar of {account.displayName}"
|
||||||
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
|
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div id="accountName">
|
<div id="accountName">
|
||||||
{account.displayName || account.handle || account.did}
|
{account.displayName || account.handle || account.did}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#accountContainer {
|
#accountContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: start;
|
text-align: start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #0d0620;
|
background-color: #12082b;
|
||||||
padding: 4%;
|
padding: 0px;
|
||||||
margin: 10px;
|
margin-bottom: 15px;
|
||||||
|
border: 1px solid #8054f0;
|
||||||
|
}
|
||||||
|
#accountName {
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
|
||||||
/* round corners */
|
/* replace overflow with ellipsis */
|
||||||
border-radius: 10px;
|
overflow: hidden;
|
||||||
}
|
text-overflow: ellipsis;
|
||||||
#accountName {
|
white-space: nowrap;
|
||||||
margin-left: 10px;
|
max-width: 80%;
|
||||||
font-size: 0.9em;
|
}
|
||||||
|
#avatar {
|
||||||
/* replace overflow with ellipsis */
|
width: 50px;
|
||||||
overflow: hidden;
|
height: 50px;
|
||||||
text-overflow: ellipsis;
|
margin: 0px;
|
||||||
white-space: nowrap;
|
border-right: #8054f0 1px solid;
|
||||||
max-width: 80%;
|
}
|
||||||
}
|
|
||||||
#avatar {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -25,18 +25,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="postContent">
|
<div id="postContent">
|
||||||
{#if post.replyingUri}
|
{#if post.replyingUri}
|
||||||
<a
|
<a
|
||||||
id="replyingText"
|
id="replyingText"
|
||||||
href="https://deer.social/profile/{post.replyingUri.repo}/post/{post
|
href="{Config.FRONTEND_URL}/profile/{post.replyingUri.repo}/post/{post
|
||||||
.replyingUri.rkey}">replying to {post.replyingUri.repo}</a
|
.replyingUri.rkey}">replying to {post.replyingUri.repo}</a
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
<p>{post.text}</p>
|
<div id="postText">{post.text}</div>
|
||||||
|
|
||||||
{#if post.quotingUri}
|
{#if post.quotingUri}
|
||||||
<a
|
<a
|
||||||
id="quotingText"
|
id="quotingText"
|
||||||
href="https://deer.social/profile/{post.quotingUri.repo}/post/{post
|
href="{Config.FRONTEND_URL}/profile/{post.quotingUri.repo}/post/{post
|
||||||
.quotingUri.rkey}">quoting {post.quotingUri.repo}</a
|
.quotingUri.rkey}">quoting {post.quotingUri.repo}</a
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -66,7 +65,8 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border: 1px solid #8054f0;
|
border: 1px solid #8054f0;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
margin-bottom: -1px;
|
margin-bottom: 15px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
#postHeader {
|
#postHeader {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -78,6 +78,7 @@
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
border-bottom: 1px solid #8054f0;
|
border-bottom: 1px solid #8054f0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
#postContent {
|
#postContent {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -86,22 +87,25 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #0d0620;
|
background-color: #0d0620;
|
||||||
color: white;
|
color: white;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
#replyingText {
|
#replyingText {
|
||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
color: white;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
#postText {
|
#postText {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
#headerText {
|
#headerText {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
text-align: start;
|
text-align: start;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#avatar {
|
#avatar {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|
|
@ -164,7 +164,7 @@ const fetchPosts = async (did: string) => {
|
||||||
params: {
|
params: {
|
||||||
repo: did as At.Identifier,
|
repo: did as At.Identifier,
|
||||||
collection: "app.bsky.feed.post",
|
collection: "app.bsky.feed.post",
|
||||||
limit: 5,
|
limit: Config.MAX_POSTS_PER_USER,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue