The Open Standard for Generative UI
Enhance BuildChatSection styles and functionality (#323)
subham0d41f2e56181
diff --git a/docs/app/(home)/components/BuildChatSection/BuildChatSection.module.css b/docs/app/(home)/components/BuildChatSection/BuildChatSection.module.cssindex e88468323..6f3767d44 100644--- a/docs/app/(home)/components/BuildChatSection/BuildChatSection.module.css+++ b/docs/app/(home)/components/BuildChatSection/BuildChatSection.module.css@@ -81,7 +81,8 @@justify-content: center;gap: 0.625rem;height: 3rem;- padding-inline: 1.25rem;+ padding-left: 1.25rem;+ padding-right: 0.5rem;border: 0;border-radius: 999px;background: #000;@@ -94,6 +95,52 @@box-shadow: none;}+.ctaDesktopLabel {+ display: none;+ white-space: nowrap;+ font-family: "Inter Display", sans-serif;+ font-size: 18px;+ font-weight: 500;+ line-height: 1.5rem;+ color: #fff;+}++.ctaMobileLabel {+ position: relative;+ display: block;+ min-width: 0;+ flex: 1;+ overflow: hidden;+}++.ctaTicker {+ display: flex;+ width: max-content;+ align-items: center;+ animation: ctaTickerScroll 10s linear infinite;+}++.ctaTickerText {+ white-space: nowrap;+ padding-right: 2rem;+ font-family: "Inter Display", sans-serif;+ font-size: 18px;+ font-weight: 500;+ line-height: 1.5rem;+ color: #fff;+}++.iconBadge {+ display: flex;+ height: 2rem;+ width: 2rem;+ flex-shrink: 0;+ align-items: center;+ justify-content: center;+ border-radius: 999px;+ background: rgb(255 255 255 / 15%);+}+.iconFrame {position: relative;display: flex;@@ -120,14 +167,13 @@transform: scale(0.5);}-.ctaLabel {- position: relative;- white-space: nowrap;- font-family: "Inter Display", sans-serif;- font-size: 18px;- font-weight: 500;- line-height: 1.5rem;- color: #fff;+@keyframes ctaTickerScroll {+ 0% {+ transform: translateX(0);+ }+ 100% {+ transform: translateX(-50%);+ }}.mediaColumn {@@ -154,10 +200,9 @@.copyColumn {min-height: 0;- padding:16px;+ padding: 16px;}-.title {max-width: 430px;font-family: "Inter", sans-serif;@@ -180,6 +225,14 @@justify-content: flex-start;}+ .ctaDesktopLabel {+ display: inline;+ }++ .ctaMobileLabel {+ display: none;+ }+.mediaColumn {width: 600px;}diff --git a/docs/app/(home)/components/BuildChatSection/BuildChatSection.tsx b/docs/app/(home)/components/BuildChatSection/BuildChatSection.tsxindex b1987b610..59510327d 100644--- a/docs/app/(home)/components/BuildChatSection/BuildChatSection.tsx+++ b/docs/app/(home)/components/BuildChatSection/BuildChatSection.tsx@@ -11,6 +11,7 @@ import styles from "./BuildChatSection.module.css";// ---------------------------------------------------------------------------const CARD_SHADOW = "0px 8px 16px -4px rgba(22,34,51,0.08)";+const COMMAND = "npx @openuidev/cli@latest create";// ---------------------------------------------------------------------------// Sub-components@@ -36,7 +37,7 @@ function CtaButton() {if (copied) return;try {- await navigator.clipboard.writeText("npx @openuidev/cli@latest create");+ await navigator.clipboard.writeText(COMMAND);setCopied(true);resetTimeoutRef.current = setTimeout(() => {setCopied(false);@@ -48,32 +49,37 @@ function CtaButton() {return (<div className={styles.ctaWrap}>- <button- onClick={handleClick}- className={styles.ctaButton}- >- <span className={styles.iconFrame}>- <span- className={`${styles.iconLayer} ${copied ? styles.iconHidden : styles.iconVisible}`}- >- <CopyIcon />+ <button onClick={handleClick} className={styles.ctaButton}>+ <span className={styles.ctaDesktopLabel}>{COMMAND}</span>+ <span className={styles.ctaMobileLabel}>+ <span className={styles.ctaTicker}>+ <span className={styles.ctaTickerText}>{COMMAND}</span>+ <span aria-hidden="true" className={styles.ctaTickerText}>+ {COMMAND}+ </span></span>- <svg- className={`${styles.iconLayer} ${copied ? styles.iconVisible : styles.iconHidden}`}- fill="none"- viewBox="0 0 14 14"- >- <path- d="M11.6667 3.5L5.25 9.91667L2.33334 7"- stroke="white"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="1.5"- />- </svg></span>- <span className={styles.ctaLabel}>- npx @openuidev/cli@latest create+ <span className={styles.iconBadge}>+ <span className={styles.iconFrame}>+ <span+ className={`${styles.iconLayer} ${copied ? styles.iconHidden : styles.iconVisible}`}+ >+ <CopyIcon color="white" />+ </span>+ <svg+ className={`${styles.iconLayer} ${copied ? styles.iconVisible : styles.iconHidden}`}+ fill="none"+ viewBox="0 0 14 14"+ >+ <path+ d="M11.6667 3.5L5.25 9.91667L2.33334 7"+ stroke="white"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1.5"+ />+ </svg>+ </span></span></button></div>@@ -101,11 +107,7 @@ export function BuildChatSection() {<div className={styles.container}><div className={styles.card}>{/* Border + shadow overlay */}- <div- aria-hidden="true"- className={styles.overlay}- style={{ boxShadow: CARD_SHADOW }}- />+ <div aria-hidden="true" className={styles.overlay} style={{ boxShadow: CARD_SHADOW }} /><div className={styles.content}>{/* Left: text content */}