From 5c7b5d8eda5e3b27f20f5759be4fc7c797eff54d Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Thu, 28 Aug 2025 00:51:37 -0700 Subject: [PATCH 01/17] style: attempt new glassmorphic analysis page design --- src/components/Analysis/AnalysisGameList.tsx | 54 ++--- src/components/Analysis/AnalysisSidebar.tsx | 221 ++++++++++-------- src/components/Analysis/BlunderMeter.tsx | 4 +- .../Analysis/ConfigurableScreens.tsx | 2 +- src/components/Analysis/ConfigureAnalysis.tsx | 53 +++-- src/components/Analysis/Highlight.tsx | 12 +- src/components/Analysis/MoveMap.tsx | 2 +- src/components/Analysis/MoveTooltip.tsx | 6 +- src/components/Analysis/MovesByRating.tsx | 4 +- src/components/Board/BoardController.tsx | 12 +- src/components/Board/MovesContainer.tsx | 30 +-- src/components/Common/GameInfo.tsx | 2 +- src/components/Common/PlayerInfo.tsx | 8 +- src/pages/analysis/[...id].tsx | 8 + src/styles/tailwind.css | 15 ++ tailwind.config.js | 6 + 16 files changed, 253 insertions(+), 186 deletions(-) diff --git a/src/components/Analysis/AnalysisGameList.tsx b/src/components/Analysis/AnalysisGameList.tsx index 66611a4c..e2f8af2f 100644 --- a/src/components/Analysis/AnalysisGameList.tsx +++ b/src/components/Analysis/AnalysisGameList.tsx @@ -584,10 +584,10 @@ export const AnalysisGameList: React.FC = ({ return analysisTournamentList ? (
-
+
= ({ {/* H&B Subsections */} {selected === 'hb' && ( -
+
@@ -703,12 +703,12 @@ export const AnalysisGameList: React.FC = ({ return (
-

+

{selected === 'play' || selected === 'hb' || selected === 'favorites' @@ -732,13 +732,13 @@ export const AnalysisGameList: React.FC = ({ className="flex flex-1 cursor-pointer items-center justify-between overflow-hidden py-1" >

-

+

{displayName}

{selected === 'favorites' && (game.type === 'hand' || game.type === 'brain') && ( - + {game.type === 'hand' ? 'hand_gesture' : 'neurology'} @@ -753,7 +753,7 @@ export const AnalysisGameList: React.FC = ({ e.stopPropagation() handleFavoriteGame(game) }} - className="flex items-center justify-center text-secondary transition hover:text-primary" + className="flex items-center justify-center text-white/70 transition hover:text-white" title="Edit favourite" > @@ -798,7 +798,7 @@ export const AnalysisGameList: React.FC = ({ )} -

+

{game.result .replace('1/2', '½') .replace('1/2', '½')} @@ -862,7 +862,7 @@ export const AnalysisGameList: React.FC = ({ getCurrentGames().length === 0 && !loading && (

-

+

{selected === 'favorites' ? ' ⭐ Hit the star to favourite games...' : 'Play more games... ^. .^₎⟆'} @@ -873,12 +873,12 @@ export const AnalysisGameList: React.FC = ({ {onCustomAnalysis && ( @@ -915,11 +915,11 @@ function Header({ return ( diff --git a/src/components/Analysis/AnalysisSidebar.tsx b/src/components/Analysis/AnalysisSidebar.tsx index b3eacca7..9d7a0e08 100644 --- a/src/components/Analysis/AnalysisSidebar.tsx +++ b/src/components/Analysis/AnalysisSidebar.tsx @@ -80,90 +80,93 @@ export const AnalysisSidebar: React.FC = ({ className="desktop-right-column-container flex flex-col gap-2" style={{ willChange: 'transform, opacity' }} > - {/* Analysis Toggle Bar */} -

-
- analytics -

Analysis

-
- -
- {/* Large screens : 2-row layout */}
{/* Combined Highlight + MovesByRating container */}
-
-
- +
+ {/* Merged header with toggle */} +
+
+ + analytics + +

Analysis

+
+
-
- +
+
+ +
+
+ +
{!analysisEnabled && ( -
-
- +
+
+ lock -

Analysis Disabled

-

+

Analysis Disabled

+

Enable analysis to see move evaluations

@@ -197,13 +200,13 @@ export const AnalysisSidebar: React.FC = ({ } /> {!analysisEnabled && ( -
-
- +
+
+ lock -

Analysis Disabled

-

+

Analysis Disabled

+

Enable analysis to see position evaluation

@@ -215,8 +218,32 @@ export const AnalysisSidebar: React.FC = ({ {/* Smaller screens: 3-row layout */}
{/* Row 1: Combined Highlight + BlunderMeter container */} -
-
+
+ {/* Merged header with toggle (mobile/smaller screens) */} +
+
+ + analytics + +

Analysis

+
+ +
+
= ({ currentNode={controller.currentNode ?? undefined} />
-
+
= ({
{!analysisEnabled && ( -
-
- +
+
+ lock -

Analysis Disabled

-

+

Analysis Disabled

+

Enable analysis to see move evaluations

@@ -307,13 +334,13 @@ export const AnalysisSidebar: React.FC = ({ />
{!analysisEnabled && ( -
-
- +
+
+ lock -

Analysis Disabled

-

+

Analysis Disabled

+

Enable analysis to see position evaluation

@@ -332,13 +359,13 @@ export const AnalysisSidebar: React.FC = ({ />
{!analysisEnabled && ( -
-
- +
+
+ lock -

Analysis Disabled

-

+

Analysis Disabled

+

Enable analysis to see move evaluations

diff --git a/src/components/Analysis/BlunderMeter.tsx b/src/components/Analysis/BlunderMeter.tsx index 00636ce7..de6cb455 100644 --- a/src/components/Analysis/BlunderMeter.tsx +++ b/src/components/Analysis/BlunderMeter.tsx @@ -64,7 +64,7 @@ const DesktopBlunderMeter: React.FC = ({ return (

Blunder Meter

@@ -119,7 +119,7 @@ const MobileBlunderMeter: React.FC = ({ return (

Blunder Meter

diff --git a/src/components/Analysis/ConfigurableScreens.tsx b/src/components/Analysis/ConfigurableScreens.tsx index 8b1c10fb..9749d8b1 100644 --- a/src/components/Analysis/ConfigurableScreens.tsx +++ b/src/components/Analysis/ConfigurableScreens.tsx @@ -150,7 +150,7 @@ export const ConfigurableScreens: React.FC = ({ ) })}
-
+
{screen.id === 'configure' ? ( = ({ autoSave, }: Props) => { return ( -
+
-

Analyze using:

- +

Analyze using:

+
+ + + keyboard_arrow_down + +
{onAnalyzeEntireGame && ( diff --git a/src/components/Analysis/Highlight.tsx b/src/components/Analysis/Highlight.tsx index 2edddae1..b000d523 100644 --- a/src/components/Analysis/Highlight.tsx +++ b/src/components/Analysis/Highlight.tsx @@ -238,10 +238,10 @@ export const Highlight: React.FC = ({ return (
-
-
+
+
{isHomePage ? (
@@ -258,7 +258,7 @@ export const Highlight: React.FC = ({ @@ -315,7 +315,7 @@ export const Highlight: React.FC = ({ })}
-
+

Stockfish 17 @@ -395,7 +395,7 @@ export const Highlight: React.FC = ({

-
+
{boardDescription?.segments?.length > 0 ? ( = ({ return (

diff --git a/src/components/Analysis/MoveTooltip.tsx b/src/components/Analysis/MoveTooltip.tsx index 99494fdc..f5bb35b2 100644 --- a/src/components/Analysis/MoveTooltip.tsx +++ b/src/components/Analysis/MoveTooltip.tsx @@ -39,7 +39,7 @@ export const MoveTooltip: React.FC = ({ const tooltipContent = (
= ({ aria-label={onClickMove ? `Make move ${san}` : undefined} > {/* Header */} -
+
{san}
{/* Content */} -
+
{/* Maia Probability */} {maiaProb !== undefined && (
diff --git a/src/components/Analysis/MovesByRating.tsx b/src/components/Analysis/MovesByRating.tsx index 74aece5c..8ec73496 100644 --- a/src/components/Analysis/MovesByRating.tsx +++ b/src/components/Analysis/MovesByRating.tsx @@ -41,7 +41,7 @@ export const MovesByRating: React.FC = ({ return (

Moves by Rating @@ -242,7 +242,7 @@ export const MovesByRating: React.FC = ({ { return ( -
+
{payload ? (

{payload[0]?.payload.rating}

diff --git a/src/components/Board/BoardController.tsx b/src/components/Board/BoardController.tsx index 5f2fdbdf..e42b9335 100644 --- a/src/components/Board/BoardController.tsx +++ b/src/components/Board/BoardController.tsx @@ -123,39 +123,39 @@ export const BoardController: React.FC = ({ ]) return ( -
+
diff --git a/src/components/Board/MovesContainer.tsx b/src/components/Board/MovesContainer.tsx index f1a1d0ec..b3561c8b 100644 --- a/src/components/Board/MovesContainer.tsx +++ b/src/components/Board/MovesContainer.tsx @@ -258,7 +258,7 @@ export const MovesContainer: React.FC = (props) => {
{mobileMovePairs.map((pair, pairIndex) => ( -
+
{pair.moveNumber}.{!pair.whiteMove ? '..' : ''}
{pair.whiteMove && ( @@ -273,11 +273,11 @@ export const MovesContainer: React.FC = (props) => { controller.goToNode(pair.whiteMove as GameNode) } }} - className={`flex min-w-fit cursor-pointer flex-row items-center rounded px-2 py-1 text-sm ${ + className={`flex min-w-fit cursor-pointer flex-row items-center rounded-md px-2 py-1 text-sm ${ controller.currentNode === pair.whiteMove - ? 'bg-human-4/20' - : 'hover:bg-background-2' - } ${highlightSet.has(pairIndex * 2 + 1) ? 'bg-human-3/80' : ''}`} + ? 'bg-white/10' + : 'hover:bg-white/10' + } ${highlightSet.has(pairIndex * 2 + 1) ? 'bg-white/15' : ''}`} > = (props) => { controller.goToNode(pair.blackMove as GameNode) } }} - className={`flex min-w-fit cursor-pointer flex-row items-center rounded px-2 py-1 text-sm ${ + className={`flex min-w-fit cursor-pointer flex-row items-center rounded-md px-2 py-1 text-sm ${ controller.currentNode === pair.blackMove - ? 'bg-human-4/20' - : 'hover:bg-background-2' - } ${highlightSet.has(pairIndex * 2 + 2) ? 'bg-human-3/80' : ''}`} + ? 'bg-white/10' + : 'hover:bg-white/10' + } ${highlightSet.has(pairIndex * 2 + 2) ? 'bg-white/15' : ''}`} > = (props) => { ))} {termination && (
{ if (!disableMoveClicking) { controller.goToNode(mainLineNodes[mainLineNodes.length - 1]) @@ -367,12 +367,12 @@ export const MovesContainer: React.FC = (props) => { return (
{moves.map(([whiteNode, blackNode], index) => { return ( <> - + {(whiteNode || blackNode)?.moveNumber}
= (props) => { } }} data-index={index * 2 + 1} - className={`col-span-2 flex h-7 flex-1 cursor-pointer flex-row items-center justify-between px-2 text-sm hover:bg-background-2 ${controller.currentNode === whiteNode && 'bg-human-4/10'} ${highlightSet.has(index * 2 + 1) && 'bg-human-3/80'}`} + className={`col-span-2 flex h-7 flex-1 cursor-pointer flex-row items-center justify-between px-2 text-sm hover:bg-glass-hover ${controller.currentNode === whiteNode && 'bg-glass-strong'} ${highlightSet.has(index * 2 + 1) && 'bg-glass-strong'}`} > = (props) => { } }} data-index={index * 2 + 2} - className={`col-span-2 flex h-7 flex-1 cursor-pointer flex-row items-center justify-between px-2 text-sm hover:bg-background-2 ${controller.currentNode === blackNode && 'bg-human-4/10'} ${highlightSet.has(index * 2 + 2) && 'bg-human-3/80'}`} + className={`col-span-2 flex h-7 flex-1 cursor-pointer flex-row items-center justify-between px-2 text-sm hover:bg-glass-hover ${controller.currentNode === blackNode && 'bg-glass-strong'} ${highlightSet.has(index * 2 + 2) && 'bg-glass-strong'}`} > = (props) => { })} {termination && !isMobile && (
{ if (!disableMoveClicking) { controller.goToNode(mainLineNodes[mainLineNodes.length - 1]) diff --git a/src/components/Common/GameInfo.tsx b/src/components/Common/GameInfo.tsx index e5ab4528..3329714b 100644 --- a/src/components/Common/GameInfo.tsx +++ b/src/components/Common/GameInfo.tsx @@ -37,7 +37,7 @@ export const GameInfo: React.FC = ({ return (
diff --git a/src/components/Common/PlayerInfo.tsx b/src/components/Common/PlayerInfo.tsx index 1384c99a..a6636f98 100644 --- a/src/components/Common/PlayerInfo.tsx +++ b/src/components/Common/PlayerInfo.tsx @@ -54,7 +54,7 @@ export const PlayerInfo: React.FC = ({ } return ( -
+
= ({ )} {clock && (
{formatTime(currentTime)} diff --git a/src/pages/analysis/[...id].tsx b/src/pages/analysis/[...id].tsx index c83531a8..48bfcf26 100644 --- a/src/pages/analysis/[...id].tsx +++ b/src/pages/analysis/[...id].tsx @@ -1264,6 +1264,14 @@ const Analysis: React.FC = ({ } /> + {/* Radial gradient backdrop to match new design language */} +
{controller.maia.status === 'no-cache' || controller.maia.status === 'downloading' ? ( diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index 3a8c5623..3bbaf0f5 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -93,8 +93,23 @@ h5 { --color-engine-accent2: 90 157 215; --color-engine-accent3: 63 140 208; --color-engine-accent4: 35 124 201; + + /* New solid surfaces for glass-style data cards (non-transparent) */ + /* Opaque, neutral (no tint) surfaces */ + --color-surface: 32 32 32; /* bright primary surface ~#202020 */ + --color-surface-2: 24 24 24; /* dim secondary surface ~#181818 */ + + /* Glass variables (white, semi-transparent look) */ + --glass-bg: 255 255 255; + --glass-bg-opacity: 0.03; /* base backdrop */ + --glass-bg-hover-opacity: 0.05; /* hover / selected */ + --glass-bg-strong-opacity: 0.07; /* stronger emphasis */ + --glass-border: 255 255 255; + --glass-border-opacity: 0.09; } +/* Removed gradient surface helpers per design direction */ + svg { fill: rgb(var(--color-text-primary)); } diff --git a/tailwind.config.js b/tailwind.config.js index 131ec643..364b0eb3 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -12,6 +12,12 @@ module.exports = { backdrop: 'rgb(var(--color-backdrop))', primary: 'rgb(var(--color-text-primary))', secondary: 'rgb(var(--color-text-secondary))', + glass: { + DEFAULT: 'rgb(var(--glass-bg) / var(--glass-bg-opacity))', + hover: 'rgb(var(--glass-bg) / var(--glass-bg-hover-opacity))', + strong: 'rgb(var(--glass-bg) / var(--glass-bg-strong-opacity))', + }, + glassBorder: 'rgb(var(--glass-border) / var(--glass-border-opacity))', button: { primary: 'rgb(var(--color-button-primary))', secondary: 'rgb(var(--color-button-secondary))', From 4b7c566c95a2bfb38cf042006305f5d35fc0bc50 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Thu, 28 Aug 2025 01:06:42 -0700 Subject: [PATCH 02/17] style: improve colours + layout for analysis --- src/components/Analysis/AnalysisGameList.tsx | 8 ++- .../Analysis/ConfigurableScreens.tsx | 2 +- src/components/Analysis/ConfigureAnalysis.tsx | 2 +- src/components/Board/BoardController.tsx | 11 +++- src/components/Board/MovesContainer.tsx | 22 +++++-- src/components/Common/ExportGame.tsx | 4 +- src/components/Common/GameInfo.tsx | 8 ++- src/pages/analysis/[...id].tsx | 65 ++++++++++++------- 8 files changed, 83 insertions(+), 39 deletions(-) diff --git a/src/components/Analysis/AnalysisGameList.tsx b/src/components/Analysis/AnalysisGameList.tsx index e2f8af2f..cde26eff 100644 --- a/src/components/Analysis/AnalysisGameList.tsx +++ b/src/components/Analysis/AnalysisGameList.tsx @@ -48,6 +48,7 @@ interface AnalysisGameListProps { onCustomAnalysis?: () => void onGameSelected?: () => void // Called when a game is selected (for mobile popup closing) refreshTrigger?: number // Used to trigger refresh when custom analysis is added + embedded?: boolean // Render without outer card container } export const AnalysisGameList: React.FC = ({ @@ -56,6 +57,7 @@ export const AnalysisGameList: React.FC = ({ onGameSelected, refreshTrigger, loadNewWorldChampionshipGame, + embedded = false, }) => { const router = useRouter() const { analysisLichessList, analysisTournamentList } = @@ -584,7 +586,11 @@ export const AnalysisGameList: React.FC = ({ return analysisTournamentList ? (
diff --git a/src/components/Analysis/ConfigurableScreens.tsx b/src/components/Analysis/ConfigurableScreens.tsx index 9749d8b1..06c27df7 100644 --- a/src/components/Analysis/ConfigurableScreens.tsx +++ b/src/components/Analysis/ConfigurableScreens.tsx @@ -120,7 +120,7 @@ export const ConfigurableScreens: React.FC = ({ // Normal state with configure/export tabs return ( -
+
{screens.map((s) => { const selected = s.id === screen.id diff --git a/src/components/Analysis/ConfigureAnalysis.tsx b/src/components/Analysis/ConfigureAnalysis.tsx index 8772e8f3..3c9c8ef0 100644 --- a/src/components/Analysis/ConfigureAnalysis.tsx +++ b/src/components/Analysis/ConfigureAnalysis.tsx @@ -35,7 +35,7 @@ export const ConfigureAnalysis: React.FC = ({ autoSave, }: Props) => { return ( -
+

Analyze using:

diff --git a/src/components/Board/BoardController.tsx b/src/components/Board/BoardController.tsx index e42b9335..c98d1cb2 100644 --- a/src/components/Board/BoardController.tsx +++ b/src/components/Board/BoardController.tsx @@ -20,7 +20,7 @@ interface Props { disableNavigation?: boolean } -export const BoardController: React.FC = ({ +export const BoardController: React.FC = ({ orientation, setOrientation, currentNode, @@ -35,6 +35,7 @@ export const BoardController: React.FC = ({ disablePrevious = false, disableKeyboardNavigation = false, disableNavigation = false, + embedded = false, }: Props) => { const { width } = useWindowSize() @@ -123,7 +124,13 @@ export const BoardController: React.FC = ({ ]) return ( -
+
+
+ )} + {/* H&B Subsections */} {selected === 'hb' && (
@@ -712,7 +728,7 @@ export const AnalysisGameList: React.FC = ({ className={`group flex w-full items-center gap-2 ${selectedGame ? 'bg-glass-strong' : 'hover:bg-glass-hover'}`} >

{selected === 'play' || @@ -876,19 +892,7 @@ export const AnalysisGameList: React.FC = ({

)}
- {onCustomAnalysis && ( - - )} + {/* Removed bottom "Analyze Custom" button; now shown only under Custom tab */}
= ({ @@ -134,35 +135,35 @@ export const BoardController: React.FC = ({ diff --git a/src/components/Board/MovesContainer.tsx b/src/components/Board/MovesContainer.tsx index a0e75259..525d7019 100644 --- a/src/components/Board/MovesContainer.tsx +++ b/src/components/Board/MovesContainer.tsx @@ -349,7 +349,7 @@ export const MovesContainer: React.FC< ))} {termination && (
{ if (!disableMoveClicking) { controller.goToNode(mainLineNodes[mainLineNodes.length - 1]) @@ -371,16 +371,16 @@ export const MovesContainer: React.FC< return (
{moves.map(([whiteNode, blackNode], index) => { return ( <> - + {(whiteNode || blackNode)?.moveNumber}
{ if (!disableMoveClicking) { controller.goToNode(mainLineNodes[mainLineNodes.length - 1]) From 693bb9b727d035e09806adb75f22640792912d4f Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Thu, 28 Aug 2025 18:36:34 -0700 Subject: [PATCH 05/17] style: improve analysis ui --- src/components/Analysis/ConfigureAnalysis.tsx | 10 +++++----- src/pages/analysis/[...id].tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Analysis/ConfigureAnalysis.tsx b/src/components/Analysis/ConfigureAnalysis.tsx index 3c9c8ef0..b53541da 100644 --- a/src/components/Analysis/ConfigureAnalysis.tsx +++ b/src/components/Analysis/ConfigureAnalysis.tsx @@ -35,13 +35,13 @@ export const ConfigureAnalysis: React.FC = ({ autoSave, }: Props) => { return ( -
+

Analyze using: