Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make loading screen background dark #4449

Merged
merged 5 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/builder/app/builder/builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ body {
overflow: hidden;
overscroll-behavior: contain;
-webkit-font-smoothing: antialiased;
/*
This is the top bar and loading screen color (--colors-backgroundTopbar).
We are setting it to avoid a white screen flash when opening project from the dashboard.
*/
background-color: #2d2d2d;
}

[data-radix-scroll-area-viewport] {
Expand Down
3 changes: 1 addition & 2 deletions apps/builder/app/builder/builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const SidePanel = ({
fg: 0,
// Left sidebar tabs won't be able to pop out to the right if we set overflowX to auto.
//overflowY: "auto",
bc: theme.colors.backgroundPanel,
backgroundColor: theme.colors.backgroundPanel,
height: "100%",
...css,
}}
Expand Down Expand Up @@ -403,7 +403,6 @@ export const Builder = ({
? false
: true
}
backgroundColor={theme.colors.backgroundTopbar}
/>
}
/>
Expand Down
10 changes: 2 additions & 8 deletions apps/builder/app/builder/shared/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useInterval } from "~/shared/hook-utils/use-interval";

export const LoadingBackground = ({
show,
backgroundColor,
onTransitionEnd,
}: {
show: boolean;
backgroundColor: string;
onTransitionEnd?: () => void;
}) => {
const [transitionEnded, setTransitionEnded] = useState(false);
Expand All @@ -26,7 +24,7 @@ export const LoadingBackground = ({
transitionDuration: "300ms",
pointerEvents: "none",
transitionProperty: "opacity",
backgroundColor,
backgroundColor: theme.colors.backgroundTopbar,
opacity: show ? 1 : 0,
isolation: "isolate",
}}
Expand Down Expand Up @@ -83,7 +81,6 @@ export const Loading = ({ state }: { state: LoadingState }) => {
>
<LoadingBackground
show={state.state !== "ready"}
backgroundColor={theme.colors.backgroundCanvas}
onTransitionEnd={() => {
setTransitionEnded(true);
}}
Expand All @@ -96,10 +93,7 @@ export const Loading = ({ state }: { state: LoadingState }) => {
gap="3"
css={{ isolation: "isolate" }}
>
<WebstudioIcon
size={60}
style={{ filter: "drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7))" }}
/>
<WebstudioIcon size={60} />
<Progress value={fakeProgress} />
</Flex>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/app/builder/sidebar-left/sidebar-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const SidebarTabsContent = styled(TabsContent, {
top: 0,
left: "100%",
height: "100%",
bc: theme.colors.backgroundPanel,
backgroundColor: theme.colors.backgroundPanel,
outline: "none",
// Drawing border this way to ensure content still has full width, avoid subpixels and give layout round numbers
"&::after": {
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/app/dashboard/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";

const containerStyle = css({
px: theme.spacing[13],
bc: theme.colors.backgroundPanel,
backgroundColor: theme.colors.backgroundPanel,
height: theme.spacing[15],
boxShadow: theme.shadows.brandElevationBig,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CircleOutline = styled(Box, {
left: -CIRCLE_SIZE / 2 - OUTLINE_WIDTH,
borderRadius: "50%",
pointerEvents: "none",
bc: theme.colors.borderContrast,
backgroundColor: theme.colors.borderContrast,
});

const Circle = styled(Box, {
Expand Down