2024-02-11 12:59:00 +11:00
import { OnboardingButtons , useDismiss , useNextClick } from '.'
import { onboardingPaths } from 'routes/Onboarding/paths'
2023-08-06 21:29:26 -04:00
import { useStore } from '../../useStore'
2024-03-11 20:26:13 -04:00
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
2023-09-15 22:37:40 -04:00
import {
CameraSystem ,
cameraMouseDragGuards ,
cameraSystems ,
} from 'lib/cameraControls'
2024-04-30 14:37:32 -04:00
import { SettingsSection } from 'components/Settings/SettingsSection'
2023-07-25 10:40:26 -04:00
2023-08-15 21:56:24 -04:00
export default function Units() {
2023-09-08 10:13:35 -04:00
const { buttonDownInStream } = useStore ( ( s ) = > ( {
buttonDownInStream : s.buttonDownInStream ,
2023-08-06 21:29:26 -04:00
} ) )
2023-07-25 10:40:26 -04:00
const dismiss = useDismiss ( )
2023-09-15 22:37:40 -04:00
const next = useNextClick ( onboardingPaths . STREAMING )
const {
settings : {
send ,
state : {
2024-04-02 10:29:34 -04:00
context : {
modeling : { mouseControls } ,
} ,
2023-09-15 22:37:40 -04:00
} ,
} ,
2024-03-11 20:26:13 -04:00
} = useSettingsAuthContext ( )
2023-07-25 10:40:26 -04:00
return (
2023-09-19 18:06:13 -04:00
< div className = "fixed inset-0 z-50 grid items-end justify-start px-4 pointer-events-none" >
2023-08-06 21:29:26 -04:00
< div
className = {
2023-12-18 06:15:26 -05:00
'max-w-2xl border border-chalkboard-50 dark:border-chalkboard-80 shadow-lg flex flex-col justify-center bg-chalkboard-10 dark:bg-chalkboard-90 p-8 rounded' +
2023-09-08 10:13:35 -04:00
( buttonDownInStream ? '' : ' pointer-events-auto' )
2023-08-06 21:29:26 -04:00
}
>
2023-09-15 22:37:40 -04:00
< SettingsSection
2024-03-08 17:59:14 -05:00
title = "Mouse Controls"
description = "Choose what buttons you want to use on your mouse or trackpad to move around the 3D view. Try them out above and choose the one that feels most comfortable to you."
2023-09-19 18:06:13 -04:00
className = "my-4 last-of-type:mb-12"
2024-03-08 17:59:14 -05:00
headingClassName = "text-3xl font-bold"
2023-09-15 22:37:40 -04:00
>
< select
id = "camera-controls"
2023-09-19 18:06:13 -04:00
className = "block w-full px-3 py-1 bg-transparent border border-chalkboard-30"
2024-04-02 10:29:34 -04:00
value = { mouseControls . current }
2023-09-15 22:37:40 -04:00
onChange = { ( e ) = > {
send ( {
2024-04-02 10:29:34 -04:00
type : 'set.modeling.mouseControls' ,
data : {
level : 'user' ,
value : e.target.value as CameraSystem ,
} ,
2023-09-15 22:37:40 -04:00
} )
} }
>
{ cameraSystems . map ( ( program ) = > (
< option key = { program } value = { program } >
{ program }
< / option >
) ) }
< / select >
2023-09-19 18:06:13 -04:00
< ul className = "mx-4 my-2 text-sm leading-relaxed" >
2023-09-15 22:37:40 -04:00
< li >
< strong > Pan : < / strong > { ' ' }
2024-04-02 10:29:34 -04:00
{ cameraMouseDragGuards [ mouseControls . current ] . pan . description }
2023-09-15 22:37:40 -04:00
< / li >
< li >
< strong > Zoom : < / strong > { ' ' }
2024-04-02 10:29:34 -04:00
{ cameraMouseDragGuards [ mouseControls . current ] . zoom . description }
2023-09-15 22:37:40 -04:00
< / li >
< li >
< strong > Rotate : < / strong > { ' ' }
2024-04-02 10:29:34 -04:00
{ cameraMouseDragGuards [ mouseControls . current ] . rotate . description }
2023-09-15 22:37:40 -04:00
< / li >
< / ul >
< / SettingsSection >
2023-12-06 14:44:13 -05:00
< OnboardingButtons
2024-03-08 17:59:14 -05:00
currentSlug = { onboardingPaths . CAMERA }
2023-12-06 14:44:13 -05:00
dismiss = { dismiss }
next = { next }
nextText = "Next: Streaming"
/ >
2023-07-25 10:40:26 -04:00
< / div >
< / div >
)
}