diff --git a/.env.development b/.env.development index 896e5ab..2542b99 100644 --- a/.env.development +++ b/.env.development @@ -4,5 +4,5 @@ VITE_COORD_URL=https://coord.graff.tech VITE_CRM_API_URL=https://crm.stream.graff.tech/api # VITE_API_URL=http://localhost:5002 VITE_API_URL=https://stream.graff.tech/api -VITE_SOCKET_URL=http://localhost:5003 -# VITE_SOCKET_URL=https://stream.graff.tech \ No newline at end of file +# VITE_SOCKET_URL=http://localhost:5003 +VITE_SOCKET_URL=https://stream.graff.tech \ No newline at end of file diff --git a/public/fonts/Gilroy/Gilroy-Bold.eot b/public/fonts/Gilroy/Gilroy-Bold.eot new file mode 100644 index 0000000..62604e3 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Bold.eot differ diff --git a/public/fonts/Gilroy/Gilroy-Bold.ttf b/public/fonts/Gilroy/Gilroy-Bold.ttf new file mode 100644 index 0000000..8acd47e Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Bold.ttf differ diff --git a/public/fonts/Gilroy/Gilroy-Bold.woff b/public/fonts/Gilroy/Gilroy-Bold.woff new file mode 100644 index 0000000..aca0a50 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Bold.woff differ diff --git a/public/fonts/Gilroy/Gilroy-Bold.woff2 b/public/fonts/Gilroy/Gilroy-Bold.woff2 new file mode 100644 index 0000000..302ed99 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Bold.woff2 differ diff --git a/public/fonts/Gilroy/Gilroy-Medium.eot b/public/fonts/Gilroy/Gilroy-Medium.eot new file mode 100644 index 0000000..a445090 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Medium.eot differ diff --git a/public/fonts/Gilroy/Gilroy-Medium.ttf b/public/fonts/Gilroy/Gilroy-Medium.ttf new file mode 100644 index 0000000..5ca5648 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Medium.ttf differ diff --git a/public/fonts/Gilroy/Gilroy-Medium.woff b/public/fonts/Gilroy/Gilroy-Medium.woff new file mode 100644 index 0000000..2f1d98f Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Medium.woff differ diff --git a/public/fonts/Gilroy/Gilroy-Medium.woff2 b/public/fonts/Gilroy/Gilroy-Medium.woff2 new file mode 100644 index 0000000..12ac871 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Medium.woff2 differ diff --git a/public/fonts/Gilroy/Gilroy-Regular.eot b/public/fonts/Gilroy/Gilroy-Regular.eot new file mode 100644 index 0000000..d696f61 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Regular.eot differ diff --git a/public/fonts/Gilroy/Gilroy-Regular.ttf b/public/fonts/Gilroy/Gilroy-Regular.ttf new file mode 100644 index 0000000..683478d Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Regular.ttf differ diff --git a/public/fonts/Gilroy/Gilroy-Regular.woff b/public/fonts/Gilroy/Gilroy-Regular.woff new file mode 100644 index 0000000..91f421a Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Regular.woff differ diff --git a/public/fonts/Gilroy/Gilroy-Regular.woff2 b/public/fonts/Gilroy/Gilroy-Regular.woff2 new file mode 100644 index 0000000..611283d Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-Regular.woff2 differ diff --git a/public/fonts/Gilroy/Gilroy-SemiBold.eot b/public/fonts/Gilroy/Gilroy-SemiBold.eot new file mode 100644 index 0000000..0fc41e0 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-SemiBold.eot differ diff --git a/public/fonts/Gilroy/Gilroy-SemiBold.ttf b/public/fonts/Gilroy/Gilroy-SemiBold.ttf new file mode 100644 index 0000000..e4d09e2 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-SemiBold.ttf differ diff --git a/public/fonts/Gilroy/Gilroy-SemiBold.woff b/public/fonts/Gilroy/Gilroy-SemiBold.woff new file mode 100644 index 0000000..f1f140f Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-SemiBold.woff differ diff --git a/public/fonts/Gilroy/Gilroy-SemiBold.woff2 b/public/fonts/Gilroy/Gilroy-SemiBold.woff2 new file mode 100644 index 0000000..05275e6 Binary files /dev/null and b/public/fonts/Gilroy/Gilroy-SemiBold.woff2 differ diff --git a/public/fonts/Gilroy/demo.html b/public/fonts/Gilroy/demo.html new file mode 100644 index 0000000..620f62e --- /dev/null +++ b/public/fonts/Gilroy/demo.html @@ -0,0 +1,279 @@ + + + + + + + + + Transfonter demo + + + + +
+
+

