Upload folder using huggingface_hub
Browse files
client/src/components/Refinity.tsx
CHANGED
|
@@ -367,75 +367,33 @@ const Refinity: React.FC = () => {
|
|
| 367 |
</div>
|
| 368 |
</div>
|
| 369 |
|
| 370 |
-
<div className="relative
|
| 371 |
<div className="absolute left-2 top-1/2 -translate-y-1/2 z-10">
|
| 372 |
<button onClick={()=> setFlowIndex((i)=> Math.max(i-1, 0))} className="px-2 py-1 rounded-2xl bg-white/50 ring-1 ring-white/50 backdrop-blur-md text-sm">‹</button>
|
| 373 |
</div>
|
| 374 |
<div className="absolute right-2 top-1/2 -translate-y-1/2 z-10">
|
| 375 |
<button onClick={()=> setFlowIndex((i)=> Math.min(i+1, Math.max(taskVersions.length-1, 0)))} className="px-2 py-1 rounded-2xl bg-white/50 ring-1 ring-white/50 backdrop-blur-md text-sm">›</button>
|
| 376 |
</div>
|
| 377 |
-
<div
|
| 378 |
-
className="
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
}}
|
| 388 |
-
>
|
| 389 |
-
{taskVersions.map((v, idx) => {
|
| 390 |
-
const offset = idx - focusedIndex;
|
| 391 |
-
const abs = Math.abs(offset);
|
| 392 |
-
const isCenter = abs === 0;
|
| 393 |
-
const delta = 580; // card width + gap
|
| 394 |
-
const translateX = offset * delta;
|
| 395 |
-
const scale = isCenter ? 1.02 : 1.0;
|
| 396 |
-
const opacity = isCenter ? 1 : Math.max(0.6, 1 - abs * 0.15);
|
| 397 |
-
const zIndex = 100 - abs;
|
| 398 |
-
const snippet = (v.content || '').slice(0, 180) + ((v.content || '').length > 180 ? '…' : '');
|
| 399 |
-
return (
|
| 400 |
-
<div
|
| 401 |
-
key={v.id}
|
| 402 |
-
className="transition-transform duration-300 cursor-pointer absolute top-0 left-1/2"
|
| 403 |
-
style={{
|
| 404 |
-
transform: `translateX(${translateX - 260}px) translateX(-50%) scale(${scale})`,
|
| 405 |
-
opacity,
|
| 406 |
-
zIndex,
|
| 407 |
-
}}
|
| 408 |
-
onClick={() => { if (!isCenter) setFlowIndex(idx); else setPreviewVersionId(v.id); }}
|
| 409 |
-
>
|
| 410 |
-
<div className="relative w-[520px] rounded-xl p-5 bg-white/10 backdrop-blur-md ring-1 ring-inset ring-white/30 shadow-[0_20px_40px_rgba(0,0,0,0.15),inset_0_0.5px_0_rgba(255,255,255,0.5),inset_0_-1px_1.5px_rgba(0,0,0,0.12)] text-base">
|
| 411 |
-
<div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
|
| 412 |
-
<div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
|
| 413 |
-
<div className="text-gray-900 whitespace-pre-wrap break-words min-h-[100px]">{snippet}</div>
|
| 414 |
-
{/* No reflection to preserve clarity */}
|
| 415 |
-
{isCenter && (
|
| 416 |
<div className="mt-4 flex gap-3">
|
| 417 |
-
<button onClick={()=>{ setPreviewVersionId(v.id); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">
|
| 418 |
-
|
| 419 |
-
<div className="pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-tr from-white/30 via-white/10 to-transparent opacity-50" />
|
| 420 |
-
<span className="relative z-10">Full Text</span>
|
| 421 |
-
</button>
|
| 422 |
-
<button onClick={()=>selectManual(v.id)} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-white ring-1 ring-inset ring-white/50 backdrop-blur-md backdrop-brightness-110 backdrop-saturate-150 bg-indigo-600/70 active:translate-y-0.5 transition-all duration-200">
|
| 423 |
-
<div className="pointer-events-none absolute inset-0 rounded-2xl opacity-60 [background:linear-gradient(to_bottom,rgba(255,255,255,0.35),rgba(255,255,255,0)_28%),linear-gradient(to_right,rgba(255,255,255,0.35),rgba(255,255,255,0)_28%)]" />
|
| 424 |
-
<div className="pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-tr from-white/30 via-white/10 to-transparent opacity-50" />
|
| 425 |
-
<span className="relative z-10">Revise</span>
|
| 426 |
-
</button>
|
| 427 |
<button onClick={()=>{ setPreviewVersionId(v.id); setShowPreviewDiff(true); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">Compare</button>
|
| 428 |
</div>
|
| 429 |
-
|
| 430 |
-
{!isCenter && (
|
| 431 |
-
<div className="mt-4 text-center">
|
| 432 |
-
<button onClick={()=> setFlowIndex(idx)} className="text-sm text-indigo-700 hover:underline">Center</button>
|
| 433 |
-
</div>
|
| 434 |
-
)}
|
| 435 |
</div>
|
| 436 |
-
|
| 437 |
-
)
|
| 438 |
-
|
| 439 |
</div>
|
| 440 |
</div>
|
| 441 |
</div>
|
|
|
|
| 367 |
</div>
|
| 368 |
</div>
|
| 369 |
|
| 370 |
+
<div className="relative py-4">
|
| 371 |
<div className="absolute left-2 top-1/2 -translate-y-1/2 z-10">
|
| 372 |
<button onClick={()=> setFlowIndex((i)=> Math.max(i-1, 0))} className="px-2 py-1 rounded-2xl bg-white/50 ring-1 ring-white/50 backdrop-blur-md text-sm">‹</button>
|
| 373 |
</div>
|
| 374 |
<div className="absolute right-2 top-1/2 -translate-y-1/2 z-10">
|
| 375 |
<button onClick={()=> setFlowIndex((i)=> Math.min(i+1, Math.max(taskVersions.length-1, 0)))} className="px-2 py-1 rounded-2xl bg-white/50 ring-1 ring-white/50 backdrop-blur-md text-sm">›</button>
|
| 376 |
</div>
|
| 377 |
+
<div className="overflow-x-auto px-16">
|
| 378 |
+
<div className="inline-flex gap-6 pb-2">
|
| 379 |
+
{taskVersions.map((v, idx) => {
|
| 380 |
+
const snippet = (v.content || '').slice(0, 200) + ((v.content || '').length > 200 ? '…' : '');
|
| 381 |
+
return (
|
| 382 |
+
<div key={v.id} className="snap-center flex-shrink-0 w-[560px]">
|
| 383 |
+
<div className="relative rounded-xl p-5 bg-white/10 backdrop-blur-md ring-1 ring-inset ring-white/30 shadow-[0_20px_40px_rgba(0,0,0,0.08),inset_0_0.5px_0_rgba(255,255,255,0.5),inset_0_-1px_1.5px_rgba(0,0,0,0.12)] text-base">
|
| 384 |
+
<div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
|
| 385 |
+
<div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
|
| 386 |
+
<div className="text-gray-900 whitespace-pre-wrap break-words leading-relaxed">{snippet}</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
<div className="mt-4 flex gap-3">
|
| 388 |
+
<button onClick={()=>{ setPreviewVersionId(v.id); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">Full Text</button>
|
| 389 |
+
<button onClick={()=>selectManual(v.id)} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-white ring-1 ring-inset ring-white/50 backdrop-blur-md backdrop-brightness-110 backdrop-saturate-150 bg-indigo-600/70 active:translate-y-0.5 transition-all duration-200">Revise</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
<button onClick={()=>{ setPreviewVersionId(v.id); setShowPreviewDiff(true); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">Compare</button>
|
| 391 |
</div>
|
| 392 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
</div>
|
| 394 |
+
);
|
| 395 |
+
})}
|
| 396 |
+
</div>
|
| 397 |
</div>
|
| 398 |
</div>
|
| 399 |
</div>
|