redesign feature carousel

This commit is contained in:
jeffvli
2025-11-22 13:22:02 -08:00
parent e80fc1a513
commit 6a0b36cfa6
6 changed files with 612 additions and 230 deletions
@@ -1,28 +1,71 @@
import { generateColors } from '@mantine/colors-generator';
import clsx from 'clsx';
import { useEffect, useState } from 'react';
import styles from './library-background-overlay.module.css';
import { useAppThemeColors } from '/@/renderer/themes/use-app-theme';
interface LibraryBackgroundOverlayProps {
backgroundColor?: string;
headerRef: React.RefObject<HTMLDivElement | null>;
opacity?: number;
}
export const LibraryBackgroundOverlay = ({
backgroundColor,
headerRef,
opacity = 0.7,
}: LibraryBackgroundOverlayProps) => {
const height = useHeaderHeight(headerRef);
return (
<div
className={styles.overlay}
style={{
backgroundColor,
height: height ? `${height + 64}px` : undefined,
opacity,
}}
/>
);
};
interface BackgroundOverlayProps {
backgroundColor?: string;
direction?: string;
height?: number | string;
opacity?: number;
}
export const BackgroundOverlay = ({
backgroundColor,
direction = 'to bottom',
height = '100%',
opacity,
}: BackgroundOverlayProps) => {
const theme = useAppThemeColors();
const colors = generateColors(backgroundColor || theme.color['--theme-colors-background']);
return (
<div
className={clsx(styles.backgroundOverlay)}
style={
{
'--color-from': colors[6],
'--color-to': colors[9],
'--direction-and-possibly-color-interpolation': direction,
'--dither': 'none',
backgroundColor: backgroundColor,
height,
opacity,
} as React.CSSProperties
}
/>
);
};
interface LibraryBackgroundProps {
blur?: number;
headerRef: React.RefObject<HTMLDivElement | null>;