tangled
alpha
login
or
join now
veryroundbird.house
/
pds-dash
4
fork
atom
pds dash for shimaenaga.veryroundbird.house (based off of pds.witchcraft.systems)
4
fork
atom
overview
issues
pulls
pipelines
add some styling tweaks
veryroundbird.house
6 months ago
559cbff8
14169a6e
0/1
build.yml
failed
21s
+93
2 changed files
expand all
collapse all
unified
split
src
lib
GuestbookPostComponent.svelte
themes
birdrights
theme.css
+92
src/lib/GuestbookPostComponent.svelte
reviewed
···
1
1
+
<script lang="ts">
2
2
+
import { Post } from "./pdsfetch";
3
3
+
import { Config } from "../../config";
4
4
+
import { onMount } from "svelte";
5
5
+
import moment from "moment";
6
6
+
7
7
+
let { post }: { post: Post } = $props();
8
8
+
console.log(post);
9
9
+
</script>
10
10
+
11
11
+
<div class="postContainer">
12
12
+
<div class="postHeader">
13
13
+
{#if post.author.avatar}
14
14
+
<img
15
15
+
class="avatar"
16
16
+
src="{post.author.avatar}"
17
17
+
alt="avatar of {post.author.displayName}"
18
18
+
/>
19
19
+
{/if}
20
20
+
<div class="headerText">
21
21
+
<a class="displayName" href="{Config.FRONTEND_URL}/profile/{post.author.did}">{post.author.displayName}</a>
22
22
+
<p class="handle">
23
23
+
<a href="{Config.FRONTEND_URL}/profile/{post.author.handle}"
24
24
+
>@{post.author.handle}</a
25
25
+
>
26
26
+
<a
27
27
+
class="postLink" href="{Config.FRONTEND_URL}/profile/{post.author.did}/post/{post.record.id}"
28
28
+
>{moment(post.record.createdAt).isBefore(moment().subtract(1, "month"))
29
29
+
? moment(post.record.createdAt).format("MMM D, YYYY")
30
30
+
: moment(post.record.createdAt).fromNow()}</a>
31
31
+
</p>
32
32
+
</div>
33
33
+
</div>
34
34
+
<div class="postContent">
35
35
+
{#if post.record.quote}
36
36
+
<a
37
37
+
class="quotingText"
38
38
+
href="{Config.FRONTEND_URL}/profile/{post.record.quote.uri}/post/{post
39
39
+
.quotingUri.rkey}">quoting {post.quotingUri.repo}</a
40
40
+
>
41
41
+
{/if}
42
42
+
<div class="postText">{post.record.text}</div>
43
43
+
{#if post.record.imagesCid && post.record.imagesCid.length > 0}
44
44
+
<div id="carouselContainer">
45
45
+
<img
46
46
+
class="embedImages"
47
47
+
alt="Post Image {currentImageIndex + 1} of {post.record.imagesCid.length}"
48
48
+
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.record.author.did}&cid={post.record
49
49
+
.imagesCid[currentImageIndex]}"
50
50
+
/>
51
51
+
52
52
+
{#if post.imagesCid.length > 1}
53
53
+
<div class="carouselControls">
54
54
+
<button
55
55
+
id="prevBtn"
56
56
+
onclick={prevImage}
57
57
+
disabled={currentImageIndex === 0}>←</button
58
58
+
>
59
59
+
<div class="carouselIndicators">
60
60
+
{#each post.record.imagesCid as _, i}
61
61
+
<div
62
62
+
class="indicator {i === currentImageIndex ? 'active' : ''}"
63
63
+
></div>
64
64
+
{/each}
65
65
+
</div>
66
66
+
<button
67
67
+
class="nextBtn"
68
68
+
onclick={nextImage}
69
69
+
disabled={currentImageIndex === post.imagesCid.length - 1}
70
70
+
>→</button
71
71
+
>
72
72
+
</div>
73
73
+
{/if}
74
74
+
</div>
75
75
+
{/if}
76
76
+
{#if post.record.videosLinkCid}
77
77
+
<!-- svelte-ignore a11y_media_has_caption -->
78
78
+
<video
79
79
+
class="embedVideo"
80
80
+
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}"
81
81
+
controls
82
82
+
></video>
83
83
+
{/if}
84
84
+
{#if post.gifLink}
85
85
+
<img
86
86
+
class="embedVideo"
87
87
+
src="{post.record.gifLink}"
88
88
+
alt="Post GIF"
89
89
+
/>
90
90
+
{/if}
91
91
+
</div>
92
92
+
</div>
+1
themes/birdrights/theme.css
reviewed
···
429
429
padding: 10px;
430
430
gap: 10px;
431
431
z-index: 10;
432
432
+
grid-template-rows: auto 1fr;
432
433
}
433
434
434
435
#guestbookContents:popover-open {