Gilroy-SemiBold

+
.your-style {
+    font-family: 'Gilroy';
+    font-weight: 600;
+    font-style: normal;
+}
+
+<link rel="preload" href="Gilroy-SemiBold.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Gilroy-Bold

+
.your-style {
+    font-family: 'Gilroy';
+    font-weight: bold;
+    font-style: normal;
+}
+
+<link rel="preload" href="Gilroy-Bold.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Gilroy-Regular

+
.your-style {
+    font-family: 'Gilroy';
+    font-weight: normal;
+    font-style: normal;
+}
+
+<link rel="preload" href="Gilroy-Regular.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Gilroy-Medium

+
.your-style {
+    font-family: 'Gilroy';
+    font-weight: 500;
+    font-style: normal;
+}
+
+<link rel="preload" href="Gilroy-Medium.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+ + diff --git a/public/fonts/Gilroy/stylesheet.css b/public/fonts/Gilroy/stylesheet.css new file mode 100644 index 0000000..551bf23 --- /dev/null +++ b/public/fonts/Gilroy/stylesheet.css @@ -0,0 +1,48 @@ +@font-face { + font-family: 'Gilroy'; + src: url('Gilroy-SemiBold.eot'); + src: url('Gilroy-SemiBold.eot?#iefix') format('embedded-opentype'), + url('Gilroy-SemiBold.woff2') format('woff2'), + url('Gilroy-SemiBold.woff') format('woff'), + url('Gilroy-SemiBold.ttf') format('truetype'); + font-weight: 600; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Gilroy'; + src: url('Gilroy-Bold.eot'); + src: url('Gilroy-Bold.eot?#iefix') format('embedded-opentype'), + url('Gilroy-Bold.woff2') format('woff2'), + url('Gilroy-Bold.woff') format('woff'), + url('Gilroy-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Gilroy'; + src: url('Gilroy-Regular.eot'); + src: url('Gilroy-Regular.eot?#iefix') format('embedded-opentype'), + url('Gilroy-Regular.woff2') format('woff2'), + url('Gilroy-Regular.woff') format('woff'), + url('Gilroy-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Gilroy'; + src: url('Gilroy-Medium.eot'); + src: url('Gilroy-Medium.eot?#iefix') format('embedded-opentype'), + url('Gilroy-Medium.woff2') format('woff2'), + url('Gilroy-Medium.woff') format('woff'), + url('Gilroy-Medium.ttf') format('truetype'); + font-weight: 500; + font-style: normal; + font-display: swap; +} + diff --git a/public/fonts/Inter/Inter-Bold.eot b/public/fonts/Inter/Inter-Bold.eot new file mode 100644 index 0000000..0e09050 Binary files /dev/null and b/public/fonts/Inter/Inter-Bold.eot differ diff --git a/public/fonts/Inter/Inter-Bold.ttf b/public/fonts/Inter/Inter-Bold.ttf new file mode 100644 index 0000000..b1d4c15 Binary files /dev/null and b/public/fonts/Inter/Inter-Bold.ttf differ diff --git a/public/fonts/Inter/Inter-Bold.woff b/public/fonts/Inter/Inter-Bold.woff new file mode 100644 index 0000000..2eae599 Binary files /dev/null and b/public/fonts/Inter/Inter-Bold.woff differ diff --git a/public/fonts/Inter/Inter-Bold.woff2 b/public/fonts/Inter/Inter-Bold.woff2 new file mode 100644 index 0000000..258bbdb Binary files /dev/null and b/public/fonts/Inter/Inter-Bold.woff2 differ diff --git a/public/fonts/Inter/Inter-Medium.eot b/public/fonts/Inter/Inter-Medium.eot new file mode 100644 index 0000000..aa6a6c9 Binary files /dev/null and b/public/fonts/Inter/Inter-Medium.eot differ diff --git a/public/fonts/Inter/Inter-Medium.ttf b/public/fonts/Inter/Inter-Medium.ttf new file mode 100644 index 0000000..fee66a7 Binary files /dev/null and b/public/fonts/Inter/Inter-Medium.ttf differ diff --git a/public/fonts/Inter/Inter-Medium.woff b/public/fonts/Inter/Inter-Medium.woff new file mode 100644 index 0000000..5937e34 Binary files /dev/null and b/public/fonts/Inter/Inter-Medium.woff differ diff --git a/public/fonts/Inter/Inter-Medium.woff2 b/public/fonts/Inter/Inter-Medium.woff2 new file mode 100644 index 0000000..ca02d39 Binary files /dev/null and b/public/fonts/Inter/Inter-Medium.woff2 differ diff --git a/public/fonts/Inter/Inter-Regular.eot b/public/fonts/Inter/Inter-Regular.eot new file mode 100644 index 0000000..5e6db81 Binary files /dev/null and b/public/fonts/Inter/Inter-Regular.eot differ diff --git a/public/fonts/Inter/Inter-Regular.ttf b/public/fonts/Inter/Inter-Regular.ttf new file mode 100644 index 0000000..093e8ae Binary files /dev/null and b/public/fonts/Inter/Inter-Regular.ttf differ diff --git a/public/fonts/Inter/Inter-Regular.woff b/public/fonts/Inter/Inter-Regular.woff new file mode 100644 index 0000000..f7098bd Binary files /dev/null and b/public/fonts/Inter/Inter-Regular.woff differ diff --git a/public/fonts/Inter/Inter-Regular.woff2 b/public/fonts/Inter/Inter-Regular.woff2 new file mode 100644 index 0000000..b038e8d Binary files /dev/null and b/public/fonts/Inter/Inter-Regular.woff2 differ diff --git a/public/fonts/Inter/Inter-SemiBold.eot b/public/fonts/Inter/Inter-SemiBold.eot new file mode 100644 index 0000000..f75fdce Binary files /dev/null and b/public/fonts/Inter/Inter-SemiBold.eot differ diff --git a/public/fonts/Inter/Inter-SemiBold.ttf b/public/fonts/Inter/Inter-SemiBold.ttf new file mode 100644 index 0000000..10fc1c6 Binary files /dev/null and b/public/fonts/Inter/Inter-SemiBold.ttf differ diff --git a/public/fonts/Inter/Inter-SemiBold.woff b/public/fonts/Inter/Inter-SemiBold.woff new file mode 100644 index 0000000..afa916f Binary files /dev/null and b/public/fonts/Inter/Inter-SemiBold.woff differ diff --git a/public/fonts/Inter/Inter-SemiBold.woff2 b/public/fonts/Inter/Inter-SemiBold.woff2 new file mode 100644 index 0000000..8e907d0 Binary files /dev/null and b/public/fonts/Inter/Inter-SemiBold.woff2 differ diff --git a/public/fonts/Inter/demo.html b/public/fonts/Inter/demo.html new file mode 100644 index 0000000..cdd720c --- /dev/null +++ b/public/fonts/Inter/demo.html @@ -0,0 +1,279 @@ + + + + + + + + + Transfonter demo + + + + +
+
+

