mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5900d41e0a | |||
| efe94b3a3b | |||
| 231b6f3865 | |||
| 2fbd3ab02d |
+72
@@ -0,0 +1,72 @@
|
|||||||
|
import { useLayoutEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { useWindowSettings } from '/@/renderer/store/settings.store';
|
||||||
|
import { Platform } from '/@/shared/types/types';
|
||||||
|
|
||||||
|
export interface ItemTableStickyLayoutOffsets {
|
||||||
|
inViewMarginTop: number;
|
||||||
|
stickyTop: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useItemTableStickyLayoutOffsets(): ItemTableStickyLayoutOffsets {
|
||||||
|
const { windowBarStyle } = useWindowSettings();
|
||||||
|
const isWinMac = windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS;
|
||||||
|
|
||||||
|
const [offsets, setOffsets] = useState(() => ({
|
||||||
|
inViewMarginTop: getFallbackInViewMargin(windowBarStyle),
|
||||||
|
stickyTop: getFallbackStickyTop(windowBarStyle),
|
||||||
|
}));
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const read = () => {
|
||||||
|
const topVar = isWinMac
|
||||||
|
? '--item-table-sticky-top-win-mac'
|
||||||
|
: '--item-table-sticky-top-default';
|
||||||
|
const marginVar = isWinMac
|
||||||
|
? '--item-table-sticky-inview-margin-win-mac'
|
||||||
|
: '--item-table-sticky-inview-margin-default';
|
||||||
|
setOffsets({
|
||||||
|
inViewMarginTop: resolveRootCssMarginLeftVar(
|
||||||
|
marginVar,
|
||||||
|
getFallbackInViewMargin(windowBarStyle),
|
||||||
|
),
|
||||||
|
stickyTop: resolveRootCssWidthVar(topVar, getFallbackStickyTop(windowBarStyle)),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
read();
|
||||||
|
window.addEventListener('resize', read);
|
||||||
|
return () => window.removeEventListener('resize', read);
|
||||||
|
}, [isWinMac, windowBarStyle]);
|
||||||
|
|
||||||
|
return offsets;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFallbackInViewMargin(windowBarStyle: Platform): number {
|
||||||
|
return windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS ? -130 : -100;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFallbackStickyTop(windowBarStyle: Platform): number {
|
||||||
|
return windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS ? 95 : 65;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveRootCssMarginLeftVar(varName: string, fallback: number): number {
|
||||||
|
if (typeof document === 'undefined') return fallback;
|
||||||
|
const el = document.createElement('div');
|
||||||
|
el.style.cssText = `position:fixed;left:0;top:0;margin-left:var(${varName});width:1px;height:0;margin-top:0;margin-right:0;margin-bottom:0;padding:0;border:none;visibility:hidden;pointer-events:none;`;
|
||||||
|
document.body.appendChild(el);
|
||||||
|
const raw = getComputedStyle(el).marginLeft;
|
||||||
|
el.remove();
|
||||||
|
const v = parseFloat(raw);
|
||||||
|
return Number.isFinite(v) ? v : fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveRootCssWidthVar(varName: string, fallback: number): number {
|
||||||
|
if (typeof document === 'undefined') return fallback;
|
||||||
|
const el = document.createElement('div');
|
||||||
|
el.style.cssText = `position:fixed;left:-99999px;top:0;width:var(${varName});height:0;margin:0;padding:0;border:none;visibility:hidden;pointer-events:none;`;
|
||||||
|
document.body.appendChild(el);
|
||||||
|
const w = el.getBoundingClientRect().width;
|
||||||
|
el.remove();
|
||||||
|
return Number.isFinite(w) && w > 0 ? w : fallback;
|
||||||
|
}
|
||||||
+9
-12
@@ -1,9 +1,8 @@
|
|||||||
|
import type { ItemTableStickyLayoutOffsets } from '/@/renderer/components/item-list/item-table-list/hooks/use-item-table-sticky-layout-offsets';
|
||||||
|
|
||||||
import { useInView } from 'motion/react';
|
import { useInView } from 'motion/react';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { useWindowSettings } from '/@/renderer/store/settings.store';
|
|
||||||
import { Platform } from '/@/shared/types/types';
|
|
||||||
|
|
||||||
export interface GroupRowInfo {
|
export interface GroupRowInfo {
|
||||||
groupIndex: number;
|
groupIndex: number;
|
||||||
rowIndex: number;
|
rowIndex: number;
|
||||||
@@ -18,6 +17,7 @@ export const useStickyTableGroupRows = ({
|
|||||||
mainGridRef,
|
mainGridRef,
|
||||||
shouldShowStickyHeader,
|
shouldShowStickyHeader,
|
||||||
stickyHeaderTop,
|
stickyHeaderTop,
|
||||||
|
stickyLayout,
|
||||||
}: {
|
}: {
|
||||||
containerRef: React.RefObject<HTMLDivElement | null>;
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
@@ -27,17 +27,14 @@ export const useStickyTableGroupRows = ({
|
|||||||
mainGridRef: React.RefObject<HTMLDivElement | null>;
|
mainGridRef: React.RefObject<HTMLDivElement | null>;
|
||||||
shouldShowStickyHeader?: boolean;
|
shouldShowStickyHeader?: boolean;
|
||||||
stickyHeaderTop?: number;
|
stickyHeaderTop?: number;
|
||||||
|
stickyLayout: ItemTableStickyLayoutOffsets;
|
||||||
}) => {
|
}) => {
|
||||||
const { windowBarStyle } = useWindowSettings();
|
const { inViewMarginTop, stickyTop: layoutStickyTop } = stickyLayout;
|
||||||
const [stickyGroupIndex, setStickyGroupIndex] = useState<null | number>(null);
|
const [stickyGroupIndex, setStickyGroupIndex] = useState<null | number>(null);
|
||||||
|
|
||||||
const topMargin =
|
const groupRowsInViewMargin = `${inViewMarginTop}px 0px 0px 0px`;
|
||||||
windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS
|
|
||||||
? '-130px'
|
|
||||||
: '-100px';
|
|
||||||
|
|
||||||
const isTableInView = useInView(containerRef, {
|
const isTableInView = useInView(containerRef, {
|
||||||
margin: `${topMargin} 0px 0px 0px`,
|
margin: groupRowsInViewMargin as NonNullable<Parameters<typeof useInView>[1]>['margin'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const stickyTop = useMemo(() => {
|
const stickyTop = useMemo(() => {
|
||||||
@@ -46,8 +43,8 @@ export const useStickyTableGroupRows = ({
|
|||||||
if (shouldShowStickyHeader && stickyHeaderTop !== undefined) {
|
if (shouldShowStickyHeader && stickyHeaderTop !== undefined) {
|
||||||
return stickyHeaderTop + headerHeight + 1;
|
return stickyHeaderTop + headerHeight + 1;
|
||||||
}
|
}
|
||||||
return windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS ? 95 : 65;
|
return layoutStickyTop;
|
||||||
}, [windowBarStyle, shouldShowStickyHeader, stickyHeaderTop, headerHeight]);
|
}, [layoutStickyTop, shouldShowStickyHeader, stickyHeaderTop, headerHeight]);
|
||||||
|
|
||||||
// Calculate group row indexes
|
// Calculate group row indexes
|
||||||
const groupRowIndexes = useMemo(() => {
|
const groupRowIndexes = useMemo(() => {
|
||||||
|
|||||||
+12
-18
@@ -1,9 +1,8 @@
|
|||||||
|
import type { ItemTableStickyLayoutOffsets } from '/@/renderer/components/item-list/item-table-list/hooks/use-item-table-sticky-layout-offsets';
|
||||||
|
|
||||||
import { useInView } from 'motion/react';
|
import { useInView } from 'motion/react';
|
||||||
import { RefObject, useEffect, useMemo, useRef } from 'react';
|
import { RefObject, useEffect, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
import { useWindowSettings } from '/@/renderer/store/settings.store';
|
|
||||||
import { Platform } from '/@/shared/types/types';
|
|
||||||
|
|
||||||
export const useStickyTableHeader = ({
|
export const useStickyTableHeader = ({
|
||||||
containerRef,
|
containerRef,
|
||||||
enabled,
|
enabled,
|
||||||
@@ -12,6 +11,7 @@ export const useStickyTableHeader = ({
|
|||||||
pinnedLeftColumnRef,
|
pinnedLeftColumnRef,
|
||||||
pinnedRightColumnRef,
|
pinnedRightColumnRef,
|
||||||
stickyHeaderMainRef,
|
stickyHeaderMainRef,
|
||||||
|
stickyLayout,
|
||||||
}: {
|
}: {
|
||||||
containerRef: RefObject<HTMLDivElement | null>;
|
containerRef: RefObject<HTMLDivElement | null>;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
@@ -20,8 +20,9 @@ export const useStickyTableHeader = ({
|
|||||||
pinnedLeftColumnRef?: RefObject<HTMLDivElement | null>;
|
pinnedLeftColumnRef?: RefObject<HTMLDivElement | null>;
|
||||||
pinnedRightColumnRef?: RefObject<HTMLDivElement | null>;
|
pinnedRightColumnRef?: RefObject<HTMLDivElement | null>;
|
||||||
stickyHeaderMainRef?: RefObject<HTMLDivElement | null>;
|
stickyHeaderMainRef?: RefObject<HTMLDivElement | null>;
|
||||||
|
stickyLayout: ItemTableStickyLayoutOffsets;
|
||||||
}) => {
|
}) => {
|
||||||
const { windowBarStyle } = useWindowSettings();
|
const { inViewMarginTop, stickyTop } = stickyLayout;
|
||||||
const isScrollingRef = useRef({
|
const isScrollingRef = useRef({
|
||||||
main: false,
|
main: false,
|
||||||
pinnedLeft: false,
|
pinnedLeft: false,
|
||||||
@@ -29,27 +30,20 @@ export const useStickyTableHeader = ({
|
|||||||
stickyHeader: false,
|
stickyHeader: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const topMargin =
|
const inViewRootMargin = `${inViewMarginTop}px 0px 0px 0px`;
|
||||||
windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS
|
|
||||||
? '-130px'
|
|
||||||
: '-100px';
|
|
||||||
|
|
||||||
const isTableHeaderInView = useInView(headerRef, {
|
const inViewOptions = { margin: inViewRootMargin } as {
|
||||||
margin: `${topMargin} 0px 0px 0px`,
|
margin: NonNullable<Parameters<typeof useInView>[1]>['margin'];
|
||||||
});
|
};
|
||||||
|
|
||||||
const isTableInView = useInView(containerRef, {
|
const isTableHeaderInView = useInView(headerRef, inViewOptions);
|
||||||
margin: `${topMargin} 0px 0px 0px`,
|
|
||||||
});
|
const isTableInView = useInView(containerRef, inViewOptions);
|
||||||
|
|
||||||
const shouldShowStickyHeader = useMemo(() => {
|
const shouldShowStickyHeader = useMemo(() => {
|
||||||
return enabled && !isTableHeaderInView && isTableInView;
|
return enabled && !isTableHeaderInView && isTableInView;
|
||||||
}, [enabled, isTableHeaderInView, isTableInView]);
|
}, [enabled, isTableHeaderInView, isTableInView]);
|
||||||
|
|
||||||
const stickyTop = useMemo(() => {
|
|
||||||
return windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS ? 95 : 65;
|
|
||||||
}, [windowBarStyle]);
|
|
||||||
|
|
||||||
// Sync scroll between sticky header and main grid/pinned columns
|
// Sync scroll between sticky header and main grid/pinned columns
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!shouldShowStickyHeader || !stickyHeaderMainRef?.current || !mainGridRef?.current) {
|
if (!shouldShowStickyHeader || !stickyHeaderMainRef?.current || !mainGridRef?.current) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
.item-table-pinned-rows-grid-container.header-fixed {
|
.item-table-pinned-rows-grid-container.header-fixed {
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 65px;
|
top: var(--item-table-sticky-top-default);
|
||||||
z-index: 15;
|
z-index: 15;
|
||||||
background-color: var(--theme-bg-primary);
|
background-color: var(--theme-bg-primary);
|
||||||
box-shadow: 0 -1px 0 0 var(--theme-colors-border);
|
box-shadow: 0 -1px 0 0 var(--theme-colors-border);
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-table-pinned-rows-grid-container.header-window-bar {
|
.item-table-pinned-rows-grid-container.header-window-bar {
|
||||||
top: 95px;
|
top: var(--item-table-sticky-top-win-mac);
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-table-list-container.header-fixed-margin {
|
.item-table-list-container.header-fixed-margin {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { parseTableColumns } from '/@/renderer/components/item-list/helpers/pars
|
|||||||
import { useListHotkeys } from '/@/renderer/components/item-list/helpers/use-list-hotkeys';
|
import { useListHotkeys } from '/@/renderer/components/item-list/helpers/use-list-hotkeys';
|
||||||
import { useContainerWidthTracking } from '/@/renderer/components/item-list/item-table-list/hooks/use-container-width-tracking';
|
import { useContainerWidthTracking } from '/@/renderer/components/item-list/item-table-list/hooks/use-container-width-tracking';
|
||||||
import { useRowInteractionDelegate } from '/@/renderer/components/item-list/item-table-list/hooks/use-row-interaction-delegate';
|
import { useRowInteractionDelegate } from '/@/renderer/components/item-list/item-table-list/hooks/use-row-interaction-delegate';
|
||||||
|
import { useItemTableStickyLayoutOffsets } from '/@/renderer/components/item-list/item-table-list/hooks/use-item-table-sticky-layout-offsets';
|
||||||
import { useStickyGroupRowPositioning } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-group-row-positioning';
|
import { useStickyGroupRowPositioning } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-group-row-positioning';
|
||||||
import { useStickyHeaderPositioning } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-header-positioning';
|
import { useStickyHeaderPositioning } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-header-positioning';
|
||||||
import { useStickyTableGroupRows } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-table-group-rows';
|
import { useStickyTableGroupRows } from '/@/renderer/components/item-list/item-table-list/hooks/use-sticky-table-group-rows';
|
||||||
@@ -829,6 +830,8 @@ const ItemTableListStickyUI = memo(
|
|||||||
const stickyHeaderMainRef = useRef<HTMLDivElement | null>(null);
|
const stickyHeaderMainRef = useRef<HTMLDivElement | null>(null);
|
||||||
const stickyHeaderRightRef = useRef<HTMLDivElement | null>(null);
|
const stickyHeaderRightRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
|
||||||
|
const stickyLayout = useItemTableStickyLayoutOffsets();
|
||||||
|
|
||||||
const { shouldShowStickyHeader, stickyTop } = useStickyTableHeader({
|
const { shouldShowStickyHeader, stickyTop } = useStickyTableHeader({
|
||||||
containerRef,
|
containerRef,
|
||||||
enabled: enableHeader && enableStickyHeader,
|
enabled: enableHeader && enableStickyHeader,
|
||||||
@@ -837,6 +840,7 @@ const ItemTableListStickyUI = memo(
|
|||||||
pinnedLeftColumnRef,
|
pinnedLeftColumnRef,
|
||||||
pinnedRightColumnRef,
|
pinnedRightColumnRef,
|
||||||
stickyHeaderMainRef,
|
stickyHeaderMainRef,
|
||||||
|
stickyLayout,
|
||||||
});
|
});
|
||||||
|
|
||||||
useStickyHeaderPositioning({
|
useStickyHeaderPositioning({
|
||||||
@@ -858,6 +862,7 @@ const ItemTableListStickyUI = memo(
|
|||||||
mainGridRef: rowRef,
|
mainGridRef: rowRef,
|
||||||
shouldShowStickyHeader,
|
shouldShowStickyHeader,
|
||||||
stickyHeaderTop: stickyTop,
|
stickyHeaderTop: stickyTop,
|
||||||
|
stickyLayout,
|
||||||
});
|
});
|
||||||
|
|
||||||
const shouldRenderStickyGroupRow = shouldShowStickyGroupRow;
|
const shouldRenderStickyGroupRow = shouldShowStickyGroupRow;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
.container {
|
.container {
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-top: 1px solid alpha(var(--theme-colors-border), 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-grid {
|
.controls-grid {
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
'window-bar'
|
'window-bar'
|
||||||
'main-content'
|
'main-content'
|
||||||
'player';
|
'player';
|
||||||
grid-template-rows: 0 calc(100vh - 90px) 90px;
|
grid-template-rows:
|
||||||
grid-template-rows: 0 calc(100dvh - 90px) 90px;
|
0 calc(100vh - 90px - var(--theme-spacing-md)) calc(90px + var(--theme-spacing-md));
|
||||||
|
grid-template-rows:
|
||||||
|
0 calc(100dvh - 90px - var(--theme-spacing-md)) calc(90px + var(--theme-spacing-md));
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -13,11 +15,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.windows {
|
.windows {
|
||||||
grid-template-rows: 30px calc(100vh - 120px) 90px;
|
grid-template-rows:
|
||||||
grid-template-rows: 30px calc(100dvh - 120px) 90px;
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100vh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
|
grid-template-rows:
|
||||||
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100dvh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
}
|
}
|
||||||
|
|
||||||
.macos {
|
.macos {
|
||||||
grid-template-rows: 30px calc(100vh - 120px) 90px;
|
grid-template-rows:
|
||||||
grid-template-rows: 30px calc(100dvh - 120px) 90px;
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100vh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
|
grid-template-rows:
|
||||||
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100dvh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
.container {
|
.container {
|
||||||
position: relative;
|
position: relative;
|
||||||
grid-area: sidebar;
|
grid-area: sidebar;
|
||||||
|
overflow: hidden;
|
||||||
background: var(--theme-colors-background-alternate);
|
background: var(--theme-colors-background-alternate);
|
||||||
border-right: 1px solid alpha(var(--theme-colors-border), 0.5);
|
border-radius: var(--theme-radius-lg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
.main-content-container {
|
.main-content-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-area: main-content;
|
grid-area: main-content;
|
||||||
grid-template-areas: 'sidebar . right-sidebar';
|
grid-template-areas: 'sidebar main';
|
||||||
grid-template-rows: 1fr;
|
grid-template-rows: 1fr;
|
||||||
gap: 0;
|
gap: var(--theme-spacing-sm);
|
||||||
|
padding: var(--theme-spacing-md);
|
||||||
background: var(--theme-colors-background);
|
background: var(--theme-colors-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-content-container.right-expanded {
|
.main-content-container.right-expanded {
|
||||||
|
grid-template-areas: 'sidebar main right-sidebar';
|
||||||
grid-template-columns: var(--sidebar-width) 1fr var(--right-sidebar-width);
|
grid-template-columns: var(--sidebar-width) 1fr var(--right-sidebar-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +33,7 @@
|
|||||||
|
|
||||||
.main-content-container.vertical-layout {
|
.main-content-container.vertical-layout {
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
'sidebar .'
|
'sidebar main'
|
||||||
'sidebar right-sidebar';
|
'sidebar right-sidebar';
|
||||||
grid-template-rows: minmax(0, 1fr) var(--right-sidebar-height);
|
grid-template-rows: minmax(0, 1fr) var(--right-sidebar-height);
|
||||||
grid-template-columns: var(--sidebar-width) 1fr;
|
grid-template-columns: var(--sidebar-width) 1fr;
|
||||||
@@ -40,17 +43,15 @@
|
|||||||
grid-template-columns: 80px 1fr;
|
grid-template-columns: 80px 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content-container.vertical-layout #sidebar-queue {
|
|
||||||
border-top: 1px solid alpha(var(--theme-colors-border), 0.5);
|
|
||||||
border-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content-body {
|
.main-content-body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
grid-area: main;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: var(--theme-colors-background);
|
||||||
|
border-radius: var(--theme-radius-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content-body-scroll {
|
.main-content-body-scroll {
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
.container {
|
.wrapper {
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
grid-area: player;
|
grid-area: player;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 var(--theme-spacing-md) var(--theme-spacing-md);
|
||||||
|
background: var(--theme-colors-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: var(--theme-radius-lg);
|
||||||
|
transition: background 0.5s;
|
||||||
|
|
||||||
@mixin light {
|
@mixin light {
|
||||||
background: darken(var(--theme-colors-background), 5%);
|
background: darken(var(--theme-colors-background), 5%);
|
||||||
@@ -9,12 +24,8 @@
|
|||||||
@mixin dark {
|
@mixin dark {
|
||||||
background: darken(var(--theme-colors-background), 10%);
|
background: darken(var(--theme-colors-background), 10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
transition: background 0.5s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.open-drawer {
|
.open-drawer .bar:hover {
|
||||||
&:hover {
|
background: darken(var(--theme-colors-background), 20%);
|
||||||
background: darken(var(--theme-colors-background), 20%);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,14 @@ export const PlayerBar = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx({
|
className={clsx(styles.wrapper, {
|
||||||
[styles.container]: true,
|
|
||||||
[styles.openDrawer]: playerbarOpenDrawer,
|
[styles.openDrawer]: playerbarOpenDrawer,
|
||||||
})}
|
})}
|
||||||
id="player-bar"
|
id="player-bar"
|
||||||
>
|
>
|
||||||
<Playerbar />
|
<div className={styles.bar}>
|
||||||
|
<Playerbar />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,18 +7,13 @@
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--theme-colors-background-alternate);
|
background: var(--theme-colors-background-alternate);
|
||||||
border-left: 1px solid alpha(var(--theme-colors-border), 0.5);
|
border-radius: var(--theme-radius-lg);
|
||||||
|
|
||||||
.current-song-cell:not(.current-playlist-song-cell) svg {
|
.current-song-cell:not(.current-playlist-song-cell) svg {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-sidebar-container.vertical-layout {
|
|
||||||
border-top: 1px solid alpha(var(--theme-colors-border), 0.5);
|
|
||||||
border-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.queue-drawer {
|
.queue-drawer {
|
||||||
border-radius: var(--theme-radius-lg);
|
border-radius: var(--theme-radius-lg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import clsx from 'clsx';
|
|
||||||
import { forwardRef, Ref } from 'react';
|
import { forwardRef, Ref } from 'react';
|
||||||
|
|
||||||
import styles from './right-sidebar.module.css';
|
import styles from './right-sidebar.module.css';
|
||||||
@@ -64,9 +63,7 @@ export const RightSidebar = forwardRef(
|
|||||||
<>
|
<>
|
||||||
{rightExpanded && sideQueueType === 'sideQueue' && (
|
{rightExpanded && sideQueueType === 'sideQueue' && (
|
||||||
<aside
|
<aside
|
||||||
className={clsx(styles.rightSidebarContainer, {
|
className={styles.rightSidebarContainer}
|
||||||
[styles.verticalLayout]: isVerticalLayout,
|
|
||||||
})}
|
|
||||||
id="sidebar-queue"
|
id="sidebar-queue"
|
||||||
key="queue-sidebar"
|
key="queue-sidebar"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
'window-bar'
|
'window-bar'
|
||||||
'main-content'
|
'main-content'
|
||||||
'player';
|
'player';
|
||||||
grid-template-rows: 0 calc(100vh - 90px) 90px;
|
grid-template-rows:
|
||||||
grid-template-rows: 0 calc(100dvh - 90px) 90px;
|
0 calc(100vh - 90px - var(--theme-spacing-md)) calc(90px + var(--theme-spacing-md));
|
||||||
|
grid-template-rows:
|
||||||
|
0 calc(100dvh - 90px - var(--theme-spacing-md)) calc(90px + var(--theme-spacing-md));
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
@@ -18,14 +20,20 @@
|
|||||||
|
|
||||||
.windows,
|
.windows,
|
||||||
.macos {
|
.macos {
|
||||||
grid-template-rows: 30px calc(100vh - 120px) 90px;
|
grid-template-rows:
|
||||||
grid-template-rows: 30px calc(100dvh - 120px) 90px;
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100vh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
|
grid-template-rows:
|
||||||
|
calc(30px + var(--theme-spacing-md))
|
||||||
|
calc(100dvh - 120px - 2 * var(--theme-spacing-md))
|
||||||
|
calc(90px + var(--theme-spacing-md));
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer-button {
|
.drawer-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: calc(90px + 0.75rem);
|
bottom: calc(90px + var(--theme-spacing-md) + 0.75rem);
|
||||||
left: 0.75rem;
|
left: var(--theme-spacing-md);
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
background: color-mix(in srgb, var(--theme-colors-background) 90%, transparent);
|
background: color-mix(in srgb, var(--theme-colors-background) 90%, transparent);
|
||||||
border: 1px solid var(--theme-colors-border);
|
border: 1px solid var(--theme-colors-border);
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
.window-bar {
|
.wrapper {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
grid-area: window-bar;
|
grid-area: window-bar;
|
||||||
height: 30px;
|
height: 100%;
|
||||||
|
padding: var(--theme-spacing-md) var(--theme-spacing-md) 0;
|
||||||
|
background: var(--theme-colors-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: var(--theme-colors-background);
|
||||||
|
border-radius: var(--theme-radius-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.windows-container {
|
.windows-container {
|
||||||
@@ -9,8 +23,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: var(--theme-colors-background);
|
|
||||||
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +107,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: var(--theme-colors-background);
|
|
||||||
border-bottom: 1px solid alpha(var(--theme-colors-border), 0.5);
|
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -205,19 +205,21 @@ export const WindowBar = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.windowBar}>
|
<div className={styles.wrapper}>
|
||||||
{windowBarStyle === Platform.WINDOWS && (
|
<div className={styles.bar}>
|
||||||
<WindowsControls
|
{windowBarStyle === Platform.WINDOWS && (
|
||||||
controls={{ handleClose, handleMaximize, handleMinimize }}
|
<WindowsControls
|
||||||
title={title}
|
controls={{ handleClose, handleMaximize, handleMinimize }}
|
||||||
/>
|
title={title}
|
||||||
)}
|
/>
|
||||||
{windowBarStyle === Platform.MACOS && (
|
)}
|
||||||
<MacOsControls
|
{windowBarStyle === Platform.MACOS && (
|
||||||
controls={{ handleClose, handleMaximize, handleMinimize }}
|
<MacOsControls
|
||||||
title={title}
|
controls={{ handleClose, handleMaximize, handleMinimize }}
|
||||||
/>
|
title={title}
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
.ag-header-fixed {
|
|
||||||
position: fixed !important;
|
|
||||||
top: 65px;
|
|
||||||
z-index: 15;
|
|
||||||
padding: 0 2rem;
|
|
||||||
margin: 0 -2rem;
|
|
||||||
box-shadow: 0 -1px 0 0 #181818;
|
|
||||||
transition: position 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-window-bar {
|
|
||||||
top: 95px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header {
|
|
||||||
z-index: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.window-frame {
|
|
||||||
top: 95px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-transparent {
|
|
||||||
--ag-header-background-color: rgb(0 0 0 / 0%) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-fixed-margin {
|
|
||||||
margin-top: 36px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-cell-comp-wrapper {
|
|
||||||
margin: 0 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-cell,
|
|
||||||
.ag-header-group-cell {
|
|
||||||
padding-right: 0.5rem;
|
|
||||||
padding-left: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ag-header-cell-resize {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
@@ -283,6 +283,10 @@ button {
|
|||||||
--theme-spacing-xs: var(--mantine-spacing-xs);
|
--theme-spacing-xs: var(--mantine-spacing-xs);
|
||||||
--theme-spacing-sm: var(--mantine-spacing-sm);
|
--theme-spacing-sm: var(--mantine-spacing-sm);
|
||||||
--theme-spacing-md: var(--mantine-spacing-md);
|
--theme-spacing-md: var(--mantine-spacing-md);
|
||||||
|
--item-table-sticky-top-win-mac: calc(95px + 2 * var(--theme-spacing-md));
|
||||||
|
--item-table-sticky-top-default: calc(65px + var(--theme-spacing-md));
|
||||||
|
--item-table-sticky-inview-margin-win-mac: calc(-130px - 2 * var(--theme-spacing-md));
|
||||||
|
--item-table-sticky-inview-margin-default: calc(-100px - var(--theme-spacing-md));
|
||||||
--theme-spacing-lg: var(--mantine-spacing-lg);
|
--theme-spacing-lg: var(--mantine-spacing-lg);
|
||||||
--theme-spacing-xl: var(--mantine-spacing-xl);
|
--theme-spacing-xl: var(--mantine-spacing-xl);
|
||||||
--theme-spacing-2xl: var(--mantine-spacing-2xl);
|
--theme-spacing-2xl: var(--mantine-spacing-2xl);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* stylelint-disable selector-class-pattern */
|
/* stylelint-disable selector-class-pattern */
|
||||||
.fs-player-bar-module-container {
|
.fs-player-bar-module-bar {
|
||||||
background: rgb(0 0 0 / 40%) !important;
|
background: rgb(0 0 0 / 40%) !important;
|
||||||
backdrop-filter: blur(2rem);
|
backdrop-filter: blur(2rem);
|
||||||
}
|
}
|
||||||
@@ -125,8 +125,8 @@ table {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
:has(.fs-window-bar-module-window-bar) .fs-main-content-module-main-content-container {
|
:has(.fs-window-bar-module-wrapper) .fs-main-content-module-main-content-container {
|
||||||
height: calc(100vh - 30px);
|
height: calc(100vh - 30px - var(--theme-spacing-md));
|
||||||
}
|
}
|
||||||
|
|
||||||
.mantine-Tabs-root {
|
.mantine-Tabs-root {
|
||||||
|
|||||||
Reference in New Issue
Block a user