fix(web): 去除残留 undefined(文本最终清洗)并将启动命令改为顶层 README 流程(start.sh + compose)

This commit is contained in:
Ember
2025-11-02 00:01:38 +08:00
parent 6f48c92da5
commit f26621dc6e
2 changed files with 12 additions and 9 deletions

View File

@@ -500,15 +500,16 @@ export function LandingPage() {
> >
<Typewriter <Typewriter
lines={[ lines={[
'$ git clone https://github.com/tinkle-community/nofx', '$ git clone https://github.com/tinkle-community/nofx.git',
'$ cd nofx/web', '$ cd nofx',
'$ npm install', '$ chmod +x start.sh',
'$ npm run dev', '$ ./start.sh start --build',
'🚀 前端已启动 http://localhost:3000', '🚀 启动自动交易系统...',
'✓ 就绪', '✓ API服务器启动在端口 8080',
'🌐 Web 控制台 http://localhost:3000',
]} ]}
typingSpeed={55} typingSpeed={65}
lineDelay={700} lineDelay={800}
className='text-sm font-mono' className='text-sm font-mono'
style={{ color: '#00FF41', textShadow: '0 0 6px rgba(0,255,65,0.6)' }} style={{ color: '#00FF41', textShadow: '0 0 6px rgba(0,255,65,0.6)' }}
/> />

View File

@@ -62,9 +62,11 @@ export default function Typewriter({
} }
}, [lines, typingSpeed, lineDelay]) }, [lines, typingSpeed, lineDelay])
const displayText = useMemo(() => typedLines.join('\n').replace(/undefined/g, ''), [typedLines])
return ( return (
<pre className={className} style={{ whiteSpace: 'pre-wrap', ...style }}> <pre className={className} style={{ whiteSpace: 'pre-wrap', ...style }}>
{typedLines.join('\n')} {displayText}
<span style={{ opacity: showCursor ? 1 : 0 }}> </span> <span style={{ opacity: showCursor ? 1 : 0 }}> </span>
</pre> </pre>
) )