Files
Nexus.Reader/src/NexusReader.UI.Shared/Layout/MainHubLayout.razor.css
T
Antigravity c94e8f0acb feat(creator): overhaul Creator flow, editor duplication, and staging setup (#83)
This pull request completely overhauls the Creator editor flow, resolves the editor duplication race condition, aligns layout/styling themes in light and dark mode, and adds Docker staging setups.

### Key Changes
1. **Creator Flow Polish**: Redesigned the editor canvas to prevent double scrolling by delegating overflow to the editor canvas layer, updated styles to a premium aesthetic.
2. **Race Condition Prevention**: Resolved Crepe editor duplication when loading or switching chapters by tracking state via shared window maps (`window.editorCache`, `window.editorStates`) and checking `_lastInitializedEditorId` synchronously in Blazor.
3. **Theme Synchronization**: Integrated explicit theme initialization (`ThemeService.InitializeAsync()`) and anchored CSS isolation selectors to correctly sync with Light (Soft Sepia) and Deep Dark theme preferences.
4. **Staging Automation**: Created staging docker configurations with `--nexus-only` flag to allow iterative development without resetting PG/Neo4j database containers.

---------

Co-authored-by: Marek Jasiński <jasins.marek@gmail.com>
Reviewed-on: #83
Co-authored-by: Antigravity <antigravity@google.com>
Co-committed-by: Antigravity <antigravity@google.com>
2026-06-15 17:15:42 +00:00

563 lines
13 KiB
CSS

.hub-container {
display: flex;
width: 100vw;
height: 100vh;
background: var(--bg-base);
color: var(--text-main);
overflow: hidden;
}
::deep .hub-sidebar {
width: 80px;
height: 100%;
background: var(--bg-surface);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
z-index: 100;
flex-shrink: 0;
transition: width 0.2s ease;
}
::deep .sidebar-header {
padding: 2rem 0;
display: flex;
justify-content: center;
}
::deep .logo {
display: flex;
align-items: center;
justify-content: center;
}
::deep .logo-icon {
color: #10b981;
filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.3));
}
::deep .logo-text {
display: none;
}
::deep .sidebar-nav {
flex: 1;
padding: 0.5rem 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
}
::deep .nav-item {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 54px;
color: var(--text-muted);
text-decoration: none;
transition: color 0.2s ease, background-color 0.2s ease;
position: relative;
}
::deep .nav-item:hover {
color: #10b981;
background: rgba(0, 0, 0, 0.04);
}
::deep .nav-item:focus-visible {
outline: 2px solid #10b981;
outline-offset: -2px;
}
::deep .nav-item.active {
color: #10b981;
background: rgba(16, 185, 129, 0.04);
}
::deep .nav-item.active::before {
content: '';
position: absolute;
left: 0;
top: 15%;
height: 70%;
width: 3px;
background: #10b981;
border-radius: 0 4px 4px 0;
box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}
::deep .nav-icon {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
transition: color 0.2s ease;
}
::deep .nav-text {
display: none;
}
::deep .sidebar-footer {
padding: 1.5rem 0;
border-top: 1px solid var(--border);
display: flex;
flex-direction: column;
align-items: center;
gap: 1.25rem;
}
::deep .user-brief {
display: flex;
justify-content: center;
width: 100%;
}
::deep .user-avatar {
width: 36px;
height: 36px;
background: var(--bg-base);
border: 1px solid var(--border);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
font-weight: 600;
color: var(--text-main);
flex-shrink: 0;
}
::deep .user-details {
display: none;
}
::deep .logout-btn {
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 0.5rem;
border-radius: 8px;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
::deep .logout-btn:hover {
background: rgba(239, 68, 68, 0.08);
color: #ef4444;
}
.hub-main {
flex: 1;
height: 100%;
overflow-y: auto;
background: var(--bg-base);
}
.hub-content {
padding: 2.5rem;
min-height: 100%;
}
::deep .hub-loading {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1.5rem;
}
::deep .nexus-loader {
width: 32px;
height: 32px;
border: 2px solid rgba(16, 185, 129, 0.1);
border-top-color: #10b981;
border-radius: 50%;
animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
filter: drop-shadow(0 0 5px #10b981);
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Mobile Styles */
.nexus-mobile-topbar {
display: none;
}
.reader-mobile-dock {
display: none;
}
@media (max-width: 767px) {
.nexus-mobile-topbar {
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
right: 0;
height: 60px;
background: var(--bg-surface);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
padding: 0 1.25rem;
z-index: 150;
}
.hamburger-btn {
background: transparent;
border: none;
color: #e0e0e0;
cursor: pointer;
padding: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
transition: background-color 0.2s;
min-height: 48px;
min-width: 48px;
touch-action: manipulation;
}
.hamburger-btn:hover {
background: rgba(255, 255, 255, 0.05);
}
.mobile-logo {
display: flex;
align-items: center;
gap: 0.5rem;
}
.pulsing-logo {
animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
0%, 100% {
filter: drop-shadow(0 0 5px rgba(0, 255, 153, 0.4));
opacity: 0.8;
}
50% {
filter: drop-shadow(0 0 12px rgba(0, 255, 153, 0.8));
opacity: 1;
}
}
.mobile-user-pill {
display: flex;
align-items: center;
}
.user-avatar-mini {
width: 32px;
height: 32px;
background: linear-gradient(135deg, var(--nexus-neon) 0%, #0099ff 100%);
border: 1px solid var(--border);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
font-weight: 700;
color: #121212;
box-shadow: 0 0 10px rgba(0, 255, 153, 0.2);
}
.mobile-sidebar-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 190;
animation: fade-in 0.2s ease-out;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
::deep .hub-sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 280px;
height: 100%;
background: var(--bg-surface);
z-index: 200;
transform: translateX(-100%);
will-change: transform;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: none;
}
.mobile-menu-open ::deep .hub-sidebar {
transform: translateX(0);
box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}
.hub-container {
flex-direction: column;
}
.hub-main {
margin-top: 60px;
width: 100%;
height: calc(100vh - 60px);
}
.hub-content {
padding: 1.25rem;
}
::deep .sidebar-header {
padding: 1.5rem 1.25rem;
border-bottom: 1px solid var(--border);
}
::deep .sidebar-nav {
padding: 1rem 0;
}
::deep .nav-item {
padding: 0.9rem 1.25rem;
font-size: 0.95rem;
min-height: 48px; /* Touch target */
}
::deep .sidebar-footer {
padding: 1rem 1.25rem;
}
}
/* ============================================================
LIGHT THEME OVERRIDES — "Warm Paper / Soft Sepia"
Scoped via .theme-light on an ancestor element.
============================================================ */
/* --- Desktop Sidebar: warm paper shadow --- */
.theme-light ::deep .hub-sidebar {
box-shadow: 4px 0 20px rgba(139, 130, 115, 0.08);
background: var(--bg-surface) !important;
border-right: 1px solid var(--border) !important;
}
/* --- Logo icon: remove neon glow --- */
.theme-light ::deep .logo-icon {
filter: none;
}
/* --- Nav item hover: ensure green text, warm hover bg --- */
.theme-light ::deep .nav-item:hover {
color: #10b981;
background: rgba(0, 0, 0, 0.02);
}
/* --- Nav active indicator: reduced glow --- */
.theme-light ::deep .nav-item.active::before {
box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}
/* --- Nexus loader: remove neon drop-shadow --- */
.theme-light ::deep .nexus-loader {
filter: none;
}
/* --- Mobile Styles --- */
@media (max-width: 768px) {
/* Hamburger button: dark text on warm paper */
.theme-light .hamburger-btn {
color: #292524;
}
.theme-light .hamburger-btn:hover {
background: rgba(0, 0, 0, 0.04);
}
/* User avatar mini: solid accent, white text, no neon glow */
.theme-light .user-avatar-mini {
background: #10b981;
color: #ffffff;
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
/* Pulsing logo: subtle accent pulse, no neon glow */
.theme-light .pulsing-logo {
animation: pulse-glow-light 2s infinite ease-in-out;
}
@keyframes pulse-glow-light {
0%, 100% {
filter: none;
opacity: 0.85;
}
50% {
filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
opacity: 1;
}
}
/* Mobile sidebar open state: warm shadow instead of dark */
.theme-light .mobile-menu-open ::deep .hub-sidebar {
box-shadow: 10px 0 30px rgba(139, 130, 115, 0.2);
}
/* Content padding for bottom navigation dock */
.hub-content {
padding: 1.25rem 1.25rem calc(1.25rem + 96px + env(safe-area-inset-bottom, 0px)) !important;
}
/* Reader Mobile Dock v3 */
::deep .reader-mobile-dock {
display: flex;
position: fixed;
bottom: calc(16px + env(safe-area-inset-bottom, 0px));
left: 20px;
right: 20px;
height: 64px;
background: rgba(26, 26, 30, 0.75); /* Translucent dark mode */
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--border); /* Microscopic perimeter border */
border-radius: 30px; /* Floating capsule rounded borders */
z-index: 150;
padding: 0 16px;
justify-content: space-around;
align-items: center;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
::deep .dock-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: var(--text-muted);
text-decoration: none;
transition: color 0.2s ease, filter 0.2s ease;
position: relative;
gap: 2px;
}
::deep .dock-item:hover, ::deep .dock-item.active {
color: var(--accent) !important;
filter: drop-shadow(0 0 4px var(--accent-glow)); /* Clean accent glow drop-shadow */
}
::deep .dock-item ::deep svg,
::deep .dock-item ::deep .nexus-icon,
::deep .dock-item svg,
::deep .dock-item .nexus-icon {
color: inherit !important;
fill: currentColor !important;
}
::deep .dock-text {
display: block !important;
font-size: 10px;
font-weight: 500;
margin-top: 2px;
white-space: nowrap;
color: inherit;
}
/* Central action button style */
::deep .dock-item.central-action {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
flex: 1;
height: 100%;
gap: 2px;
margin-top: 0;
transform: none !important;
z-index: 160;
}
::deep .central-action-inner {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--accent); /* Solid green background */
color: #ffffff !important; /* White robot icon */
display: flex;
align-items: center;
justify-content: center;
border: none !important;
box-shadow: 0 4px 10px rgba(0, 255, 153, 0.3);
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
::deep .central-action-inner ::deep svg,
::deep .central-action-inner ::deep .nexus-icon,
::deep .central-action-inner svg,
::deep .central-action-inner .nexus-icon {
color: #ffffff !important;
fill: currentColor !important;
}
::deep .dock-item.central-action:hover .central-action-inner,
::deep .dock-item.central-action.active .central-action-inner {
transform: scale(1.05);
box-shadow: 0 4px 14px rgba(0, 255, 153, 0.5);
}
::deep .central-action-glow {
display: none; /* Purged background glow */
}
/* Light Theme Overrides */
.theme-light ::deep .reader-mobile-dock {
background: rgba(244, 241, 234, 0.9); /* Translucent light mode warm paper background */
box-shadow: 0 8px 30px rgba(139, 130, 115, 0.15);
}
.theme-light ::deep .dock-item {
color: var(--text-muted);
}
.theme-light ::deep .dock-item:hover, .theme-light ::deep .dock-item.active {
color: var(--accent) !important;
filter: drop-shadow(0 0 3px var(--accent-glow));
}
.theme-light ::deep .central-action-inner {
background: var(--accent) !important;
color: #ffffff !important;
border: none !important;
box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25) !important;
}
.theme-light ::deep .dock-item.central-action:hover .central-action-inner,
.theme-light ::deep .dock-item.central-action.active .central-action-inner {
box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
transform: scale(1.05);
}
.theme-light ::deep .central-action-glow {
display: none;
}
}