diff --git a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx index fabe60e8..cea2ffc6 100644 --- a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx @@ -22,6 +22,8 @@ import { useOverlayShowOnlyTranslatedMessages, } from "@logics_configs"; +import RedoSvg from "@images/redo.svg?react"; + export const Vr = () => { const { t } = useTranslation(); const [is_opened_small_settings, setIsOpenedSmallSettings] = useState(true); @@ -53,6 +55,7 @@ export const Vr = () => { { { @@ -115,8 +120,8 @@ const OverlaySettingsContainer = ({ setTimeoutId(newTimeoutId); }; - const selectTrackerFunction = (value) => { - const new_data = { ...settings, tracker: value }; + const selectFunction = (key, value) => { + const new_data = { ...settings, [key]: value }; set_overlay_settings(new_data); }; @@ -137,15 +142,15 @@ const OverlaySettingsContainer = ({
{is_opened_position_controller ? ( - + ) : ( - + )}
selectFunction("tracker", value)} name={id} options={[ { id: "HMD", label: t("config_page.vr.hmd") }, @@ -180,13 +185,16 @@ const PageSwitcherContainer = (props) => { ); }; -const PositionControls = ({settings, onchangeFunction, ui_configs}) => { +const PositionControls = ({settings, onchangeFunction, selectFunction, ui_configs, default_ui_configs}) => { const { t } = useTranslation(); return (
- +

+ {t("config_page.vr.x_position")} + selectFunction("x_pos", default_ui_configs.x_pos)} /> +

{ />
- +

+ {t("config_page.vr.y_position")} + selectFunction("y_pos", default_ui_configs.y_pos)} /> +

{ />
- +

+ {t("config_page.vr.z_position")} + selectFunction("z_pos", default_ui_configs.z_pos)} /> +

{ ); }; -const RotationControls = ({settings, onchangeFunction}) => { +const RotationControls = ({settings, onchangeFunction, selectFunction, default_ui_configs}) => { const { t } = useTranslation(); return (
- +

+ {t("config_page.vr.x_rotation")} + selectFunction("x_rotation", default_ui_configs.y_pos)} /> +

{ />
- +

+ {t("config_page.vr.y_rotation")} + selectFunction("y_rotation", default_ui_configs.y_pos)} /> +

{ />
- +

+ {t("config_page.vr.z_rotation")} + selectFunction("z_rotation", default_ui_configs.y_pos)} /> +

{ return(
-
-
- +

{t("config_page.vr.display_duration")}

{ />
- +

{t("config_page.vr.fadeout_duration")}

{ />
); +}; + +const ResetButton = ({onClickFunction}) => { + return ( + + ); }; \ No newline at end of file diff --git a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss index eb4b88e3..ff370d92 100644 --- a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss +++ b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss @@ -65,19 +65,24 @@ // } .slider_label { - font-size: 1.6rem; + font-size: 1.4rem; width: 100%; + display: flex; + align-items: center; + gap: 0.6rem; + white-space: nowrap; } .x_position_label { position: absolute; - bottom: -4rem; - right: -30%; - text-align: end; + bottom: -4.6rem; + right: -46%; + justify-content: end; } .y_position_label { position: absolute; - top: -36%; + top: -44%; left: 10%; + justify-content: start; } .z_position_label { position: absolute; @@ -123,14 +128,14 @@ .x_rotation_label { position: absolute; - top: -36%; + top: -44%; left: 10%; } .y_rotation_label { position: absolute; - bottom: -4rem; - right: -30%; - text-align: end; + bottom: -4.6rem; + right: -46%; + justify-content: end; } .z_rotation_label { position: absolute; @@ -163,6 +168,33 @@ height: 100%; } + +.slider_reset_button { + background-color: var(--dark_850_color); + padding: 0.6rem; + display: flex; + justify-content: center; + align-items: center; + border-radius: 0.4rem; + flex-shrink: 0; + &:hover { + background-color: var(--dark_800_color); + & .slider_reset_svg { + color: var(--dark_200_color); + } + } + &:active { + background-color: var(--dark_900_color); + } +} + +.slider_reset_svg { + width: 1.4rem; + color: var(--dark_550_color); +} + + + .other_controls { margin-top: 6rem; display: flex;