-
+
{
/>
-
+
{
/>
-
+
{t("config_page.vr.display_duration")}
{
/>
-
+
{t("config_page.vr.fadeout_duration")}
{
/>
);
+};
+
+const ResetButton = ({onClickFunction}) => {
+ return (
+
+ );
+};
+
+import SquareSvg from "@images/square.svg?react";
+import TriangleSvg from "@images/triangle.svg?react";
+import { randomIntMinMax } from "@utils";
+
+const SendSampleTextToggleButton = () => {
+ const { t } = useTranslation();
+ const { sendTextToOverlay } = useSendTextToOverlay();
+ const [is_started, setIsStarted] = useState(false);
+
+ useEffect(() => {
+ let interval_id;
+
+ if (is_started) {
+ interval_id = setInterval(() => {
+ const text_data = Array.from(
+ { length: randomIntMinMax(1, 5) },
+ () => t("config_page.vr.sample_text_button.sample_text")
+ ).join(" ");
+ sendTextToOverlay(text_data);
+ }, 1000);
+ };
+
+ return () => {
+ if (interval_id) {
+ clearInterval(interval_id);
+ }
+ };
+ }, [is_started]);
+
+ const toggleFunction = () => {
+ setIsStarted(!is_started);
+ };
+
+ const label = is_started
+ ? t("config_page.vr.sample_text_button.stop")
+ : t("config_page.vr.sample_text_button.start");
+
+ return (
+
+
+
{label}
+
+ );
};
\ 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..c18c2be7 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
@@ -56,6 +56,54 @@
transform: translate(-10%);
}
+.sample_text_button_wrapper {
+ position: absolute;
+ bottom: 0;
+ left: -74%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+.sample_text_button {
+ background-color: var(--dark_850_color);
+ padding: 1.8rem;
+ border-radius: 50%;
+ &:hover {
+ background-color: var(--dark_800_color);
+ }
+ &:active {
+ background-color: var(--dark_925_color);
+ }
+ &.is_started {
+ background-color: var(--primary_600_color);
+ &:hover {
+ background-color: var(--primary_500_color);
+ }
+ &:active {
+ background-color: var(--primary_700_color);
+ }
+ }
+}
+.sample_text_button_triangle_svg, .sample_text_button_square_svg {
+ width: 2.4rem;
+}
+.sample_text_button_triangle_svg {
+ transform: translateX(10%) rotate(90deg);
+}
+.sample_text_button_label {
+ color: var(--dark_basic_text_color);
+ position: absolute;
+ left: 50%;
+ top: 110%;
+ // bottom: -2rem;
+ transform: translateX(-50%);
+ white-space: pre-wrap;
+ font-size: 1.2rem;
+ width: max-content;
+ text-align: center;
+}
+
// .position_controls {
// background-color: gray;
// }
@@ -65,19 +113,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 +176,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 +216,33 @@
height: 100%;
}
+
+.slider_reset_button {
+ background-color: var(--dark_875_color);
+ padding: 0.6rem;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 0.4rem;
+ flex-shrink: 0;
+ &:hover {
+ background-color: var(--dark_825_color);
+ & .slider_reset_svg {
+ color: var(--dark_200_color);
+ }
+ }
+ &:active {
+ background-color: var(--dark_925_color);
+ }
+}
+
+.slider_reset_svg {
+ width: 1.4rem;
+ color: var(--dark_550_color);
+}
+
+
+
.other_controls {
margin-top: 6rem;
display: flex;
diff --git a/src-ui/app/config_page/sidebar_section/SidebarSection.module.scss b/src-ui/app/config_page/sidebar_section/SidebarSection.module.scss
index 849d34f1..6051cff6 100644
--- a/src-ui/app/config_page/sidebar_section/SidebarSection.module.scss
+++ b/src-ui/app/config_page/sidebar_section/SidebarSection.module.scss
@@ -4,7 +4,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
- padding: 0rem 0rem 5.8rem 1.6rem;
+ padding: 0rem 0rem 5.8rem 1.2rem;
max-height: 60rem;
}
@@ -23,7 +23,7 @@
justify-content: left;
align-items: center;
color: var(--dark_basic_text_color);
- padding: 0.8rem 0 0.8rem 1.2rem;
+ padding: 0.8rem 0 0.8rem 1rem;
cursor: pointer;
&:hover {
background-color: var(--dark_800_color);
diff --git a/src-ui/app/modal_controller/ModalController.module.scss b/src-ui/app/modal_controller/ModalController.module.scss
index 914fedef..567a1a7f 100644
--- a/src-ui/app/modal_controller/ModalController.module.scss
+++ b/src-ui/app/modal_controller/ModalController.module.scss
@@ -11,7 +11,7 @@
position: absolute;
width: 100%;
height: 100%;
- background-color: (#ffffff22);
+ background-color: var(--dark_550_color_22);
backdrop-filter: blur(0.2rem);
}
@@ -21,8 +21,8 @@
left: 50%;
transform: translate(-50%, -50%);
overflow-y: auto;
- background-color: var(--dark_875_color);
- width: 60%;
+ background-color: var(--dark_900_color);
+ width: 80%;
height: 96%;
padding: 2rem;
border-radius: 0.6rem;
diff --git a/src-ui/assets/triangle.svg b/src-ui/assets/triangle.svg
new file mode 100644
index 00000000..ff16b225
--- /dev/null
+++ b/src-ui/assets/triangle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src-ui/logics/configs/index.js b/src-ui/logics/configs/index.js
index aff6b450..646d24c1 100644
--- a/src-ui/logics/configs/index.js
+++ b/src-ui/logics/configs/index.js
@@ -49,6 +49,7 @@ export { useOverlaySmallLogSettings } from "./vr/useOverlaySmallLogSettings";
export { useIsEnabledOverlayLargeLog } from "./vr/useIsEnabledOverlayLargeLog";
export { useOverlayShowOnlyTranslatedMessages } from "./vr/useOverlayShowOnlyTranslatedMessages";
export { useOverlayLargeLogSettings } from "./vr/useOverlayLargeLogSettings";
+export { useSendTextToOverlay } from "./vr/useSendTextToOverlay";
export { useOscIpAddress } from "./advanced_settings/useOscIpAddress";
export { useOscPort } from "./advanced_settings/useOscPort";
diff --git a/src-ui/logics/configs/vr/useSendTextToOverlay.js b/src-ui/logics/configs/vr/useSendTextToOverlay.js
new file mode 100644
index 00000000..39561b64
--- /dev/null
+++ b/src-ui/logics/configs/vr/useSendTextToOverlay.js
@@ -0,0 +1,13 @@
+import { useStdoutToPython } from "@logics/useStdoutToPython";
+
+export const useSendTextToOverlay = () => {
+ const { asyncStdoutToPython } = useStdoutToPython();
+
+ const sendTextToOverlay = (text) => {
+ asyncStdoutToPython("/run/send_text_overlay_small_log", text);
+ };
+
+ return {
+ sendTextToOverlay,
+ };
+};
\ No newline at end of file
diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js
index a188dce2..cbe2e59f 100644
--- a/src-ui/logics/useReceiveRoutes.js
+++ b/src-ui/logics/useReceiveRoutes.js
@@ -427,6 +427,8 @@ export const useReceiveRoutes = () => {
"/set/enable/overlay_show_only_translated_messages": updateOverlayShowOnlyTranslatedMessages,
"/set/disable/overlay_show_only_translated_messages": updateOverlayShowOnlyTranslatedMessages,
+ "/run/send_text_overlay_small_log": () => {},
+
// Others Tab
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageInputBox,