hybrid-diagram.tsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /**
  2. * Clean HTML/CSS hybrid architecture diagram — brand-led, no image assets.
  3. */
  4. export function HybridDiagram() {
  5. return (
  6. <div className="space-y-6">
  7. {/* Flow: users → private → relayer → public */}
  8. <div className="grid gap-4 lg:grid-cols-[1fr_auto_1fr_auto_1fr] lg:items-center">
  9. <DiagramBox
  10. tone="muted"
  11. title="Users & apps"
  12. lines={["Wallets", "Services", "This portal"]}
  13. />
  14. <Arrow />
  15. <DiagramBox
  16. tone="accent"
  17. title="Private layer"
  18. lines={[
  19. "Permissioned validators",
  20. "Fast finality",
  21. "Confidential payloads",
  22. ]}
  23. />
  24. <Arrow />
  25. <DiagramBox
  26. tone="depth"
  27. title="Relayer"
  28. lines={["Reads private state", "Builds commitment", "Posts to public"]}
  29. />
  30. </div>
  31. <div className="flex justify-center lg:justify-end lg:pr-[12%]">
  32. <div className="hidden h-8 w-px bg-gradient-to-b from-depth to-proof lg:block" />
  33. </div>
  34. <div className="grid gap-4 lg:grid-cols-[1fr_1fr] lg:gap-6">
  35. <DiagramBox
  36. tone="proof"
  37. title="Public anchor chain"
  38. lines={[
  39. "Open / auditable",
  40. "State roots & proofs",
  41. "Anyone can verify anchors",
  42. ]}
  43. />
  44. <DiagramBox
  45. tone="muted"
  46. title="Indexer → portal"
  47. lines={[
  48. "Streams blocks & txs",
  49. "Stores history (Doltgres later)",
  50. "Powers the explorer",
  51. ]}
  52. />
  53. </div>
  54. <p className="text-center text-xs text-muted-foreground">
  55. Private speed for work · public proof for trust · portal to follow both
  56. </p>
  57. </div>
  58. );
  59. }
  60. function DiagramBox({
  61. title,
  62. lines,
  63. tone,
  64. }: {
  65. title: string;
  66. lines: string[];
  67. tone: "accent" | "proof" | "depth" | "muted";
  68. }) {
  69. const ring =
  70. tone === "accent"
  71. ? "border-accent/40 bg-accent-muted/30"
  72. : tone === "proof"
  73. ? "border-proof/40 bg-proof-muted/30"
  74. : tone === "depth"
  75. ? "border-depth/50 bg-depth-muted/40"
  76. : "border-border bg-card";
  77. const titleColor =
  78. tone === "accent"
  79. ? "text-accent-hover"
  80. : tone === "proof"
  81. ? "text-proof"
  82. : tone === "depth"
  83. ? "text-anchored"
  84. : "text-foreground";
  85. return (
  86. <div className={`rounded-2xl border p-5 ${ring}`}>
  87. <p className={`font-display text-sm font-semibold tracking-tight ${titleColor}`}>
  88. {title}
  89. </p>
  90. <ul className="mt-3 space-y-1.5">
  91. {lines.map((line) => (
  92. <li key={line} className="text-xs leading-relaxed text-muted-foreground">
  93. {line}
  94. </li>
  95. ))}
  96. </ul>
  97. </div>
  98. );
  99. }
  100. function Arrow() {
  101. return (
  102. <div
  103. className="flex items-center justify-center text-muted-foreground"
  104. aria-hidden
  105. >
  106. <span className="hidden font-mono text-lg lg:inline">→</span>
  107. <span className="font-mono text-lg lg:hidden">↓</span>
  108. </div>
  109. );
  110. }