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

UI changes #9823

Merged
merged 4 commits into from
Feb 12, 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
4 changes: 1 addition & 3 deletions web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ function Header({ onToggleNavbar }: HeaderProps) {
</Button>
<Link to="/">
<div className="flex flex-row items-center">
<div className="w-10 mr-5">
<Logo />
</div>
<Logo className="w-10 mr-5" />
</div>
</Link>
<HeaderNavigation />
Expand Down
19 changes: 12 additions & 7 deletions web/src/components/player/LivePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default function LivePlayer({
const { activeMotion, activeAudio, activeTracking } =
useCameraActivity(cameraConfig);

const cameraActive = useMemo(() => activeMotion || activeTracking, [activeMotion, activeTracking])
const cameraActive = useMemo(
() => activeMotion || activeTracking,
[activeMotion, activeTracking]
);
const liveMode = useCameraLiveMode(cameraConfig, preferredLiveMode);

const [liveReady, setLiveReady] = useState(false);
Expand Down Expand Up @@ -168,8 +171,10 @@ export default function LivePlayer({
: "outline-0"
} transition-all duration-500 ${className}`}
>
{(showStillWithoutActivity == false || cameraActive) &&
player}
<div className="absolute top-0 left-0 right-0 rounded-2xl z-10 w-full h-[30%] bg-gradient-to-b from-black/20 to-transparent pointer-events-none"></div>
<div className="absolute bottom-0 left-0 right-0 rounded-2xl z-10 w-full h-[10%] bg-gradient-to-t from-black/20 to-transparent pointer-events-none"></div>

{(showStillWithoutActivity == false || cameraActive) && player}

<div
className={`absolute left-0 top-0 right-0 bottom-0 w-full ${
Expand All @@ -180,14 +185,14 @@ export default function LivePlayer({
className="w-full h-full"
camera={cameraConfig.name}
showFps={false}
reloadInterval={(cameraActive && !liveReady) ? 200 : 30000}
reloadInterval={cameraActive && !liveReady ? 200 : 30000}
/>
</div>

<div className="absolute flex left-2 top-2 gap-2">
<Chip
in={activeMotion}
className={`bg-gradient-to-br from-gray-400 to-gray-500 bg-gray-500/90`}
className={`bg-gradient-to-br from-gray-400 to-gray-500 bg-gray-500`}
>
<MdLeakAdd className="w-4 h-4 text-motion" />
<div className="ml-1 text-white text-xs">Motion</div>
Expand All @@ -196,15 +201,15 @@ export default function LivePlayer({
{cameraConfig.audio.enabled_in_config && (
<Chip
in={activeAudio}
className={`bg-gradient-to-br from-gray-400 to-gray-500 bg-gray-500/90`}
className={`bg-gradient-to-br from-gray-400 to-gray-500 bg-gray-500`}
>
<BsSoundwave className="w-4 h-4 text-audio" />
<div className="ml-1 text-white text-xs">Sound</div>
</Chip>
)}
</div>

<Chip className="absolute right-2 top-2 bg-gradient-to-br from-gray-300/50 to-gray-500/90">
<Chip className="absolute right-2 top-2 bg-gradient-to-br from-gray-400 to-gray-500 bg-gray-500">
{recording == "ON" && (
<MdCircle className="w-2 h-2 drop-shadow-md shadow-danger text-danger" />
)}
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/player/MsePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ function MSEPlayer({ camera, className, onPlaying }: MSEPlayerProps) {

useEffect(() => {
onConnect();

return () => {
onDisconnect();
};
}, [wsURL]);

return (
Expand Down
26 changes: 14 additions & 12 deletions web/src/components/settings/SettingsNavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ export default function SettingsNavItems({ className }: SettingsNavItemsProps) {
<>
<div className={className}>
<DropdownMenu>
<DropdownMenuTrigger>
<Tooltip>
<TooltipTrigger asChild>
<Button size="icon" variant="ghost">
<LuSettings />
</Button>
</TooltipTrigger>
<TooltipContent side="right">
<p>Settings</p>
</TooltipContent>
</Tooltip>
<DropdownMenuTrigger asChild>
<a href="#">
<Tooltip>
<TooltipTrigger asChild>
<Button size="icon" variant="ghost">
<LuSettings />
</Button>
</TooltipTrigger>
<TooltipContent side="right">
<p>Settings</p>
</TooltipContent>
</Tooltip>
</a>
</DropdownMenuTrigger>
<DropdownMenuContent className="md:w-72 mr-5">
<DropdownMenuLabel>System</DropdownMenuLabel>
Expand Down Expand Up @@ -242,7 +244,7 @@ export default function SettingsNavItems({ className }: SettingsNavItemsProps) {
</DropdownMenuContent>
</DropdownMenu>
<Tooltip>
<TooltipTrigger>
<TooltipTrigger asChild>
<Button size="icon" variant="ghost">
<VscAccount />
</Button>
Expand Down