From 6ad307738a55c9d8190f5d1cfdfb932b8199e3dc Mon Sep 17 00:00:00 2001 From: Andcool-Systems Date: Tue, 31 Dec 2024 00:05:28 +0300 Subject: [PATCH] changed showing animation for skin load modal some small changes in slider --- .../modules/components/MinecraftConnect.tsx | 2 +- src/app/modules/components/Slider.tsx | 8 +- src/app/styles/editor/page.module.css | 8 +- src/app/styles/slider.module.css | 9 +- src/app/workshop/[id]/client.tsx | 21 ++-- src/app/workshop/[id]/components/skinLoad.tsx | 101 +++++++++++------- 6 files changed, 88 insertions(+), 61 deletions(-) diff --git a/src/app/modules/components/MinecraftConnect.tsx b/src/app/modules/components/MinecraftConnect.tsx index 8e6dfda..1ed1b0f 100644 --- a/src/app/modules/components/MinecraftConnect.tsx +++ b/src/app/modules/components/MinecraftConnect.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { CSSTransition } from "react-transition-group" +import { CSSTransition } from "react-transition-group"; import style from '@/app/styles/minecraftConnect.module.css'; import { IconBrandMinecraft, IconCheck, IconX } from "@tabler/icons-react"; diff --git a/src/app/modules/components/Slider.tsx b/src/app/modules/components/Slider.tsx index d54ab19..7f513ce 100644 --- a/src/app/modules/components/Slider.tsx +++ b/src/app/modules/components/Slider.tsx @@ -50,7 +50,13 @@ const Slider = ({ initial, range, onChange }: { initial: number, range: number, <> {isDragging &&
- - { + { evt && client.current?.changeSkin(evt.data, evt.slim, evt.cape ? 'data:image/png;base64,' + evt.cape : ''); setLoadExpanded(false); - }} /> - + }} + expanded={loadExpanded} + />
{ +const SkinLoad = ({ expanded, onChange }: SkinLoadProps) => { const [data, setData] = useState<{ data: string; slim: boolean; cape?: string }>(null); const [loaded, setLoaded] = useState(false); @@ -131,43 +133,68 @@ const SkinLoad = ({ onChange }: SkinLoadProps) => { } return ( -
-
-
-

Загрузить скин

- onChange(null)} /> -
- - - - - - {data && -
- + <> + +
+ + + +
+
+
+

Загрузить скин

+ onChange(null)} /> +
+ + + + + {data && +
+ +
+ } + +
+ +
- } - -
-
-
-
+
+ ); }