Skip to content

Commit

Permalink
More styles cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Mar 9, 2024
1 parent 0668941 commit fa7bb04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 3 additions & 2 deletions client/app/cards/Pilot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export function Pilot({cardLoaded}: CardProps) {
<div className="grid grid-cols-4 h-full place-content-center gap-4">
<div className="flex flex-col justify-between">
<ImpulseControls cardLoaded={cardLoaded} />
<div className="flex gap-4 w-full flex-1 mt-2">
<div className="flex gap-4 flex-1 mt-2">
<LinearJoystick
className="h-[calc(100%-2.5rem)]"
onDrag={({y}) => direction({z: -y})}
vertical
gamepadKey="z-thrusters"
Expand All @@ -60,7 +61,7 @@ export function Pilot({cardLoaded}: CardProps) {
<UntouchableLabel className="bottom-1">Aft</UntouchableLabel>
</LinearJoystick>
<Joystick
className="flex-1"
className="w-[calc(100%-2.5rem)] h-[calc(100%-2.5rem)]"
onDrag={({x, y}) => direction({y: -y, x: -x})}
gamepadKeys={{x: "x-thrusters", y: "y-thrusters"}}
>
Expand Down
3 changes: 2 additions & 1 deletion client/app/components/ui/Joystick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {GamepadKey} from "@client/hooks/useGamepadStore";
import {animated as a} from "@react-spring/web";
import {useJoystick} from "@client/hooks/useJoystick";
import {ReactNode} from "react";
import {cn} from "@client/utils/cn";

export const Joystick = ({
children,
Expand All @@ -21,7 +22,7 @@ export const Joystick = ({
});

return (
<div className={`relative aspect-square ${className}`}>
<div className={cn(`relative aspect-square`, className)}>
<div
ref={containerRef}
className="top-0 absolute bg-black/50 border-2 border-white/50 rounded-full w-full h-full flex justify-center items-center"
Expand Down
6 changes: 1 addition & 5 deletions server/src/components/physicsWorld.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import z from "zod";

import {RAPIER} from "../init/rapier";

const World = RAPIER.World;

export const physicsWorld = z
.object({
enabled: z.boolean().default(true),
Expand All @@ -15,6 +11,6 @@ export const physicsWorld = z
parentId: z.number().optional(),
})
.default({}),
world: z.instanceof(World).nullable().default(null),
world: z.any().nullable().default(null),
})
.default({});

0 comments on commit fa7bb04

Please sign in to comment.