opengraph-image.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import { readFile } from "node:fs/promises";
  2. import { join } from "node:path";
  3. import { ImageResponse } from "next/og";
  4. export const alt =
  5. "Eric Wu - SDE II at AWS building agentic systems and generative UI";
  6. export const size = { width: 1200, height: 630 };
  7. export const contentType = "image/png";
  8. // Static cuts of the site's faces (Latin subsets, OFL): Fraunces at the
  9. // headline's soft settings (SOFT 100, opsz 144) and Figtree for the text.
  10. const font = (file: string) =>
  11. readFile(join(process.cwd(), "assets/fonts/og", file));
  12. const INK = "#17161b";
  13. const MUTED = "#6c6874";
  14. // The name's glacier-to-ember gradient, mixed in oklab like the site's.
  15. const NAME =
  16. "#2a86dd 5%, #707ec5 27.5%, #9972ad 50%, #bb6294 72.5%, #d9487a 95%";
  17. /** The hero card as a link preview: headline, glass period, and bio. */
  18. export default async function Image() {
  19. const [display, displayItalic, text, textBold] = await Promise.all([
  20. font("fraunces-600-soft.ttf"),
  21. font("fraunces-600-soft-italic.ttf"),
  22. font("figtree-400.ttf"),
  23. font("figtree-600.ttf"),
  24. ]);
  25. return new ImageResponse(
  26. <div
  27. style={{
  28. width: "100%",
  29. height: "100%",
  30. display: "flex",
  31. padding: 44,
  32. background:
  33. "radial-gradient(circle at 0% 0%, rgba(42,134,221,0.22), transparent 58%), radial-gradient(circle at 100% 100%, rgba(217,72,122,0.18), transparent 55%), #f6f2f2",
  34. fontFamily: "Figtree",
  35. color: INK,
  36. }}
  37. >
  38. <div
  39. style={{
  40. flex: 1,
  41. display: "flex",
  42. flexDirection: "column",
  43. justifyContent: "space-between",
  44. padding: "52px 64px 58px",
  45. borderRadius: 44,
  46. background: "rgba(255,255,255,0.66)",
  47. border: "1.5px solid rgba(255,255,255,0.9)",
  48. boxShadow:
  49. "0 30px 60px -30px rgba(23,22,27,0.28), 0 2px 8px -2px rgba(23,22,27,0.06)",
  50. }}
  51. >
  52. <div
  53. style={{
  54. display: "flex",
  55. alignItems: "center",
  56. justifyContent: "space-between",
  57. }}
  58. >
  59. <div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
  60. <span style={{ fontSize: 30, fontWeight: 600 }}>Eric Wu</span>
  61. <span style={{ fontSize: 24, color: MUTED }}>Seattle, WA</span>
  62. </div>
  63. <span
  64. style={{
  65. fontSize: 24,
  66. fontWeight: 600,
  67. padding: "12px 26px",
  68. borderRadius: 999,
  69. background: "rgba(255,255,255,0.9)",
  70. boxShadow: "0 8px 22px -12px rgba(23,22,27,0.35)",
  71. }}
  72. >
  73. ericwu.me
  74. </span>
  75. </div>
  76. <div
  77. style={{
  78. display: "flex",
  79. alignItems: "baseline",
  80. fontFamily: "Fraunces",
  81. fontSize: 156,
  82. fontWeight: 600,
  83. letterSpacing: -3.5,
  84. lineHeight: 1,
  85. }}
  86. >
  87. <span>Hey, I&apos;m</span>
  88. <span
  89. style={{
  90. marginLeft: 38,
  91. paddingRight: 8,
  92. fontStyle: "italic",
  93. backgroundImage: `linear-gradient(100deg, ${NAME})`,
  94. backgroundClip: "text",
  95. color: "transparent",
  96. }}
  97. >
  98. Eric
  99. </span>
  100. {/* The glass period, resting on the baseline as it does in light mode. */}
  101. <div
  102. style={{
  103. display: "flex",
  104. position: "relative",
  105. top: -19,
  106. width: 32,
  107. height: 32,
  108. borderRadius: 999,
  109. background:
  110. "radial-gradient(circle at 34% 30%, #6a717d 0%, #23262d 46%, #08090b 100%)",
  111. boxShadow: "0 7px 12px -6px rgba(0,0,0,0.45)",
  112. }}
  113. >
  114. <div
  115. style={{
  116. position: "absolute",
  117. top: 6,
  118. left: 8,
  119. width: 11,
  120. height: 7,
  121. borderRadius: 999,
  122. background: "rgba(255,255,255,0.75)",
  123. }}
  124. />
  125. </div>
  126. </div>
  127. <span style={{ fontSize: 34, lineHeight: 1.35, color: MUTED }}>
  128. An SDE II at AWS building agentic systems and generative UI.
  129. </span>
  130. </div>
  131. </div>,
  132. {
  133. ...size,
  134. fonts: [
  135. { name: "Fraunces", data: display, weight: 600, style: "normal" },
  136. { name: "Fraunces", data: displayItalic, weight: 600, style: "italic" },
  137. { name: "Figtree", data: text, weight: 400, style: "normal" },
  138. { name: "Figtree", data: textBold, weight: 600, style: "normal" },
  139. ],
  140. },
  141. );
  142. }