Skip to content

Commit

Permalink
Merge pull request #590 from hydralauncher/feature/adding-animation-t…
Browse files Browse the repository at this point in the history
…o-game-details

Feature/adding animation to game details
  • Loading branch information
thegrannychaseroperation authored Jun 12, 2024
2 parents 33e9caf + 713a3f4 commit 55d1bfb
Show file tree
Hide file tree
Showing 57 changed files with 542 additions and 579 deletions.
1 change: 1 addition & 0 deletions src/renderer/src/app.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ globalStyle("*", {

globalStyle("::-webkit-scrollbar", {
width: "9px",
backgroundColor: vars.color.darkBackground,
});

globalStyle("::-webkit-scrollbar-track", {
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "@renderer/hooks";

import * as styles from "./app.css";
import { themeClass } from "./theme.css";

import { Outlet, useLocation, useNavigate } from "react-router-dom";
import {
Expand All @@ -21,8 +20,6 @@ import {
closeToast,
} from "@renderer/features";

document.body.classList.add(themeClass);

export interface AppProps {
children: React.ReactNode;
}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/backdrop/backdrop.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { keyframes } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";

import { SPACING_UNIT } from "../../theme.css";

export const backdropFadeIn = keyframes({
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/badge/badge.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from "@vanilla-extract/css";

import { SPACING_UNIT } from "../../theme.css";

export const badge = style({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from "@vanilla-extract/css";

import { SPACING_UNIT, vars } from "../../theme.css";

export const bottomPanel = style({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SPACING_UNIT, vars } from "../../theme.css";
import { style } from "@vanilla-extract/css";

import { SPACING_UNIT, vars } from "../../theme.css";

export const checkboxField = style({
display: "flex",
flexDirection: "row",
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/game-card/game-card.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from "@vanilla-extract/css";

import { SPACING_UNIT, vars } from "../../theme.css";

export const card = style({
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/hero/hero.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { style } from "@vanilla-extract/css";

import { SPACING_UNIT, vars } from "../../theme.css";

export const hero = style({
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/modal/modal.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { keyframes, style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";

import { SPACING_UNIT, vars } from "../../theme.css";

export const scaleFadeIn = keyframes({
Expand Down
18 changes: 15 additions & 3 deletions src/renderer/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ModalProps {
onClose: () => void;
large?: boolean;
children: React.ReactNode;
clickOutsideToClose?: boolean;
}

export function Modal({
Expand All @@ -23,6 +24,7 @@ export function Modal({
onClose,
large,
children,
clickOutsideToClose = true,
}: ModalProps) {
const [isClosing, setIsClosing] = useState(false);
const modalContentRef = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -60,6 +62,18 @@ export function Modal({
}
};

window.addEventListener("keydown", onKeyDown);

return () => {
window.removeEventListener("keydown", onKeyDown);
};
}

return () => {};
}, [handleCloseClick, visible]);

useEffect(() => {
if (clickOutsideToClose) {
const onMouseDown = (e: MouseEvent) => {
if (!isTopMostModal()) return;
if (modalContentRef.current) {
Expand All @@ -73,17 +87,15 @@ export function Modal({
}
};

window.addEventListener("keydown", onKeyDown);
window.addEventListener("mousedown", onMouseDown);

return () => {
window.removeEventListener("keydown", onKeyDown);
window.removeEventListener("mousedown", onMouseDown);
};
}

return () => {};
}, [handleCloseClick, visible]);
}, [clickOutsideToClose, handleCloseClick]);

if (!visible) return null;

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/components/select-field/select-field.css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { SPACING_UNIT, vars } from "../../theme.css";
import { style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";

import { SPACING_UNIT, vars } from "../../theme.css";

export const select = recipe({
base: {
display: "inline-flex",
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/sidebar/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AppsIcon, GearIcon, HomeIcon } from "@primer/octicons-react";

import { DownloadIcon } from "./download-icon";

export const routes = [
Expand Down
45 changes: 45 additions & 0 deletions src/renderer/src/components/sidebar/sidebar.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";

import { SPACING_UNIT, vars } from "../../theme.css";

export const sidebar = recipe({
Expand All @@ -11,6 +12,7 @@ export const sidebar = recipe({
transition: "opacity ease 0.2s",
borderRight: `solid 1px ${vars.color.border}`,
position: "relative",
overflow: "hidden",
},
variants: {
resizing: {
Expand Down Expand Up @@ -123,3 +125,46 @@ export const section = style({
flexDirection: "column",
paddingBottom: `${SPACING_UNIT}px`,
});

export const profileButton = style({
display: "flex",
cursor: "pointer",
transition: "all ease 0.1s",
gap: `${SPACING_UNIT + SPACING_UNIT / 2}px`,
alignItems: "center",
padding: `${SPACING_UNIT * 2}px ${SPACING_UNIT * 2}px`,
color: vars.color.muted,
borderBottom: `solid 1px ${vars.color.border}`,
boxShadow: "0px 0px 15px 0px #000000",
":hover": {
backgroundColor: "rgba(255, 255, 255, 0.15)",
},
});

export const profileAvatar = style({
width: "30px",
height: "30px",
borderRadius: "50%",
display: "flex",
justifyContent: "center",
alignItems: "center",
backgroundColor: vars.color.background,
position: "relative",
});

export const profileButtonInformation = style({
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
});

export const statusBadge = style({
width: "9px",
height: "9px",
borderRadius: "50%",
backgroundColor: vars.color.danger,
position: "absolute",
bottom: "-2px",
right: "-3px",
zIndex: "1",
});
Loading

0 comments on commit 55d1bfb

Please sign in to comment.