Allow bluring bg for loading
Some checks are pending
Tests / tests (push) Waiting to run

This commit is contained in:
Dustin Brett 2025-03-11 07:43:26 -07:00
parent c2cdf6c98a
commit b4270dee73
4 changed files with 17 additions and 2 deletions

View File

@ -1,7 +1,9 @@
import { m as motion } from "motion/react"; import { m as motion } from "motion/react";
import styled from "styled-components"; import styled from "styled-components";
import StyledLoading from "components/system/Files/FileManager/StyledLoading";
type StyledWindowProps = { type StyledWindowProps = {
$backgroundBlur?: string;
$backgroundColor?: string; $backgroundColor?: string;
$isForeground: boolean; $isForeground: boolean;
}; };
@ -28,6 +30,11 @@ const StyledWindow = styled(motion.section)<StyledWindowProps>`
header + * { header + * {
height: ${({ theme }) => `calc(100% - ${theme.sizes.titleBar.height}px)`}; height: ${({ theme }) => `calc(100% - ${theme.sizes.titleBar.height}px)`};
} }
${StyledLoading} {
backdrop-filter: ${({ $backgroundBlur }) =>
$backgroundBlur ? `blur(${$backgroundBlur})` : undefined};
}
`; `;
export default StyledWindow; export default StyledWindow;

View File

@ -14,8 +14,13 @@ const Window: FC<ComponentProcessProps> = ({ children, id }) => {
linkElement, linkElement,
processes: { [id]: process }, processes: { [id]: process },
} = useProcesses(); } = useProcesses();
const { backgroundColor, Component, hideTitlebar, peekElement } = const {
process || {}; backgroundBlur,
backgroundColor,
Component,
hideTitlebar,
peekElement,
} = process || {};
const { foregroundId } = useSession(); const { foregroundId } = useSession();
const isForeground = id === foregroundId; const isForeground = id === foregroundId;
const { zIndex, ...focusableProps } = useFocusable(id); const { zIndex, ...focusableProps } = useFocusable(id);
@ -32,6 +37,7 @@ const Window: FC<ComponentProcessProps> = ({ children, id }) => {
return ( return (
<RndWindow id={id} zIndex={zIndex}> <RndWindow id={id} zIndex={zIndex}>
<StyledWindow <StyledWindow
$backgroundBlur={backgroundBlur}
$backgroundColor={backgroundColor} $backgroundColor={backgroundColor}
$isForeground={isForeground} $isForeground={isForeground}
{...focusableProps} {...focusableProps}

View File

@ -287,6 +287,7 @@ const directory: Processes = {
}, },
Terminal: { Terminal: {
Component: dynamic(() => import("components/apps/Terminal")), Component: dynamic(() => import("components/apps/Terminal")),
backgroundBlur: "8px",
backgroundColor: "rgba(12, 12, 12, 0.5)", backgroundColor: "rgba(12, 12, 12, 0.5)",
defaultSize: { defaultSize: {
height: 374, height: 374,

View File

@ -49,6 +49,7 @@ export type RelativePosition = {
type BaseProcessArguments = { type BaseProcessArguments = {
allowResizing?: boolean; allowResizing?: boolean;
autoSizing?: boolean; autoSizing?: boolean;
backgroundBlur?: string;
backgroundColor?: string; backgroundColor?: string;
dependantLibs?: string[]; dependantLibs?: string[];
hideMaximizeButton?: boolean; hideMaximizeButton?: boolean;