Inter Semi Bold

+
.your-style {
+    font-family: 'Inter';
+    font-weight: 600;
+    font-style: normal;
+}
+
+<link rel="preload" href="Inter-SemiBold.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Inter Regular

+
.your-style {
+    font-family: 'Inter';
+    font-weight: normal;
+    font-style: normal;
+}
+
+<link rel="preload" href="Inter-Regular.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Inter Medium

+
.your-style {
+    font-family: 'Inter';
+    font-weight: 500;
+    font-style: normal;
+}
+
+<link rel="preload" href="Inter-Medium.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+

Inter Bold

+
.your-style {
+    font-family: 'Inter';
+    font-weight: bold;
+    font-style: normal;
+}
+
+<link rel="preload" href="Inter-Bold.woff2" as="font" type="font/woff2" crossorigin>
+
+

+ abcdefghijklmnopqrstuvwxyz
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ 0123456789.:,;()*!?'@#<>$%&^+-=~ +

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+

The quick brown fox jumps over the lazy dog.

+
+
+ +
+ + diff --git a/public/fonts/Inter/stylesheet.css b/public/fonts/Inter/stylesheet.css new file mode 100644 index 0000000..6e643e0 --- /dev/null +++ b/public/fonts/Inter/stylesheet.css @@ -0,0 +1,48 @@ +@font-face { + font-family: 'Inter'; + src: url('Inter-SemiBold.eot'); + src: url('Inter-SemiBold.eot?#iefix') format('embedded-opentype'), + url('Inter-SemiBold.woff2') format('woff2'), + url('Inter-SemiBold.woff') format('woff'), + url('Inter-SemiBold.ttf') format('truetype'); + font-weight: 600; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Inter'; + src: url('Inter-Regular.eot'); + src: url('Inter-Regular.eot?#iefix') format('embedded-opentype'), + url('Inter-Regular.woff2') format('woff2'), + url('Inter-Regular.woff') format('woff'), + url('Inter-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Inter'; + src: url('Inter-Medium.eot'); + src: url('Inter-Medium.eot?#iefix') format('embedded-opentype'), + url('Inter-Medium.woff2') format('woff2'), + url('Inter-Medium.woff') format('woff'), + url('Inter-Medium.ttf') format('truetype'); + font-weight: 500; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: 'Inter'; + src: url('Inter-Bold.eot'); + src: url('Inter-Bold.eot?#iefix') format('embedded-opentype'), + url('Inter-Bold.woff2') format('woff2'), + url('Inter-Bold.woff') format('woff'), + url('Inter-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; + font-display: swap; +} + diff --git a/src/App.tsx b/src/App.tsx index 2b37b70..d0c9f6e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -30,8 +30,8 @@ function App() { state.isOpen, state.setIsOpen, ]); - const [loading, setLoading] = useState(false); - const [countdownTimer, setCountdownTimer] = useState(15); + // const [loading, setLoading] = useState(false); + // const [countdownTimer, setCountdownTimer] = useState(15); const { t, i18n } = useTranslation(); const build = searchParams.get("build") || null; const type = searchParams.get("type") || "demo"; @@ -86,7 +86,7 @@ function App() { console.log("location", location); - setLoading(true); + // setLoading(true); try { const response: any = await ky @@ -100,29 +100,34 @@ function App() { if (response.stream) { setStreamUrl(`/stream/${response.stream}`); - setInterval(() => { - setCountdownTimer((prev) => prev - 1); - }, 1000); + // setInterval(() => { + // setCountdownTimer((prev) => prev - 1); + // }, 1000); } else if (response.error) { toastError(response.error); - setLoading(false); + // setLoading(false); } else { toastError("Неизвестная ошибка"); - setLoading(false); + // setLoading(false); } } catch (error) { if (error instanceof Error) { toastError(`Неизвестная ошибка 2: ${error.message}`); } - setLoading(false); + // setLoading(false); } } - useEffect(() => { - if (countdownTimer > 0 || !streamUrl) return; + // useEffect(() => { + // if (countdownTimer > 0 || !streamUrl) return; + // navigate(streamUrl); + // }, [countdownTimer]); + + useEffect(() => { + if (!streamUrl) return; navigate(streamUrl); - }, [countdownTimer]); + }, [streamUrl]); useEffect(() => { getLang(); @@ -138,62 +143,199 @@ function App() { return ( <> - {!loading ? ( - <> -
-
-
void i18n.changeLanguage(lang)} - /> +
+
+
void i18n.changeLanguage(lang)} + /> -
-
- +
+
+ +
+ +
+

