From 7f8a32732989d8e140804d13aec15f4a7f8050ff Mon Sep 17 00:00:00 2001
From: itoshi
Date: Thu, 30 Apr 2026 22:57:14 +0300
Subject: [PATCH] feat: update right widget and add new 3d widget
---
.env | 14 +--
src/client/src/api/ApiStore/store.ts | 5 +
.../src/assets/icons/three-view-pan.svg | 3 +
.../src/assets/icons/three-view-rotate.svg | 3 +
.../src/assets/icons/three-view-zoom.svg | 3 +
.../components/ListOfSights/SightFrame.jsx | 92 ++++++++++++++++++-
.../src/components/SimulationSettings.tsx | 9 ++
src/client/src/components/map/WebGLMap.tsx | 28 ++++--
src/pages/City/CityCreatePage/index.tsx | 2 +-
src/pages/City/CityEditPage/index.tsx | 2 +-
.../SightTabs/CreateInformationTab/index.tsx | 2 +-
src/widgets/SightTabs/CreateLeftTab/index.tsx | 2 +-
.../SightTabs/CreateRightTab/index.tsx | 70 +++++++-------
.../SightTabs/InformationTab/index.tsx | 2 +-
src/widgets/SightTabs/LeftWidgetTab/index.tsx | 2 +-
.../RightWidgetTab/SightFramePreview.tsx | 2 +-
.../SightTabs/RightWidgetTab/index.tsx | 54 ++++++-----
tsconfig.tsbuildinfo | 2 +-
18 files changed, 217 insertions(+), 80 deletions(-)
create mode 100644 src/client/src/assets/icons/three-view-pan.svg
create mode 100644 src/client/src/assets/icons/three-view-rotate.svg
create mode 100644 src/client/src/assets/icons/three-view-zoom.svg
diff --git a/.env b/.env
index c8ded82..c554530 100644
--- a/.env
+++ b/.env
@@ -1,8 +1,8 @@
-# VITE_API_URL='https://wn.st.unprism.ru'
-# VITE_REACT_APP ='https://wn.st.unprism.ru/'
-# VITE_KRBL_MEDIA='https://wn.st.unprism.ru/media/'
-# VITE_NEED_AUTH='true'
-VITE_API_URL='https://wn.krbl.ru'
-VITE_REACT_APP ='https://wn.krbl.ru/'
-VITE_KRBL_MEDIA='https://wn.krbl.ru/media/'
+VITE_API_URL='https://wn.st.unprism.ru'
+VITE_REACT_APP ='https://wn.st.unprism.ru/'
+VITE_KRBL_MEDIA='https://wn.st.unprism.ru/media/'
VITE_NEED_AUTH='true'
+# VITE_API_URL='https://wn.krbl.ru'
+# VITE_REACT_APP ='https://wn.krbl.ru/'
+# VITE_KRBL_MEDIA='https://wn.krbl.ru/media/'
+# VITE_NEED_AUTH='true'
diff --git a/src/client/src/api/ApiStore/store.ts b/src/client/src/api/ApiStore/store.ts
index 0214f67..ea21f60 100644
--- a/src/client/src/api/ApiStore/store.ts
+++ b/src/client/src/api/ApiStore/store.ts
@@ -63,6 +63,7 @@ class ApiStore {
simulationDirection: 1 | -1 = 1;
simulationPaused = false;
simulationInstantMove = false;
+ showHitboxes = false;
constructor() {
makeAutoObservable(this);
@@ -191,6 +192,10 @@ class ApiStore {
this.simulationInstantMove = !this.simulationInstantMove;
};
+ toggleShowHitboxes = () => {
+ this.showHitboxes = !this.showHitboxes;
+ };
+
startPositionSimulation = () => {
if (this.positionInterval) return;
diff --git a/src/client/src/assets/icons/three-view-pan.svg b/src/client/src/assets/icons/three-view-pan.svg
new file mode 100644
index 0000000..d556958
--- /dev/null
+++ b/src/client/src/assets/icons/three-view-pan.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/client/src/assets/icons/three-view-rotate.svg b/src/client/src/assets/icons/three-view-rotate.svg
new file mode 100644
index 0000000..f802b0c
--- /dev/null
+++ b/src/client/src/assets/icons/three-view-rotate.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/client/src/assets/icons/three-view-zoom.svg b/src/client/src/assets/icons/three-view-zoom.svg
new file mode 100644
index 0000000..f6644d2
--- /dev/null
+++ b/src/client/src/assets/icons/three-view-zoom.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/client/src/components/ListOfSights/SightFrame.jsx b/src/client/src/components/ListOfSights/SightFrame.jsx
index 7a42aa2..2047163 100644
--- a/src/client/src/components/ListOfSights/SightFrame.jsx
+++ b/src/client/src/components/ListOfSights/SightFrame.jsx
@@ -16,6 +16,9 @@ import { ThreeViewErrorBoundary } from "../ThreeViewErrorBoundary";
import { apiStore } from "../../api/ApiStore/store";
import { ReactMarkdownComponent } from "../ReactMarkdown";
import { TouchableLayout } from "../TouchableLayout";
+import rotate3DIcon from "../../assets/icons/three-view-rotate.svg";
+import zoom3DIcon from "../../assets/icons/three-view-zoom.svg";
+import pan3DIcon from "../../assets/icons/three-view-pan.svg";
const Watermark = ({ path }) => {
if (!path) return null;
@@ -364,6 +367,87 @@ const SightFrame = observer(({ media, sight_id, sight_name }) => {
/>
+ {isFullscreen3D &&
+
+ {[
+ {
+ label: "Вращать",
+ icon:

,
+ },
+ {
+ label: "Приблизить / Отдалить",
+ icon:

,
+ },
+ {
+ label: "Переместить",
+ icon:

,
+ },
+ ].map((item, index, arr) => (
+
+
+ {item.icon}
+
+
+ {item.label}
+
+
+ ))}
+
+
}
);
default:
@@ -464,7 +548,7 @@ const SightFrame = observer(({ media, sight_id, sight_name }) => {
const titleLineHeight = useMemo(() => {
if (!sight_name) return "120%";
- const textLength = sight_name.length;
+ const textLength = sight_name.replace(/\n/g, "").length;
const calculatedLineHeight = Math.max(
100,
Math.min(120, 120 - (textLength / 10) * 1),
@@ -520,7 +604,7 @@ const SightFrame = observer(({ media, sight_id, sight_name }) => {
overflowWrap: "break-word",
}}
>
- {selectedSection === 0 ? processedSightName : sight_name}
+ {selectedSection === 0 ? processedSightName : (sightData?.short_name || sight_name)}
)}
@@ -552,7 +636,7 @@ const SightFrame = observer(({ media, sight_id, sight_name }) => {
paddingBottom: "4.5px",
cursor: "pointer",
}}
- onPointerUp={() => setSelectedSection(0)}
+ onPointerUp={() => { setSelectedSection(0); setIsFullscreen3D(false); }}
>