Skip to content

Commit 4b03da3

Browse files
AmirMohammad CheraghaliAmirMohammad Cheraghali
authored andcommitted
revert: Revert absolute centering of viewport titles
- Restored flexbox layout for viewport headers (reverts previous commit) - Removes absolute positioning that caused layout issues - Keeps tooltip improvements (position below bar, text wrapping) - Keeps title centered within available space
1 parent 606f9ef commit 4b03da3

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

src/App.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,34 +1435,31 @@ function App() {
14351435
${isActive ? 'bg-[#1a1a1a] border-indigo-500/50' : 'bg-black border-[#222] opacity-60 hover:opacity-100'}
14361436
`}
14371437
>
1438-
<div className="flex items-center gap-2 z-10">
1438+
<div className="flex items-center gap-2">
14391439
<div className={`w-2 h-2 rounded-full shadow-sm transition-all ${isActive ? 'bg-indigo-500 shadow-indigo-500/50 scale-110' : 'bg-neutral-700'}`} />
14401440
<span className={`text-[10px] font-bold uppercase tracking-widest ${isActive ? 'text-indigo-400' : 'text-neutral-500'}`}>
14411441
{viewportLabels[index]}
14421442
</span>
14431443
</div>
1444-
1445-
{/* Centered Title */}
1446-
<div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-[50%] flex justify-center">
1447-
<div className="relative group min-w-0">
1444+
<div className="flex items-center gap-3 flex-1 min-w-0 justify-center">
1445+
<div className="relative group flex-1 min-w-0">
14481446
<span
1449-
className="text-[10px] text-neutral-400 font-mono truncate max-w-full block text-center"
1447+
className="text-[10px] text-neutral-400 font-mono truncate max-w-full block"
14501448
>
14511449
{ctrl.proteinTitle || ctrl.pdbId || (ctrl.file ? ctrl.file.name : "No Structure")}
14521450
</span>
1453-
<div className="absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-neutral-900 text-white text-[10px] rounded opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-50 border border-neutral-700 w-max max-w-[200px] text-center whitespace-normal break-words shadow-xl">
1451+
<div className="absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-neutral-900 text-white text-[10px] rounded opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-50 border border-neutral-700 w-max max-w-[90%] text-center whitespace-normal break-words shadow-xl">
14541452
{ctrl.proteinTitle || ctrl.pdbId || (ctrl.file ? ctrl.file.name : "No Structure")}
14551453
</div>
14561454
</div>
1455+
<button
1456+
onClick={(e) => { e.stopPropagation(); ctrl.handleResetView(); }}
1457+
className="p-1 hover:bg-white/10 rounded text-neutral-500 hover:text-white transition-colors shrink-0"
1458+
title="Reset Camera"
1459+
>
1460+
<RefreshCw className="w-3 h-3" />
1461+
</button>
14571462
</div>
1458-
1459-
<button
1460-
onClick={(e) => { e.stopPropagation(); ctrl.handleResetView(); }}
1461-
className="p-1 hover:bg-white/10 rounded text-neutral-500 hover:text-white transition-colors shrink-0 z-10"
1462-
title="Reset Camera"
1463-
>
1464-
<RefreshCw className="w-3 h-3" />
1465-
</button>
14661463
</div>
14671464
)}
14681465

0 commit comments

Comments
 (0)