+ + Доступные +
+ демонстрации +
+

+

+ + Клиент из любой точки мира может посмотреть жилой комплекс, + даже на нулевом этапе строительства. Он выберет лучшую + планировку и оценит вид из окон своей будущей квартиры. + +

+
+ +
+ {/*
+
+ +
+
+

+ + ЖК «Upside Towers» + +

+

+ + Россия, Москва + +

+
+ +
+
*/} -
-

- - Доступные -
- демонстрации -
-

-

- - Клиент из любой точки мира может посмотреть жилой - комплекс, даже на нулевом этапе строительства. Он выберет - лучшую планировку и оценит вид из окон своей будущей - квартиры. - -

-
+
+ {i18n.language === "ru" ? ( + <> +
+
-
- {/*
+
+

+ + МФК «Revolution towers» + +

+

+ + Россия, Екатеринбург + +

+
+ + +
+
+ +
+
+ +
+
+

+ + ЖК «Life Резиденция» + +

+

+ + Россия, Тюмень + +

+
+ + +
+
+ + {/*
+
+ +
+
+

+ + ЖК «Айвазовский City» + +

+

+ + Россия, Тюмень + +

+
+ + +
+
*/} + + ) : ( +
-
+

- - ЖК «Upside Towers» - -

-

- - Россия, Москва - + IMI Saudi Shipyard

+

Saudi Arabia

-
*/} - -
- {i18n.language === "ru" ? ( - <> -
-
- -
-
-

- - МФК «Revolution towers» - -

-

- - Россия, Екатеринбург - -

-
- - -
-
- -
-
- -
-
-

- - ЖК «Life Резиденция» - -

-

- - Россия, Тюмень - -

-
- - -
-
- - {/*
-
- -
-
-

- - ЖК «Айвазовский City» - -

-

- - Россия, Тюмень - -

-
- - -
-
*/} - - ) : ( -
-
- -
-
-

- IMI Saudi Shipyard -

-

Saudi Arabia

-
- - -
-
- )}
-
-
- -
-
-
-
-

- - Запись на -
- удаленную -
- демонстрацию -
-

-

- - Запись на демонстрацию может быть -
- оформлена в виде блока на сайте -
- застройщика или жилого комплекса. -
-

- -
-

- - Запись доступна в демонстрационном режиме. -
- Указанные при записи данные не будут сохранены. -
-

-
- -
- -
-
-
- -
-
-
-
-

- - Свяжитесь -
с нами -
-

-

- - Хотите увеличить конверсию? -
- Давайте обсудим детали! -
-

-
-
- -
- -
-
-
- -
-
- -
- -
-
-

- Горячая линия -

-
-
- - - -
-
-

- - Социальные -
- сети -
-

- -
-
-
+ )}
+
-
-
-
-
-
- -
-
-

