diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx index e0da05a6..a24cb9dc 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import styles from "./Slider.module.scss"; import MUI_Slider from "@mui/material/Slider"; +import { clsx } from "clsx"; export const Slider = (props) => { const [baseColor, setBaseColor] = useState(""); @@ -17,7 +18,7 @@ export const Slider = (props) => { }, []); return ( -
+
{ marks={props.marks} track={props.track} orientation={props.orientation} + valueLabelFormat={props.valueLabelFormat ? props.valueLabelFormat : null} sx={{ color: baseColor, "& .MuiSlider-thumb": { @@ -43,18 +45,19 @@ export const Slider = (props) => { backgroundColor: toolTipColor, padding: "0.6rem 1rem", lineHeight: "1.15", - top: "-1.4rem", - "&::before": { - left: "30%", - width: "1rem", - height: "1rem", - clipPath: "polygon(50% 0, 100% 100%, 0 100%)", - }, + // top: "-1.4rem", + // "&::before": { + // left: "30%", + // width: "1rem", + // height: "1rem", + // clipPath: "polygon(50% 0, 100% 100%, 0 100%)", + // }, }, }, "& .MuiSlider-markLabel": { fontSize: "1.4rem", color: "white", + whiteSpace: "nowrap", }, "& .MuiSlider-markLabelActive": { color: activeColor, diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.module.scss b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.module.scss index 907f7529..645a3a24 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.module.scss +++ b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.module.scss @@ -4,7 +4,7 @@ align-items: center; // 中央に揃え justify-content: center; width: 100%; - padding-left: 4rem; + // padding-left: 4rem; } .range_slider { 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 b78be1be..b4191672 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 @@ -1,21 +1,151 @@ import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; import styles from "./Vr.module.scss"; import { Slider } from "../_components/"; +import { clsx } from "clsx"; export const Vr = () => { + const { t } = useTranslation(); + const [is_opened_position_controller, setIsOpenedPositionController] = useState(true); + + const toggleController = () => { + setIsOpenedPositionController(!is_opened_position_controller); + }; + + const toggle_button_class_names__position = clsx(styles.controller_type_switcher, { + [styles.is_selected]: is_opened_position_controller + }); + const toggle_button_class_names__rotation = clsx(styles.controller_type_switcher, { + [styles.is_selected]: !is_opened_position_controller + }); + + return ( +
+
+
+

Position

+
+
+

Rotation

+
+
+
+ {is_opened_position_controller + ? + : + } +
+ + +
+ ); +}; + +const PositionControls = () => { + const { t } = useTranslation(); const [position, setPosition] = useState({ x: 0, y: 0, z: 0 }); - const [rotation, setRotation] = useState({ rotate_x: 0, rotate_y: 0, rotate_z: 0 }); - const [opacity, setOpacity] = useState(1); - const [ui_scaling, setUiScaling] = useState(100); const handlePositionChange = (axis, value) => { setPosition((prev) => ({ ...prev, [axis]: value })); }; + return ( +
+
+ + handlePositionChange("x", value)} + /> +
+
+ + handlePositionChange("y", value)} + orientation="vertical" + /> +
+
+ + handlePositionChange("z", value)} + orientation="vertical" + /> +
+
+ ); +}; +const RotationControls = () => { + const { t } = useTranslation(); + const [rotation, setRotation] = useState({ rotate_x: 0, rotate_y: 0, rotate_z: 0 }); + const handleRotationChange = (axis, value) => { setRotation((prev) => ({ ...prev, [axis]: value })); }; + + return ( +
+
+ + handleRotationChange("rotate_x", -value)} + orientation="vertical" + /> +
+
+ + handleRotationChange("rotate_y", value)} + /> +
+
+ + handleRotationChange("rotate_z", value)} + orientation="vertical" + /> +
+
+ ); +}; + + +const OtherControls = () => { + const { t } = useTranslation(); + const [opacity, setOpacity] = useState(1); + const [ui_scaling, setUiScaling] = useState(100); + const handleOpacityChange = (value) => { setOpacity(value / 100); }; @@ -24,126 +154,70 @@ export const Vr = () => { setUiScaling(value); }; + const ui_variable_opacity = (opacity * 100).toFixed(0); - const scale = position.z >= 0 - ? (1 - position.z / 200) * (ui_scaling / 100) - : (1 + Math.abs(position.z) / 200) * (ui_scaling / 100); + const [display_duration, setDisplayDuration] = useState(5); + const [fadeout_duration, setFadeoutDuration] = useState(2); + + const handleDisplayDurationChange = (value) => { + setDisplayDuration(value); + }; + + const handleFadeoutDurationChange = (value) => { + setFadeoutDuration(value); + }; - const x_factor = Math.min(Math.abs(position.x) / 100, 1); - const y_factor = Math.min(Math.abs(position.y) / 100, 1); - - const translate_x = position.x + (position.z * x_factor * (position.x >= 0 ? -1 : 1)); - const translate_y = -1 * (position.y + (position.z * y_factor * (position.y >= 0 ? -1 : 1))); - - - return ( -
-
-
- - handlePositionChange("z", value)} - orientation="vertical" - /> -
-
-
-

- 実際の表示とは大きく違います。これはただのイメージ図です。 -

-
-
-
- - handlePositionChange("y", value)} - orientation="vertical" - /> -
-
- - handlePositionChange("x", value)} - /> -
+ return( +
+
+ +
-
-
- - handleRotationChange("rotate_x", value)} - /> -
-
- - handleRotationChange("rotate_y", value)} - /> -
-
- - handleRotationChange("rotate_z", value)} - /> -
-
- - -
-
- - -
+
+ + +
+
+ + +
+
+ +
); -}; +}; \ 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 8c2f3bc4..299b3c2d 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 @@ -1,79 +1,182 @@ -.app { +.container { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; - margin-top: 4rem; + padding: 2rem; } -.canvas_container { - display: flex; - position: relative; -} - -.canvas { - width: 40rem; - height: 30rem; - border: 0.1rem solid #fff; - background-color: var(--dark_800_color); +.controller_type_switch { display: flex; + border: 0.1rem solid var(--dark_600_color); + border-radius: 0.4rem; + width: 50%; align-items: center; justify-content: center; + cursor: pointer; + color: var(--dark_600_color); + &:hover { + color: var(--dark_400_color); + } +} +.controller_type_switcher { + width: 100%; + &.is_selected { + background-color: var(--dark_850_color); + } + &.is_selected .controller_switcher_label { + color: var(--dark_basic_text_color); + } +} +.controller_switcher_label { + padding: 1rem; + font-size: 1.6rem; +} + +.position_rotation_controls_box { + margin-top: 14rem; position: relative; + aspect-ratio: 1 / 1; + width: 36%; + max-width: 40rem; + transform: translate(-10%); } -.chat_box { - max-width: 20rem; - background-color: #33363a; - border-radius: 0.4rem; - padding: 1.2rem; - position: absolute; - transform-origin: center; - transition: transform 0.1s ease-out, opacity 0.1s ease-out; -} +// .position_controls { +// background-color: gray; +// } -.chat_text { - font-size: 1.2rem; -} +// .position_wrapper { +// background-color: gray; +// } -.x_position { - position: absolute; - bottom: -6rem; - left: 50%; - transform: translateX(-50%); +.slider_label { + font-size: 1.6rem; width: 100%; } - -.y_position { +.x_position_label { position: absolute; - right: -8rem; - top: 50%; - transform: translateY(-50%); - writing-mode: vertical-rl; - text-orientation: mixed; + bottom: -4rem; + right: -30%; + text-align: end; +} +.y_position_label { + position: absolute; + top: -27%; + left: 10%; +} +.z_position_label { + position: absolute; + top: 30%; + left: 80%; +} + +.x_position_slider { + position: absolute; + bottom: 0; + left: 27%; + width: 100%; + height: 0%; +} + +.y_position_slider { + position: absolute; + bottom: 27%; + left: 0; + width: 0%; height: 100%; } -.z_position { +.z_position_slider { position: absolute; - left: -8rem; - top: 50%; - transform: translateY(-50%); - writing-mode: vertical-rl; - text-orientation: mixed; + bottom: 61%; + left: 61%; + transform: translate(50%,50%) rotate(45deg); + width: 0%; height: 100%; } + + + +// .rotation_controls { +// background-color: gray; +// } + +// .rotation_wrapper { +// background-color: gray; +// } + +.x_rotation_label { + position: absolute; + top: -27%; + left: 10%; +} +.y_rotation_label { + position: absolute; + bottom: -4rem; + right: -30%; + text-align: end; +} +.z_rotation_label { + position: absolute; + top: -10%; + right: -110%; +} + +.x_rotation_slider { + position: absolute; + bottom: 27%; + left: 0; + width: 0%; + height: 100%; +} + +.y_rotation_slider { + position: absolute; + bottom: 0; + left: 27%; + width: 100%; + height: 0%; +} + +.z_rotation_slider { + position: absolute; + bottom: 90%; + left: 100%; + transform: translate(50%,50%) rotate(-45deg); + width: 0%; + height: 100%; +} + + + + .other_controls { margin-top: 10rem; display: flex; flex-direction: column; align-items: center; - gap: 1rem; + gap: 2rem; width: 100%; + max-width: 56rem; } -.x_rotation, .y_rotation, .z_rotation, .opacity, .ui_scaling { +.other_controls_wrapper { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + width: 100%; + position: relative; +} +.other_controls_slider { + margin-left: 18rem; +} + +.other_controls_slider_label { + position: absolute; + font-size: 1.6rem; width: 100%; } \ No newline at end of file