openfree commited on
Commit
2a73efa
ยท
verified ยท
1 Parent(s): ca3da08

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +33 -9
index.html CHANGED
@@ -131,9 +131,7 @@
131
  .chat-msg{margin-bottom:10px;display:flex;gap:6px}.chat-msg.user{justify-content:flex-end}
132
  .chat-msg .cb3{max-width:75%;padding:8px 12px;border-radius:10px;font-size:11px;line-height:1.6}
133
  .chat-msg.user .cb3{background:#3b82f6;color:#fff;border-bottom-right-radius:3px}
134
- .chat-msg.ai .cb3{background:#f1f5f9;color:#1e293b;border-bottom-left-radius:3px}
135
- .chat-msg.ai .cb3 table{border-collapse:collapse;width:100%;margin:4px 0}.chat-msg.ai .cb3 td{border:1px solid #e2e8f0;padding:3px 6px;font-size:9px}
136
- .chat-msg.ai .cb3 tr:first-child td{background:#f8fafc;font-weight:700}
137
  .chat-input{display:flex;gap:6px;padding:10px 14px;border-top:1px solid #e2e8f0;background:#fff}
138
  /* pocket card */
139
  .pkt{background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:8px;box-shadow:0 1px 2px rgba(0,0,0,.03);display:flex;flex-direction:column;gap:3px}.pkt:hover{border-color:#3b82f6}
@@ -446,7 +444,27 @@ function FileLibrary(){const[files,setFiles]=useState([]);const[ld,setLd]=useSta
446
  {f.author===getUser()&&<button className="btn btn-d" style={{fontSize:8,padding:'3px 6px'}} onClick={()=>del(f.id)}>โœ•</button>}</div></div></div>)}</div>}
447
 
448
  /* === Wizard MD + History + Side === */
449
- function md2html(t){if(!t)return '';return t.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:#1e293b;color:#e2e8f0;padding:8px;border-radius:5px;font-size:9px;overflow-x:auto;font-family:JetBrains Mono,monospace;margin:4px 0"><code>$2</code></pre>').replace(/`([^`]+)`/g,'<code style="background:#f1f5f9;padding:1px 3px;border-radius:2px;font-size:9px">$1</code>').replace(/^\|(.+)\|$/gm,r=>{const c=r.split('|').filter(c=>c.trim());if(c.every(c=>/^[\s\-:]+$/.test(c)))return '';return '<tr>'+c.map(c=>'<td style="border:1px solid #e2e8f0;padding:3px 6px;font-size:9px">'+c.trim()+'</td>').join('')+'</tr>'}).replace(/(<tr>[\s\S]*?<\/tr>)/g,m=>'<table style="border-collapse:collapse;width:100%;margin:4px 0">'+m+'</table>').replace(/^### (.+)$/gm,'<div style="font-size:11px;font-weight:700;margin:6px 0 3px">$1</div>').replace(/^## (.+)$/gm,'<div style="font-size:12px;font-weight:700;margin:8px 0 3px">$1</div>').replace(/\*\*(.+?)\*\*/g,'<b>$1</b>').replace(/^[\-\*] (.+)$/gm,'<div style="padding-left:10px;margin:1px 0">โ€ข $1</div>').replace(/\n/g,'<br/>')}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
 
451
  function WizardTab({tasks,drops,pockets,reqs}){
452
  const[msgs,setMsgs]=useState(()=>{try{return JSON.parse(localStorage.getItem('vd_chat'))||[{role:'ai',text:'๐Ÿง™ ๋น„๋“œ๋ž˜ํ”„ํŠธ ๋งˆ๋ฒ•์‚ฌ์ž…๋‹ˆ๋‹ค. ๋ฌด์—‡์ด๋“  ๋ฌผ์–ด๋ณด์„ธ์š”!'}]}catch(e){return[{role:'ai',text:'๐Ÿง™ ๋งˆ๋ฒ•์‚ฌ์ž…๋‹ˆ๋‹ค.'}]}});
@@ -502,10 +520,10 @@ function DashOverview({tasks,drops,reqs}){
502
  <span style={{fontSize:12,fontWeight:700}}>๐Ÿง™ {me}๋‹˜์˜ ๋ธŒ๋ฆฌํ•‘</span>
503
  <button className="btn btn-g" onClick={()=>loadBrief(true)} disabled={briefLoading} style={{fontSize:8}}>{briefLoading?'โณ ์ƒ์„ฑ ์ค‘...':'๐Ÿ”„ ์ƒˆ๋กœ ์ƒ์„ฑ'}</button></div>
504
  {briefLoading&&!brief?<div style={{textAlign:'center',padding:10,color:'#94a3b8',fontSize:10}}>๐Ÿง™ AI๊ฐ€ ๋ธŒ๋ฆฌํ•‘์„ ์ค€๋น„ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค...</div>
505
- :brief?<><div dangerouslySetInnerHTML={{__html:md2html(brief.text)}} style={{fontSize:10,lineHeight:1.6,color:'#475569'}}/>
506
  {brief.org_text&&<div style={{marginTop:8,padding:10,background:'rgba(255,255,255,.8)',borderRadius:6,border:'1px solid #e2e8f0'}}>
507
  <div style={{fontSize:10,fontWeight:700,color:'#7c3aed',marginBottom:4}}>๐Ÿ‘‘ ์กฐ์ง ๋ธŒ๋ฆฌํ•‘ (CEO ์ „์šฉ)</div>
508
- <div dangerouslySetInnerHTML={{__html:md2html(brief.org_text)}} style={{fontSize:9,lineHeight:1.5,color:'#475569'}}/></div>}</>
509
  :<div style={{color:'#94a3b8',fontSize:9,textAlign:'center',padding:6}}>๋ธŒ๋ฆฌํ•‘ ๋กœ๋”ฉ ์ค‘...</div>}
510
  </div>
511
  <div className="dash-search"><input value={search} onChange={e=>setSearch(e.target.value)} placeholder="๐Ÿ” ์ „์ฒด ๊ฒ€์ƒ‰ (๊ณผ์ œ๋ช…, ๋‹ด๋‹น์ž)"/></div>
@@ -545,9 +563,15 @@ function AiInsights(){
545
  <button className="btn btn-n" onClick={loadConn} disabled={cLoading} style={{padding:'10px',fontSize:11,justifyContent:'center'}}>๐Ÿ”ฎ {cLoading?'๋ถ„์„ ์ค‘...':'์—ฐ๊ฒฐ ๋ฐœ๊ฒฌ ์‹คํ–‰'}</button>
546
  {isCeo&&<button className="btn btn-n" onClick={loadWeekly} disabled={wLoading} style={{padding:'10px',fontSize:11,justifyContent:'center',background:'linear-gradient(135deg,#7c3aed,#ec4899)'}}>๐Ÿ‘‘ {wLoading?'๋ถ„์„ ์ค‘...':'์กฐ์ง ์ง€๋Šฅ ๋ฆฌํฌํŠธ'}</button>}
547
  </div>
548
- {radar&&<div className="rpt"><div className="rpt-t">๐ŸŽฏ ๊ธฐํšŒ ๋ ˆ์ด๋”</div><div dangerouslySetInnerHTML={{__html:md2html(radar.text)}} style={{fontSize:10,lineHeight:1.6}}/></div>}
549
- {conn&&<div className="rpt"><div className="rpt-t">๐Ÿ”ฎ ์—ฐ๊ฒฐ ๋ฐœ๊ฒฌ</div><div dangerouslySetInnerHTML={{__html:md2html(conn.text)}} style={{fontSize:10,lineHeight:1.6}}/></div>}
550
- {weekly&&<div className="rpt" style={{borderColor:'#c4b5fd'}}><div className="rpt-t" style={{color:'#7c3aed'}}>๐Ÿ‘‘ ์ฃผ๊ฐ„ ์กฐ์ง ์ง€๋Šฅ ๋ฆฌํฌํŠธ</div><div dangerouslySetInnerHTML={{__html:md2html(weekly.text)}} style={{fontSize:10,lineHeight:1.6}}/></div>}
 
 
 
 
 
 
551
  {!radar&&!conn&&!weekly&&<div style={{textAlign:'center',color:'#94a3b8',fontSize:11,padding:40}}>
552
  <div style={{fontSize:36,marginBottom:10}}>๐ŸŽฏ๐Ÿ”ฎ</div>
553
  AI๊ฐ€ ๋น„๋“œ๋ž˜ํ”„ํŠธ์˜ ์ „์ฒด ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„์„ํ•˜์—ฌ<br/>์‚ฌ์—… ๊ธฐํšŒ์™€ ์ˆจ์€ ์—ฐ๊ฒฐ์„ ์ฐพ์•„๋ƒ…๋‹ˆ๋‹ค.<br/><br/>
 
131
  .chat-msg{margin-bottom:10px;display:flex;gap:6px}.chat-msg.user{justify-content:flex-end}
132
  .chat-msg .cb3{max-width:75%;padding:8px 12px;border-radius:10px;font-size:11px;line-height:1.6}
133
  .chat-msg.user .cb3{background:#3b82f6;color:#fff;border-bottom-right-radius:3px}
134
+ .chat-msg.ai .cb3{background:#f1f5f9;color:#1e293b;border-bottom-left-radius:3px;font-size:11px;line-height:1.7}
 
 
135
  .chat-input{display:flex;gap:6px;padding:10px 14px;border-top:1px solid #e2e8f0;background:#fff}
136
  /* pocket card */
137
  .pkt{background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:8px;box-shadow:0 1px 2px rgba(0,0,0,.03);display:flex;flex-direction:column;gap:3px}.pkt:hover{border-color:#3b82f6}
 
444
  {f.author===getUser()&&<button className="btn btn-d" style={{fontSize:8,padding:'3px 6px'}} onClick={()=>del(f.id)}>โœ•</button>}</div></div></div>)}</div>}
445
 
446
  /* === Wizard MD + History + Side === */
447
+ function md2html(t){if(!t)return '';
448
+ // Code blocks first
449
+ let h=t.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:#1e293b;color:#e2e8f0;padding:8px;border-radius:5px;font-size:9px;overflow-x:auto;font-family:JetBrains Mono,monospace;margin:6px 0"><code>$2</code></pre>');
450
+ h=h.replace(/`([^`]+)`/g,'<code style="background:#f1f5f9;padding:1px 3px;border-radius:2px;font-size:9px">$1</code>');
451
+ // Tables - group consecutive | lines into one table
452
+ const lines=h.split('\n');const out=[];let tbl=[];
453
+ const flushTable=()=>{if(tbl.length===0)return;
454
+ let html='<div style="overflow-x:auto;margin:8px 0"><table style="border-collapse:collapse;width:100%;font-size:10px">';
455
+ let isFirst=true;
456
+ tbl.forEach(row=>{if(/^[\s\|\-:]+$/.test(row.replace(/\|/g,'').trim()))return;
457
+ const cells=row.split('|').slice(1,-1);if(cells.length===0)return;
458
+ if(isFirst){html+='<tr>'+cells.map(c=>'<th style="background:#f1f5f9;border:1px solid #e2e8f0;padding:6px 10px;font-weight:700;font-size:10px;color:#1e293b;text-align:left;white-space:nowrap">'+c.trim()+'</th>').join('')+'</tr>';isFirst=false;}
459
+ else{html+='<tr>'+cells.map(c=>'<td style="border:1px solid #e2e8f0;padding:6px 10px;font-size:10px;color:#475569;line-height:1.5;vertical-align:top">'+c.trim()+'</td>').join('')+'</tr>';}});
460
+ html+='</table></div>';out.push(html);tbl=[]};
461
+ lines.forEach(l=>{if(l.trim().startsWith('|')&&l.trim().endsWith('|')){tbl.push(l)}else{flushTable();out.push(l)}});flushTable();
462
+ h=out.join('\n');
463
+ h=h.replace(/^### (.+)$/gm,'<div style="font-size:12px;font-weight:700;margin:10px 0 4px;color:#1e293b;border-left:3px solid #3b82f6;padding-left:8px">$1</div>');
464
+ h=h.replace(/^## (.+)$/gm,'<div style="font-size:13px;font-weight:800;margin:12px 0 6px;color:#1e293b;border-bottom:1px solid #e2e8f0;padding-bottom:4px">$1</div>');
465
+ h=h.replace(/\*\*(.+?)\*\*/g,'<b style="color:#1e293b">$1</b>');
466
+ h=h.replace(/^[\-\*] (.+)$/gm,'<div style="padding-left:12px;margin:2px 0;position:relative"><span style="position:absolute;left:0">โ€ข</span> $1</div>');
467
+ h=h.replace(/\n/g,'<br/>');return h}
468
 
469
  function WizardTab({tasks,drops,pockets,reqs}){
470
  const[msgs,setMsgs]=useState(()=>{try{return JSON.parse(localStorage.getItem('vd_chat'))||[{role:'ai',text:'๐Ÿง™ ๋น„๋“œ๋ž˜ํ”„ํŠธ ๋งˆ๋ฒ•์‚ฌ์ž…๋‹ˆ๋‹ค. ๋ฌด์—‡์ด๋“  ๋ฌผ์–ด๋ณด์„ธ์š”!'}]}catch(e){return[{role:'ai',text:'๐Ÿง™ ๋งˆ๋ฒ•์‚ฌ์ž…๋‹ˆ๋‹ค.'}]}});
 
520
  <span style={{fontSize:12,fontWeight:700}}>๐Ÿง™ {me}๋‹˜์˜ ๋ธŒ๋ฆฌํ•‘</span>
521
  <button className="btn btn-g" onClick={()=>loadBrief(true)} disabled={briefLoading} style={{fontSize:8}}>{briefLoading?'โณ ์ƒ์„ฑ ์ค‘...':'๐Ÿ”„ ์ƒˆ๋กœ ์ƒ์„ฑ'}</button></div>
522
  {briefLoading&&!brief?<div style={{textAlign:'center',padding:10,color:'#94a3b8',fontSize:10}}>๐Ÿง™ AI๊ฐ€ ๋ธŒ๋ฆฌํ•‘์„ ์ค€๋น„ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค...</div>
523
+ :brief?<><div dangerouslySetInnerHTML={{__html:md2html(brief.text)}} style={{fontSize:11,lineHeight:1.7,color:'#334155'}}/>
524
  {brief.org_text&&<div style={{marginTop:8,padding:10,background:'rgba(255,255,255,.8)',borderRadius:6,border:'1px solid #e2e8f0'}}>
525
  <div style={{fontSize:10,fontWeight:700,color:'#7c3aed',marginBottom:4}}>๐Ÿ‘‘ ์กฐ์ง ๋ธŒ๋ฆฌํ•‘ (CEO ์ „์šฉ)</div>
526
+ <div dangerouslySetInnerHTML={{__html:md2html(brief.org_text)}} style={{fontSize:10,lineHeight:1.6,color:'#334155'}}/></div>}</>
527
  :<div style={{color:'#94a3b8',fontSize:9,textAlign:'center',padding:6}}>๋ธŒ๋ฆฌํ•‘ ๋กœ๋”ฉ ์ค‘...</div>}
528
  </div>
529
  <div className="dash-search"><input value={search} onChange={e=>setSearch(e.target.value)} placeholder="๐Ÿ” ์ „์ฒด ๊ฒ€์ƒ‰ (๊ณผ์ œ๋ช…, ๋‹ด๋‹น์ž)"/></div>
 
563
  <button className="btn btn-n" onClick={loadConn} disabled={cLoading} style={{padding:'10px',fontSize:11,justifyContent:'center'}}>๐Ÿ”ฎ {cLoading?'๋ถ„์„ ์ค‘...':'์—ฐ๊ฒฐ ๋ฐœ๊ฒฌ ์‹คํ–‰'}</button>
564
  {isCeo&&<button className="btn btn-n" onClick={loadWeekly} disabled={wLoading} style={{padding:'10px',fontSize:11,justifyContent:'center',background:'linear-gradient(135deg,#7c3aed,#ec4899)'}}>๐Ÿ‘‘ {wLoading?'๋ถ„์„ ์ค‘...':'์กฐ์ง ์ง€๋Šฅ ๋ฆฌํฌํŠธ'}</button>}
565
  </div>
566
+ {radar&&<div style={{background:'#fff',border:'1px solid #bfdbfe',borderRadius:10,padding:16,marginBottom:12,boxShadow:'0 2px 8px rgba(59,130,246,.08)'}}>
567
+ <div style={{fontSize:13,fontWeight:800,color:'#1e40af',marginBottom:8,display:'flex',alignItems:'center',gap:6}}>๐ŸŽฏ ๊ธฐํšŒ ๋ ˆ์ด๋”<span style={{fontSize:8,color:'#94a3b8',fontWeight:400,marginLeft:'auto'}}>AI ๋ถ„์„ ๊ฒฐ๊ณผ</span></div>
568
+ <div dangerouslySetInnerHTML={{__html:md2html(radar.text)}} style={{fontSize:11,lineHeight:1.7,color:'#334155'}}/></div>}
569
+ {conn&&<div style={{background:'#fff',border:'1px solid #c4b5fd',borderRadius:10,padding:16,marginBottom:12,boxShadow:'0 2px 8px rgba(139,92,246,.08)'}}>
570
+ <div style={{fontSize:13,fontWeight:800,color:'#6d28d9',marginBottom:8,display:'flex',alignItems:'center',gap:6}}>๐Ÿ”ฎ ์—ฐ๊ฒฐ ๋ฐœ๊ฒฌ<span style={{fontSize:8,color:'#94a3b8',fontWeight:400,marginLeft:'auto'}}>ํฌ๋กœ์Šค ๋ถ„์„</span></div>
571
+ <div dangerouslySetInnerHTML={{__html:md2html(conn.text)}} style={{fontSize:11,lineHeight:1.7,color:'#334155'}}/></div>}
572
+ {weekly&&<div style={{background:'linear-gradient(135deg,#faf5ff,#fdf2f8)',border:'1px solid #d8b4fe',borderRadius:10,padding:16,marginBottom:12,boxShadow:'0 2px 8px rgba(168,85,247,.1)'}}>
573
+ <div style={{fontSize:13,fontWeight:800,color:'#7c3aed',marginBottom:8,display:'flex',alignItems:'center',gap:6}}>๐Ÿ‘‘ ์ฃผ๊ฐ„ ์กฐ์ง ์ง€๋Šฅ ๋ฆฌํฌํŠธ<span style={{fontSize:8,color:'#a78bfa',fontWeight:400,marginLeft:'auto'}}>CEO ์ „์šฉ</span></div>
574
+ <div dangerouslySetInnerHTML={{__html:md2html(weekly.text)}} style={{fontSize:11,lineHeight:1.7,color:'#334155'}}/></div>}
575
  {!radar&&!conn&&!weekly&&<div style={{textAlign:'center',color:'#94a3b8',fontSize:11,padding:40}}>
576
  <div style={{fontSize:36,marginBottom:10}}>๐ŸŽฏ๐Ÿ”ฎ</div>
577
  AI๊ฐ€ ๋น„๋“œ๋ž˜ํ”„ํŠธ์˜ ์ „์ฒด ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„์„ํ•˜์—ฌ<br/>์‚ฌ์—… ๊ธฐํšŒ์™€ ์ˆจ์€ ์—ฐ๊ฒฐ์„ ์ฐพ์•„๋ƒ…๋‹ˆ๋‹ค.<br/><br/>