- - - Политика конфиденциальности - - - - graff.estate - -

-

- © 2023 GRAFF interactive.{" "} - - Все права защищены. - -

-
-
+
+
+
+
+

+ + Запись на +
+ удаленную +
+ демонстрацию +
+

+

+ + Запись на демонстрацию может быть +
+ оформлена в виде блока на сайте +
+ застройщика или жилого комплекса. +
+

+ +
+

+ + Запись доступна в демонстрационном режиме. +
+ Указанные при записи данные не будут сохранены. +
+

+
-
-
- -
- RU -
-
-
+
+ +
+
+
-
-
- -
- UAE -
-
+
+
+
+
+

+ + Свяжитесь +
с нами +
+

+

+ + Хотите увеличить конверсию? +
+ Давайте обсудим детали! +
+

+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+

+ Горячая линия +

+
+
+ + + +
+
+

+ + Социальные +
+ сети +
+

+
- - - {(state) => } - - - - - ) : ( -
-

- - - Загрузка - ... {countdownTimer} сек - -

- )} + +
+
+
+
+
+ +
+
+

+ + + Политика конфиденциальности + + + + graff.estate + +

+

+ © 2023 GRAFF interactive.{" "} + Все права защищены. +

+
+
+ +
+
+ +
+ RU +
+
+
+ +
+
+ +
+ UAE +
+
+
+
+
+
+
+ + + {(state) => } + + + ); } diff --git a/src/components/ModalContainer2.tsx b/src/components/ModalContainer2.tsx index d0d7c0c..4305901 100644 --- a/src/components/ModalContainer2.tsx +++ b/src/components/ModalContainer2.tsx @@ -5,7 +5,7 @@ function ModalContainer2() { return (
diff --git a/src/components/User.tsx b/src/components/User.tsx index 36257e8..82b32d9 100644 --- a/src/components/User.tsx +++ b/src/components/User.tsx @@ -10,6 +10,9 @@ import CloseIcon from "./icons/CloseIcon"; import { useState } from "react"; import { useClickAway } from "@uidotdev/usehooks"; import SpinnerIcon from "./icons/SpinnerIcon"; +import InternetSpeedHighIcon from "./icons/InternetSpeedHighIcon"; +import InternetSpeedMediumIcon from "./icons/InternetSpeedMediumIcon"; +import InternetSpeedLowIcon from "./icons/InternetSpeedLowIcon"; interface Props { me: IUser; @@ -28,21 +31,30 @@ function User({ me, user, handleTransferControl, handleKick }: Props) { return (
-
-

{user.name[0]?.toUpperCase()}

- {user?.isControlAllowed && ( -
- )} -
+ {!user.isVideoInitialized ? ( +
+ +
+ ) : ( +
+ {(user.downloadSpeed < 10 && ) || + (user.downloadSpeed < 20 && ) || + (user.downloadSpeed >= 20 && )} +
+ )} +

{user.name}

{isMobile ? : }
- {!user.isVideoInitialized && } + + {user?.isControlAllowed && ( + + )}
{me.isAdmin && ( diff --git a/src/components/icons/InternetSpeedHighIcon.tsx b/src/components/icons/InternetSpeedHighIcon.tsx new file mode 100644 index 0000000..21f194b --- /dev/null +++ b/src/components/icons/InternetSpeedHighIcon.tsx @@ -0,0 +1,20 @@ +function InternetSpeedHighIcon() { + return ( + + + + ); +} + +export default InternetSpeedHighIcon; diff --git a/src/components/icons/InternetSpeedLowIcon.tsx b/src/components/icons/InternetSpeedLowIcon.tsx new file mode 100644 index 0000000..0adcf3d --- /dev/null +++ b/src/components/icons/InternetSpeedLowIcon.tsx @@ -0,0 +1,28 @@ +function InternetSpeedLowIcon() { + return ( + + + + + + ); +} + +export default InternetSpeedLowIcon; diff --git a/src/components/icons/InternetSpeedMediumIcon.tsx b/src/components/icons/InternetSpeedMediumIcon.tsx new file mode 100644 index 0000000..4aeceaa --- /dev/null +++ b/src/components/icons/InternetSpeedMediumIcon.tsx @@ -0,0 +1,24 @@ +function InternetSpeedMediumIcon() { + return ( + + + + + ); +} + +export default InternetSpeedMediumIcon; diff --git a/src/components/icons/SpinnerIcon.tsx b/src/components/icons/SpinnerIcon.tsx index 1eda108..71313f7 100644 --- a/src/components/icons/SpinnerIcon.tsx +++ b/src/components/icons/SpinnerIcon.tsx @@ -1,63 +1,19 @@ function SpinnerIcon() { return ( - - - - - - - - - + + + ); diff --git a/src/components/modals/stream/SpeedtestModal.tsx b/src/components/modals/stream/SpeedtestModal.tsx new file mode 100644 index 0000000..8d2b09c --- /dev/null +++ b/src/components/modals/stream/SpeedtestModal.tsx @@ -0,0 +1,58 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable react-hooks/exhaustive-deps */ + +import { useEffect, useRef } from "react"; +import { useSpeedtest } from "../../../hooks/useSpeedtest"; +import { useCountdown } from "usehooks-ts"; + +interface Props { + onSuccess: (downloadSpeed: number) => void; +} + +function SpeedtestModal({ onSuccess }: Props) { + const [downloadSpeed] = useSpeedtest(); + const downloadSpeedRef = useRef(); + downloadSpeedRef.current = downloadSpeed; + const [counter, { startCountdown }] = useCountdown({ countStart: 15 }); + + useEffect(() => { + console.log("SpeedtestModal - downloadSpeed", downloadSpeed); + }, [downloadSpeed]); + + useEffect(() => { + startCountdown(); + setTimeout(() => { + onSuccess(downloadSpeedRef.current!); + }, 15000); + }, []); + + return ( +
+
+

+ Пожалуйста, подождите +

+

+ Проверяем качество вашего +
+ интернет-соединения +

+
+
+
+

Проверка

+

Осталось {counter} секунд

+
+
+
+
+ {/*
+

{downloadSpeed.toFixed(1)}

+

MBit/s

+
*/} +
+
+ ); +} + +export default SpeedtestModal; diff --git a/src/hooks/useSpeedtest.ts b/src/hooks/useSpeedtest.ts new file mode 100644 index 0000000..ff9e47d --- /dev/null +++ b/src/hooks/useSpeedtest.ts @@ -0,0 +1,32 @@ +import { useEffect, useState } from "react"; +import { v4 as uuidv4 } from "uuid"; + +export function useSpeedtest() { + const [downloadSpeed, setDownloadSpeed] = useState(0); + const [loadedEnd, setLoadedEnd] = useState(false); + + function speedtest() { + const startTime = performance.now(); + const xhr = new XMLHttpRequest(); + + let elapsedTime = 0; // seconds + let loaded = 0; // seconds + + xhr.open("get", `https://files.graff.tech/static/download?uuid=${uuidv4()}`); + xhr.timeout = 15000; + xhr.onprogress = (e) => { + loaded = e.loaded / 1024000; + elapsedTime = (performance.now() - startTime) / 1000; + + setDownloadSpeed((loaded / elapsedTime) * 8); + }; + xhr.onloadend = () => setLoadedEnd(true); + xhr.send(); + } + + useEffect(() => { + speedtest(); + }, []); + + return [downloadSpeed, loadedEnd] as const; +} diff --git a/src/index.css b/src/index.css index 1774c58..b5552e3 100644 --- a/src/index.css +++ b/src/index.css @@ -1,5 +1,5 @@ -@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"); -@import url("https://gistcdn.githack.com/mfd/09b70eb47474836f25a21660282ce0fd/raw/e06a670afcb2b861ed2ac4a1ef752d062ef6b46b/Gilroy.css"); +@import url("/fonts/Inter/stylesheet.css"); +@import url("/fonts/Gilroy/stylesheet.css"); @tailwind base; @tailwind components; @@ -63,3 +63,18 @@ input { *::-webkit-scrollbar-thumb:hover { border-width: 2px; } + +/* Animation */ + +.animate-progress { + animation: progress 15s ease-in-out; +} + +@keyframes progress { + from { + width: 0; + } + to { + width: 100%; + } +} diff --git a/src/pages/StreamPage.tsx b/src/pages/StreamPage.tsx index 105af6c..67b402f 100644 --- a/src/pages/StreamPage.tsx +++ b/src/pages/StreamPage.tsx @@ -45,6 +45,10 @@ import ChatIcon from "../components/icons/ChatIcon"; import useChatStore from "../stores/useChatStore"; import UsersIcon from "../components/icons/UsersIcon"; import Users from "../components/Users"; +import SpeedtestModal from "../components/modals/stream/SpeedtestModal"; +import InternetSpeedHighIcon from "../components/icons/InternetSpeedHighIcon"; +import InternetSpeedLowIcon from "../components/icons/InternetSpeedLowIcon"; +import InternetSpeedMediumIcon from "../components/icons/InternetSpeedMediumIcon"; // import ChatIcon from "../components/icons/ChatIcon"; // import MoreIcon from "../components/icons/MoreIcon"; @@ -87,6 +91,9 @@ function StreamPage() { const [isShowUsers, setIsShowUsers] = useState(false); const { isPortrait } = useMobileOrientation(); const { setMessages } = useChatStore(); + const [activeSession, setActiveSession, activeSessionRef] = + useStateRef(); + const [downloadSpeed, setDownloadSpeed] = useState(0); async function startCall(remotePeerId: string) { if (!peerInstance) return; @@ -138,12 +145,14 @@ function StreamPage() { } function initPeer() { + console.log("initPeer"); + const peer = new Peer({ host: "stream.graff.tech", config: { iceServers: [ { - urls: "turn:194.26.138.94:3478", // Replace with your TURN server URL + urls: "turn:185.173.176.83:3478", // Replace with your TURN server URL username: "username1", // Replace with your TURN username credential: "password1", // Replace with your TURN credential }, @@ -187,6 +196,7 @@ function StreamPage() { peerId, superAdmin, isVideoInitialized, + downloadSpeed, }, }, }); @@ -284,16 +294,10 @@ function StreamPage() { } async function getWSUrl() { - const activeSession = await getActiveSession(); + console.log("activeSession", activeSession); - if (!activeSession || activeSession.status === "error") { - setIsEnded(true); - return; - } - - setIsEnded(false); setWSUrl( - `wss://${activeSession.location}.sess.stream.graff.tech/server/${activeSession.localIP}:${activeSession.cirrusPort}` + `wss://${activeSessionRef.current.location}.sess.stream.graff.tech/server/${activeSessionRef.current.localIP}:${activeSessionRef.current.cirrusPort}` ); setModal(); @@ -341,12 +345,38 @@ function StreamPage() { }, 1000); } + async function init() { + const activeSession = await getActiveSession(); + + console.log("activeSession init", activeSession); + + if (!activeSession || activeSession.status === "error") { + setIsEnded(true); + return; + } + + setActiveSession(activeSession); + setIsEnded(false); + + setModal( + { + setDownloadSpeed(Math.round(downloadSpeed)); + getWSUrl(); + }} + /> + ); + } + useEffect(() => { - getWSUrl(); + init(); + // getWSUrl(); // initSocket(); }, []); useEffect(() => { + console.log("permission", permission); + if (permission === undefined) return; initPeer(); @@ -410,14 +440,23 @@ function StreamPage() {
-
+ {/*

{name[0]?.toUpperCase()}

{me?.isControlAllowed && (
)} -
+
*/} + {me && ( +
+ {(me.downloadSpeed < 10 && ) || + (me.downloadSpeed < 20 && ( + + )) || + (me.downloadSpeed >= 20 && )} +
+ )}

{name}

{isMobile ? : } @@ -506,7 +545,7 @@ function StreamPage() { /> )} - + )} diff --git a/src/types/IUser.ts b/src/types/IUser.ts index 3ae45f9..e32fae0 100644 --- a/src/types/IUser.ts +++ b/src/types/IUser.ts @@ -8,6 +8,7 @@ interface IUser { peerId: string; micEnabled: boolean; isVideoInitialized: boolean; + downloadSpeed: number; } export default IUser; diff --git a/src/utils/speedtest.ts b/src/utils/speedtest.ts new file mode 100644 index 0000000..cd2cd37 --- /dev/null +++ b/src/utils/speedtest.ts @@ -0,0 +1,25 @@ +import { v4 as uuidv4 } from "uuid"; + +export function speedtest() { + return new Promise((resolve) => { + const startTime = performance.now(); + const xhr = new XMLHttpRequest(); + + let elapsedTime = 0; // seconds + let loaded = 0; // seconds + + xhr.open("get", `https://files.graff.tech/static/download?uuid=${uuidv4()}`); + xhr.timeout = 15000; + xhr.onprogress = (e) => { + loaded = e.loaded / 1024000; + elapsedTime = (performance.now() - startTime) / 1000; + }; + xhr.onloadend = loadedend; + xhr.send(); + + function loadedend() { + const result = Math.round((loaded / elapsedTime) * 8); + resolve(result); + } + }); +}