Skip to content

Commit 321ffc4

Browse files
authored
Merge pull request #3983 from RSSNext/hotfix/5.23
feat: fix og render and re-design og style
2 parents 06a88b0 + 3d6c3e0 commit 321ffc4

File tree

6 files changed

+175
-163
lines changed

6 files changed

+175
-163
lines changed

apps/ssr/global.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { name } from "../../package.json"
2-
31
export const defineGlobalConstants = () => {
42
Object.assign(globalThis, {
5-
APP_NAME: name,
3+
APP_NAME: "Folo",
64
})
75
}

apps/ssr/src/lib/seo.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { Document } from "linkedom"
21
import xss from "xss"
32

43
export function buildSeoMetaTags(

apps/ssr/src/router/og/__base.tsx

Lines changed: 75 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,115 @@ export const OGCanvas = ({ children, seed }: { children: React.ReactNode; seed:
77
return (
88
<div
99
style={{
10-
background: `linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%)`,
10+
background: "#0a0f1a",
1111
width: "100%",
1212
height: "100%",
1313
display: "flex",
14-
textAlign: "center",
15-
alignItems: "center",
16-
justifyContent: "center",
1714
position: "relative",
15+
fontFamily: "SN Pro",
16+
color: "#e6edf3",
1817
}}
1918
>
20-
{/* Subtle background pattern */}
19+
{/* Background Grid Pattern */}
2120
<div
2221
style={{
2322
position: "absolute",
2423
top: 0,
2524
left: 0,
2625
width: "100%",
2726
height: "100%",
28-
background: `radial-gradient(circle at 20% 80%, ${bgAccent}15 0%, transparent 50%), radial-gradient(circle at 80% 20%, ${bgAccentLight}10 0%, transparent 50%)`,
29-
opacity: 0.6,
27+
background: `
28+
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
29+
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)
30+
`,
31+
backgroundSize: "40px 40px",
3032
}}
3133
/>
32-
33-
{/* Grid pattern overlay */}
34+
{/* Background Glows */}
3435
<div
3536
style={{
3637
position: "absolute",
3738
top: 0,
3839
left: 0,
3940
width: "100%",
4041
height: "100%",
41-
backgroundImage: "radial-gradient(circle, #ffffff08 1px, transparent 1px)",
42-
backgroundSize: "32px 32px",
43-
opacity: 0.3,
42+
background: `
43+
radial-gradient(circle at 15% 20%, ${bgAccent}20 0%, transparent 40%),
44+
radial-gradient(circle at 85% 80%, ${bgAccentLight}15 0%, transparent 40%)
45+
`,
4446
}}
4547
/>
4648

47-
{/* Main content card */}
49+
{/* Main layout container */}
4850
<div
4951
style={{
50-
position: "relative",
51-
width: "calc(100% - 100px)",
52-
height: "calc(100% - 100px)",
5352
display: "flex",
54-
alignItems: "center",
55-
justifyContent: "space-between",
56-
background: "linear-gradient(145deg, #ffffff 0%, #fafafa 100%)",
57-
borderRadius: 32,
58-
border: "1px solid #e5e5e5",
59-
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1)",
60-
gap: "3rem",
61-
padding: "3rem",
53+
flexDirection: "column",
54+
width: "100%",
55+
height: "100%",
56+
padding: "40px 60px",
57+
gap: 40,
6258
}}
6359
>
64-
{/* Brand mark */}
60+
{/* Header */}
6561
<div
6662
style={{
67-
position: "absolute",
68-
right: 32,
69-
bottom: 32,
7063
display: "flex",
71-
alignItems: "center",
7264
justifyContent: "space-between",
73-
gap: "1rem",
74-
opacity: 0.8,
65+
alignItems: "center",
66+
width: "100%",
7567
}}
7668
>
77-
<FollowIcon />
78-
<span
79-
style={{
80-
fontSize: "2rem",
81-
color: "#FF5C02",
82-
fontWeight: 700,
83-
letterSpacing: "-0.02em",
84-
}}
85-
>
86-
Folo
87-
</span>
69+
{/* Follow Logo */}
70+
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
71+
<FollowIcon />
72+
<span
73+
style={{ fontSize: 28, fontWeight: "bold", color: "white", letterSpacing: "0.05em" }}
74+
>
75+
Folo
76+
</span>
77+
</div>
78+
79+
{/* AI RSS */}
80+
<div style={{ display: "flex", alignItems: "center", gap: 12 }}>
81+
<span style={{ fontSize: 20, color: "#afb8c1" }}>Follow everything in one place</span>
82+
<RSSIcon color={bgAccent || "#e6edf3"} />
83+
</div>
8884
</div>
8985

90-
{children}
86+
{/* Content */}
87+
<div
88+
style={{
89+
flex: 1,
90+
display: "flex",
91+
alignItems: "center",
92+
justifyContent: "center",
93+
width: "100%",
94+
}}
95+
>
96+
{children}
97+
</div>
9198
</div>
9299
</div>
93100
)
94101
}
95102

103+
function RSSIcon({ color }: { color: string }) {
104+
return (
105+
<svg width="40" height="40" viewBox="0 0 24 24" fill="none">
106+
<path
107+
d="M8.24 2.546c-2.117.11-3.311.502-4.229 1.387-.813.783-1.204 1.745-1.401 3.439-.062.542-.07 1.047-.07 4.628 0 3.581.008 4.086.07 4.628.197 1.694.588 2.656 1.401 3.439.804.775 1.708 1.131 3.361 1.323.542.062 1.047.07 4.628.07 3.581 0 4.086-.008 4.628-.07 1.653-.192 2.557-.548 3.361-1.323.813-.783 1.204-1.745 1.401-3.439.062-.542.07-1.047.07-4.628 0-3.581-.008-4.086-.07-4.628-.197-1.694-.588-2.656-1.401-3.439-.796-.768-1.702-1.128-3.32-1.319-.49-.058-1.094-.068-4.369-.074-2.09-.004-3.917-.001-4.06.006m1.1 4.494c2.476.272 4.679 1.553 6.087 3.54 1.06 1.495 1.627 3.369 1.565 5.167-.015.43-.033.544-.11.704a1.06 1.06 0 0 1-.618.53c-.252.075-.328.074-.579-.007a.976.976 0 0 1-.605-.542c-.079-.184-.09-.272-.084-.692.024-1.916-.614-3.527-1.913-4.822-1.306-1.302-2.917-1.941-4.823-1.913-.421.006-.506-.004-.69-.084-.373-.162-.582-.485-.582-.901 0-.489.302-.864.792-.983.181-.044 1.152-.042 1.56.003m-.411 3.543a5.77 5.77 0 0 1 2.25.93 6.866 6.866 0 0 1 1.308 1.308c.611.86.984 1.979 1.002 3.003.005.301-.01.434-.063.556-.154.353-.552.619-.926.619-.373 0-.777-.269-.921-.615-.036-.086-.081-.356-.1-.6-.074-.942-.371-1.596-1.019-2.244-.648-.648-1.302-.945-2.244-1.019-.494-.039-.691-.104-.891-.293a.984.984 0 0 1-.231-1.128c.148-.316.391-.505.766-.594.119-.028.671.012 1.069.077m.172 3.552c.313.143.622.45.766.761.098.21.113.293.113.604 0 .31-.015.393-.112.6a1.698 1.698 0 0 1-.764.767c-.21.098-.293.113-.604.113-.31 0-.393-.015-.6-.112a1.698 1.698 0 0 1-.767-.764c-.098-.21-.113-.293-.113-.604 0-.32.014-.389.124-.62.273-.573.795-.893 1.417-.867.223.009.362.041.54.122"
108+
fill={color}
109+
fillRule="evenodd"
110+
/>
111+
</svg>
112+
)
113+
}
114+
96115
function FollowIcon() {
97116
return (
98-
<svg width="48" height="48" viewBox="0 0 91 89" fill="none" xmlns="http://www.w3.org/2000/svg">
99-
<rect width="91" height="89" rx="26" fill="#FF5C02" />
117+
<svg width="48" height="48" viewBox="0 0 91 89" fill="none">
118+
<rect width="91" height="89" rx="20" fill="#FF5C02" />
100119
<path
101120
d="M69.0242 22.0703H37.1962C33.3473 22.0703 30.2272 25.1785 30.2272 29.0126C30.2272 32.8468 33.3473 35.955 37.1962 35.955H69.0242C72.8731 35.955 75.9933 32.8468 75.9933 29.0126C75.9933 25.1785 72.8731 22.0703 69.0242 22.0703Z"
102121
fill="white"
@@ -140,7 +159,7 @@ export const OGAvatar: React.FC<{ base64?: Nullable<string>; title: string }> =
140159
base64,
141160
title,
142161
}) => {
143-
const [, , , bgAccent, bgAccentLight, bgAccentUltraLight] = getBackgroundGradient(title)
162+
const [, , , bgAccent, bgAccentLight] = getBackgroundGradient(title)
144163
return (
145164
<>
146165
{base64 ? (
@@ -155,33 +174,32 @@ export const OGAvatar: React.FC<{ base64?: Nullable<string>; title: string }> =
155174
<img
156175
src={base64}
157176
style={{
158-
width: 180,
159-
height: 180,
177+
width: 160,
178+
height: 160,
160179
borderRadius: "50%",
161-
border: "4px solid #ffffff",
162-
boxShadow:
163-
"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
180+
border: `3px solid ${bgAccentLight}50`,
181+
boxShadow: `0 0 25px ${bgAccent}40`,
164182
}}
165183
/>
166184
</div>
167185
) : (
168186
<div
169187
style={{
170188
position: "relative",
171-
width: 180,
172-
height: 180,
189+
width: 160,
190+
height: 160,
173191
borderRadius: "50%",
174192
display: "flex",
175193
alignItems: "center",
176194
justifyContent: "center",
177-
background: `linear-gradient(135deg, ${bgAccent} 0%, ${bgAccentLight} 50%, ${bgAccentUltraLight} 100%)`,
178-
border: "4px solid #ffffff",
179-
boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
195+
background: `linear-gradient(135deg, ${bgAccent} 0%, ${bgAccentLight} 100%)`,
196+
border: `3px solid ${bgAccentLight}50`,
197+
boxShadow: `0 0 25px ${bgAccent}40`,
180198
}}
181199
>
182200
<span
183201
style={{
184-
fontSize: 72,
202+
fontSize: 64,
185203
fontWeight: 700,
186204
color: "white",
187205
letterSpacing: "-0.02em",

apps/ssr/src/router/og/feed.tsx

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,55 +34,56 @@ export const renderFeedOG = async (apiClient: ApiClient, feedId: string) => {
3434
<div
3535
style={{
3636
display: "flex",
37-
flexGrow: 1,
37+
flexDirection: "column",
3838
alignItems: "center",
3939
justifyContent: "center",
40-
flexShrink: 0,
41-
width: "40%",
40+
textAlign: "center",
41+
gap: 15,
42+
padding: "0 60px",
4243
}}
4344
>
4445
<OGAvatar base64={imageBase64} title={title!} />
45-
</div>
46-
<div
47-
style={{
48-
display: "flex",
49-
flexGrow: 1,
50-
flexShrink: 1,
51-
width: "60%",
52-
flexDirection: "column",
53-
overflow: "hidden",
54-
textAlign: "left",
55-
justifyContent: "center",
56-
}}
57-
>
58-
<h3
46+
<div
5947
style={{
60-
color: "#000000",
61-
fontSize: "3.5rem",
62-
whiteSpace: "nowrap",
48+
display: "flex",
49+
flexDirection: "column",
50+
alignItems: "center",
51+
gap: 10,
52+
overflow: "hidden",
6353
}}
6454
>
65-
{title}
66-
</h3>
67-
{description && (
68-
<p
55+
<h3
6956
style={{
70-
fontSize: "1.8rem",
71-
height: "5.6rem",
72-
overflow: "hidden",
73-
lineClamp: 2,
74-
color: "#000000",
57+
color: "#e6edf3",
58+
fontSize: "3.2rem",
59+
fontWeight: 600,
60+
margin: 0,
7561
}}
7662
>
77-
{description}
78-
</p>
79-
)}
80-
63+
{title}
64+
</h3>
65+
{description && (
66+
<p
67+
style={{
68+
fontSize: "1.8rem",
69+
color: "#8b949e",
70+
margin: 0,
71+
maxHeight: "5.4rem",
72+
lineHeight: 1.5,
73+
overflow: "hidden",
74+
}}
75+
>
76+
{description}
77+
</p>
78+
)}
79+
</div>
8180
<p
8281
style={{
8382
fontSize: "1.5rem",
84-
color: "#000000",
83+
color: "#afb8c1",
8584
fontWeight: 500,
85+
margin: 0,
86+
paddingTop: 10,
8687
}}
8788
>
8889
{formatNumber(feed.data.subscriptionCount || 0)} followers with{" "}

0 commit comments

Comments
 (0)