From d7dcb4554ec36dab9c6ab434caf82a45f67cc85e Mon Sep 17 00:00:00 2001
From: al
Date: Fri, 16 Aug 2024 13:29:14 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=98=E5=9C=A8=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/profile/[mid]/page.js | 260 +++++++++++-------
.../person_space_introduce/[mid]/page.js | 150 +++++-----
components/ImagesMask/index.jsx | 253 +++++++++++++----
components/PostItem/index.js | 34 ++-
4 files changed, 464 insertions(+), 233 deletions(-)
diff --git a/app/profile/[mid]/page.js b/app/profile/[mid]/page.js
index da7ed4d..3ded087 100644
--- a/app/profile/[mid]/page.js
+++ b/app/profile/[mid]/page.js
@@ -26,6 +26,7 @@ import { getStreamerDetailInfo } from "@/api/space";
import { get } from "@/utils/storeInfo";
import { handleShowVideo } from "@/utils/tools/handleFuns";
import clipboard from "copy-to-clipboard";
+import ImagesMask from "@/components/ImagesMask";
// import * as Clipboard from "expo-clipboard";
export default function PersonSpace() {
const { mid } = useParams();
@@ -37,6 +38,7 @@ export default function PersonSpace() {
const [isFollow, setIsFollow] = useState(false);
const [topPhotos, setTopPhotos] = useState([]);
const currentIndex = useRef();
+ const imagesMaskRef = useRef(null);
// 获取屏幕高度
// const scrollHeight = 600;
useEffect(() => {
@@ -46,20 +48,20 @@ export default function PersonSpace() {
}, []);
const showPhotos = (photos, index) => {
currentIndex.current = index;
- const interval = setInterval(() => {
- console.log("bbbbbb")
- const bodyBox = document.getElementsByClassName("photos-bodyBox")[0];
- if (bodyBox) {
- bodyBox.firstChild.lastChild.style.transform = `translateX(-${
- currentIndex.current * (window.innerWidth + 16)
- }px)`;
- // console.log(bodyBox.firstChild.lastChild.style.transform);
- }
- }, 400);
-
-
- handleShowImages(index, photos, interval);
+ // const interval = setInterval(() => {
+ // console.log("bbbbbb")
+ // const bodyBox = document.getElementsByClassName("photos-bodyBox")[0];
+ // if (bodyBox) {
+ // bodyBox.firstChild.lastChild.style.transform = `translateX(-${
+ // currentIndex.current * (window.innerWidth + 16)
+ // }px)`;
+ // // console.log(bodyBox.firstChild.lastChild.style.transform);
+ // }
+ // }, 400);
+ // handleShowImages(index, photos, interval);
+ // console.log(imagesMaskRef.current, photos);
+ imagesMaskRef.current.show(photos, index, streamerInfo);
// setVisible(true)
// console.log(imagesMaskRef.current);
// imagesMaskRef.current.show(
@@ -67,49 +69,49 @@ export default function PersonSpace() {
// index
// );
};
- const handleShowImages = (index, photos, interval) => {
- const mediaDom = document.createElement("div");
- mediaDom.style.width = "100vw";
- document.body.appendChild(mediaDom);
- mediaDom.className = `${
- photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
- }`;
- ImageViewer.clear();
- ImageViewer.Multi.show({
- images: photos.map((item) => item.url),
- defaultIndex: index,
- // renderFooter: (image, index) => {
- // return renderFooter(photos[index]?.type == "hid", mediaDom);
- // },
+ // const handleShowImages = (index, photos, interval) => {
+ // const mediaDom = document.createElement("div");
+ // mediaDom.style.width = "100vw";
+ // document.body.appendChild(mediaDom);
+ // mediaDom.className = `${
+ // photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
+ // }`;
+ // ImageViewer.clear();
+ // ImageViewer.Multi.show({
+ // images: photos.map((item) => item.url),
+ // defaultIndex: index,
+ // // renderFooter: (image, index) => {
+ // // return renderFooter(photos[index]?.type == "hid", mediaDom);
+ // // },
- getContainer: mediaDom,
- onIndexChange: (index) => {
- currentIndex.current = index;
- mediaDom.className = `${
- photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
- }`;
- const leftBtn = document.getElementsByClassName("imagesBtnsControllerLeft")[0]
- const rightBtn = document.getElementsByClassName("imagesBtnsControllerRight")[0]
- if(leftBtn && rightBtn){
- if(!index){
- leftBtn.style.opacity=0.5
- rightBtn.style.opacity=1
- }else if(index==photos.length-1){
- leftBtn.style.opacity=1
- rightBtn.style.opacity=0.5
- }else{
- leftBtn.style.opacity=1
- rightBtn.style.opacity=1
- }
- }
- },
- afterClose: () => {
- mediaDom.remove();
- clearInterval(interval);
- },
- classNames: { body: "photos-bodyBox" },
- });
- };
+ // getContainer: mediaDom,
+ // onIndexChange: (index) => {
+ // currentIndex.current = index;
+ // mediaDom.className = `${
+ // photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
+ // }`;
+ // const leftBtn = document.getElementsByClassName("imagesBtnsControllerLeft")[0]
+ // const rightBtn = document.getElementsByClassName("imagesBtnsControllerRight")[0]
+ // if(leftBtn && rightBtn){
+ // if(!index){
+ // leftBtn.style.opacity=0.5
+ // rightBtn.style.opacity=1
+ // }else if(index==photos.length-1){
+ // leftBtn.style.opacity=1
+ // rightBtn.style.opacity=0.5
+ // }else{
+ // leftBtn.style.opacity=1
+ // rightBtn.style.opacity=1
+ // }
+ // }
+ // },
+ // afterClose: () => {
+ // mediaDom.remove();
+ // clearInterval(interval);
+ // },
+ // classNames: { body: "photos-bodyBox" },
+ // });
+ // };
const handleGetStreamerInfo = async () => {
try {
setLoading(true);
@@ -244,7 +246,9 @@ export default function PersonSpace() {
} else {
showPhotos(
topPhotos.filter((it) => it.type == "img"),
- topPhotos.filter((it) => it.type == "img").indexOf(photo)
+ topPhotos
+ .filter((it) => it.type == "img")
+ .indexOf(photo)
);
}
}}
@@ -264,7 +268,10 @@ export default function PersonSpace() {
className=""
width={98}
height={98}
- src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/play.png"}
+ src={
+ process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
+ "/icons/play.png"
+ }
/>
)}
@@ -282,7 +289,12 @@ export default function PersonSpace() {
{streamerInfo?.streamer_ext?.name}
-
+
@@ -300,7 +312,10 @@ export default function PersonSpace() {
-
-
{streamerInfo?.streamer_ext?.gender === 1 ? (
) : (
@@ -358,7 +385,10 @@ export default function PersonSpace() {
@@ -371,7 +401,10 @@ export default function PersonSpace() {
@@ -384,7 +417,10 @@ export default function PersonSpace() {
@@ -394,11 +430,17 @@ export default function PersonSpace() {
)}
{streamerInfo?.streamer_ext?.bio && (
- 个性签名|{streamerInfo?.streamer_ext?.bio}
+
+ 个性签名|
+ {streamerInfo?.streamer_ext?.bio}
+
)}
- {spaceData&&!!spaceData?.previews?.images?.length&&
+ {spaceData && !!spaceData?.previews?.images?.length && (
<>
@@ -428,27 +470,29 @@ export default function PersonSpace() {
- {spaceData?.previews?.images?.slice(0,4).map((item, index) => (
-
-
-
- ))}
+ {spaceData?.previews?.images
+ ?.slice(0, 4)
+ .map((item, index) => (
+
+
+
+ ))}
>
- }
+ )}
<>
@@ -462,7 +506,10 @@ export default function PersonSpace() {
height={32}
width={32}
className="mr-2"
- src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/images/platform_wechat.png"}
+ src={
+ process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
+ "/images/platform_wechat.png"
+ }
/>
微信:
@@ -479,7 +526,7 @@ export default function PersonSpace() {
-
- {item?.link_name}:{item?.nickname}
+ {item?.link_name}:{item?.nickname}
@@ -505,11 +552,14 @@ export default function PersonSpace() {
className="h-3 mr-1"
/> */}
+ height={24}
+ width={24}
+ className="mr-1"
+ src={
+ process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
+ "/icons/copy.png"
+ }
+ />
复制
@@ -519,12 +569,17 @@ export default function PersonSpace() {
className="h-3 mr-1"
/> */}
- 前往
+ height={24}
+ width={24}
+ className="mr-1"
+ src={
+ process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
+ "/icons/goto.png"
+ }
+ />
+
+ 前往
+
@@ -542,7 +597,11 @@ export default function PersonSpace() {
router.push("/messageDetail?mid="+streamerInfo?.streamer_ext?.mid)}
+ onClick={() =>
+ router.push(
+ "/messageDetail?mid=" + streamerInfo?.streamer_ext?.mid
+ )
+ }
>
私聊
@@ -563,6 +622,7 @@ export default function PersonSpace() {
avatar={streamerInfo?.streamer_ext?.avatar?.images[0]?.urls[0]}
streamerData={streamerInfo}
/>
+
);
}
diff --git a/app/space/person_space_introduce/[mid]/page.js b/app/space/person_space_introduce/[mid]/page.js
index 1f4df36..7fd05f4 100644
--- a/app/space/person_space_introduce/[mid]/page.js
+++ b/app/space/person_space_introduce/[mid]/page.js
@@ -15,6 +15,7 @@ import { getStreamerInfo } from "@/api/space";
import baseRequest from "@/utils/baseRequest";
import requireAPI from "@/utils/requireAPI";
import { handleShowVideo } from "@/utils/tools/handleFuns";
+import ImagesMask from "@/components/ImagesMask";
export default function PersonSpaceIntroduce() {
const base = baseRequest();
const router = useRouter();
@@ -25,6 +26,7 @@ export default function PersonSpaceIntroduce() {
const [data, setData] = useState(null);
const [isLoading, setIsloading] = useState(true);
const currentIndex = useRef();
+ const imagesMaskRef = useRef(null);
const { mid } = useParams();
useEffect(() => {
if (contentBox.current) {
@@ -42,70 +44,74 @@ export default function PersonSpaceIntroduce() {
}, []);
const showPhotos = (photos, index) => {
currentIndex.current = index;
- const interval = setInterval(() => {
- console.log("bbbbbb")
- const bodyBox = document.getElementsByClassName("photos-bodyBox")[0];
- if (bodyBox) {
- bodyBox.firstChild.lastChild.style.transform = `translateX(-${
- currentIndex.current * (window.innerWidth + 16)
- }px)`;
- // console.log(bodyBox.firstChild.lastChild.style.transform);
- }
- }, 400);
+ // const interval = setInterval(() => {
+ // console.log("bbbbbb")
+ // const bodyBox = document.getElementsByClassName("photos-bodyBox")[0];
+ // if (bodyBox) {
+ // bodyBox.firstChild.lastChild.style.transform = `translateX(-${
+ // currentIndex.current * (window.innerWidth + 16)
+ // }px)`;
+ // // console.log(bodyBox.firstChild.lastChild.style.transform);
+ // }
+ // }, 400);
-
- handleShowImages(index, photos, interval);
-
- // setVisible(true)
- // console.log(imagesMaskRef.current);
- // imagesMaskRef.current.show(
- // photos.map((item) => item?.url),
- // index
- // );
- };
- const handleShowImages = (index, photos, interval) => {
- const mediaDom = document.createElement("div");
- mediaDom.style.width = "100vw";
- document.body.appendChild(mediaDom);
- mediaDom.className = `${
- photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
- }`;
- ImageViewer.clear();
- ImageViewer.Multi.show({
- images: photos.map((item) => item?.urls[0]),
- defaultIndex: index,
- // renderFooter: (image, index) => {
- // return renderFooter(photos[index]?.type == "hid", mediaDom);
- // },
-
- getContainer: mediaDom,
- onIndexChange: (index) => {
- currentIndex.current = index;
- mediaDom.className = `${
- photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
- }`;
- const leftBtn = document.getElementsByClassName("imagesBtnsControllerLeft")[0]
- const rightBtn = document.getElementsByClassName("imagesBtnsControllerRight")[0]
- if(leftBtn && rightBtn){
- if(!index){
- leftBtn.style.opacity=0.5
- rightBtn.style.opacity=1
- }else if(index==photos.length-1){
- leftBtn.style.opacity=1
- rightBtn.style.opacity=0.5
- }else{
- leftBtn.style.opacity=1
- rightBtn.style.opacity=1
- }
- }
- },
- afterClose: () => {
- mediaDom.remove();
- clearInterval(interval);
- },
- classNames: { body: "photos-bodyBox" },
+ // handleShowImages(index, photos, interval);
+ // console.log(imagesMaskRef.current, photos);
+ let newPhotos = photos.map((item) => {
+ return {
+ ...item,
+ url: item.urls[0],
+ };
});
+ imagesMaskRef.current.show(newPhotos, index, data);
};
+ // const handleShowImages = (index, photos, interval) => {
+ // const mediaDom = document.createElement("div");
+ // mediaDom.style.width = "100vw";
+ // document.body.appendChild(mediaDom);
+ // mediaDom.className = `${
+ // photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
+ // }`;
+ // ImageViewer.clear();
+ // ImageViewer.Multi.show({
+ // images: photos.map((item) => item?.urls[0]),
+ // defaultIndex: index,
+ // // renderFooter: (image, index) => {
+ // // return renderFooter(photos[index]?.type == "hid", mediaDom);
+ // // },
+
+ // getContainer: mediaDom,
+ // onIndexChange: (index) => {
+ // currentIndex.current = index;
+ // mediaDom.className = `${
+ // photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
+ // }`;
+ // const leftBtn = document.getElementsByClassName(
+ // "imagesBtnsControllerLeft"
+ // )[0];
+ // const rightBtn = document.getElementsByClassName(
+ // "imagesBtnsControllerRight"
+ // )[0];
+ // if (leftBtn && rightBtn) {
+ // if (!index) {
+ // leftBtn.style.opacity = 0.5;
+ // rightBtn.style.opacity = 1;
+ // } else if (index == photos.length - 1) {
+ // leftBtn.style.opacity = 1;
+ // rightBtn.style.opacity = 0.5;
+ // } else {
+ // leftBtn.style.opacity = 1;
+ // rightBtn.style.opacity = 1;
+ // }
+ // }
+ // },
+ // afterClose: () => {
+ // mediaDom.remove();
+ // clearInterval(interval);
+ // },
+ // classNames: { body: "photos-bodyBox" },
+ // });
+ // };
//当空间价格为0时,直接加入空间
const handleJoinFreeSpace = async () => {
try {
@@ -166,7 +172,10 @@ export default function PersonSpaceIntroduce() {
@@ -296,7 +310,7 @@ export default function PersonSpaceIntroduce() {
} else {
// router.push("/pay");
router.push(
- "/webView/" +
+ "/webView/" +
encodeURIComponent(
"/zone/pay/" +
data?.id +
@@ -314,7 +328,10 @@ export default function PersonSpaceIntroduce() {
height={18}
placeholder=""
className="mr-2"
- src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/money_pink.png"}
+ src={
+ process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
+ "/icons/money_pink.png"
+ }
/>
)}
@@ -332,6 +349,7 @@ export default function PersonSpaceIntroduce() {
)}
+
);
}
diff --git a/components/ImagesMask/index.jsx b/components/ImagesMask/index.jsx
index d61120d..9104954 100644
--- a/components/ImagesMask/index.jsx
+++ b/components/ImagesMask/index.jsx
@@ -13,11 +13,12 @@ import {
faAngleLeft,
faAngleRight,
faDownload,
+ faMinus,
+ faAdd,
} from "@fortawesome/free-solid-svg-icons";
import { createRoot } from "react-dom/client";
import { useRouter } from "next/navigation";
import baseRequest from "@/utils/baseRequest";
-const root = createRoot(document?.getElementById("maskDomBox"));
function ImagesMask({}, ref) {
const [visible, setVisible] = useState(false);
const [images, setImages] = useState([]);
@@ -26,20 +27,25 @@ function ImagesMask({}, ref) {
const defaultIndex = useRef(null);
const router = useRouter();
useEffect(() => {
- root.render(
-
-
-
- );
+ if (visible) {
+ const root = createRoot(document?.getElementById("maskDomBox"));
+ root.render(
+
+
+
+ );
+ }
+
// root.render(xxxx
);
}, [visible]);
@@ -64,16 +70,32 @@ function ImagesMask({}, ref) {
const ImagesMaskContaint = forwardRef(
(
- { visible, images, setVisible, setImages, router, data, defaultIndex = 0 },
+ {
+ visible,
+ images,
+ setVisible,
+ setImages,
+ router,
+ data,
+ defaultIndex = 0,
+ root,
+ },
ref
) => {
const [currentIndex, setCurrentIndex] = useState(0);
const [direction, setDirection] = useState("left");
const [initialX, setInitialX] = useState(0);
const [xOffset, setXOffset] = useState(0);
+ const [initialMoveX, setInitialMoveX] = useState(0);
+ const [initialMoveY, setInitialMoveY] = useState(0);
+ const [xOffsetMove, setXOffsetMove] = useState(0);
+ const [yOffsetMove, setYOffsetMove] = useState(0);
const [active, setActive] = useState(false);
+ const [zoomed, setZoomed] = useState(false);
const base = baseRequest();
const directionX = useRef(0);
+ // const imgDom = useRef(null);
+ const currentDistance = useRef(0);
// const getDistance = (e) => {
// e.stopPropagation();
// const distance = ref.current.scrollLeft;
@@ -83,7 +105,8 @@ const ImagesMaskContaint = forwardRef(
// setCurrentIndex(defaultIndex);
// test3(defaultIndex - 1, "left");
if (defaultIndex) {
- test3(defaultIndex - 1, "left");
+ // console.log("defaultIndex.current", defaultIndex);
+ test3(defaultIndex - 1, "left", true);
}
}, [defaultIndex]);
useEffect(() => {
@@ -94,43 +117,106 @@ const ImagesMaskContaint = forwardRef(
}
}, [currentIndex]);
const test1 = (e) => {
- setInitialX(e.touches[0].clientX - (!currentIndex ? 0 : xOffset));
- if (e.touches.length === 1) {
+ var touches = e.touches;
+ // console.log(currentIndex, e.target.children[0].offsetLeft);
+ setInitialMoveX(touches[0].clientX - e.target.children[0].offsetLeft);
+ setInitialMoveY(touches[0].clientY - e.target.children[0].offsetTop);
+ // console.log(touches[0].pageX- ref.current.getBoundingClientRect().left);
+ if (touches.length === 2) {
+ var touch1 = touches[0];
+ var touch2 = touches[1];
+ currentDistance.current = Math.hypot(
+ touch2.pageX - touch1.pageX,
+ touch2.pageY - touch1.pageY
+ );
+ }
+ if (touches.length === 1 && !zoomed) {
+ setInitialX(touches[0].clientX - (!currentIndex ? 0 : xOffset));
// 单点触摸
setActive(true);
}
};
const test2 = (e) => {
- if (active) {
- let X = e.touches[0].clientX - initialX;
- setDirection(
- directionX.current > e.touches[0].clientX ? "left" : "right"
- );
- ref.current.style.transform = "translateX(" + X + "px)";
- directionX.current = e.touches[0].clientX;
- }
- };
- const test3 = (index, currentDirection) => {
- setActive(false);
- let cxOffset = window.innerWidth;
- if (currentDirection == "left") {
- if (index < images.length - 1) {
- setCurrentIndex(index + 1);
- } else {
- ref.current.style.transform = `translateX(${-cxOffset * index}px)`;
- }
+ var touches = e.touches;
+ // if (touches.length == 2) {
+ // var touch1 = touches[0];
+ // var touch2 = touches[1];
+ // currentDistance.current = Math.hypot(
+ // touch2.pageX - touch1.pageX,
+ // touch2.pageY - touch1.pageY
+ // );
+ // let scale = currentDistance.current / ref.current.startDistance;
+ // let matrix = new WebKitCSSMatrix(
+ // window.getComputedStyle(ref.current.children[0]).transform
+ // );
+ // let currentScale = matrix.m11;
+ // // alert(currentDistance.current + "-" + ref.current.startDistance);
+ // let size =
+ // currentScale * scale < 0.5
+ // ? 0.5
+ // : currentScale * scale > 3
+ // ? 3
+ // : currentScale * scale;
+ // ref.current.children[0].style.transform =
+ // "matrix(" + size + ", 0, 0, " + size + ", 0, 0)";
+ // }
+ if (zoomed) {
+ let currentX = touches[0].clientX - initialMoveX;
+ let currentY = touches[0].clientY - initialMoveY;
+ // console.log(currentX + xOffsetMove);
+ ref.current.children[currentIndex].style.left = `${
+ currentX + xOffsetMove
+ }px`;
+ ref.current.children[currentIndex].style.top = `${
+ currentY + yOffsetMove - 54
+ }px`;
} else {
- if (index > 0) {
- setCurrentIndex(index - 1);
- } else {
- ref.current.style.transform = `translateX(${-cxOffset * index}px)`;
+ if (active) {
+ let X = touches[0].clientX - initialX;
+
+ setDirection(
+ directionX.current > touches[0].clientX ? "left" : "right"
+ );
+ ref.current.style.transform = "translateX(" + X + "px)";
+ directionX.current = touches[0].clientX;
}
}
- // setInitialX(currentX);
- setInitialX(-cxOffset * (index + (currentDirection == "left" ? 1 : -1)));
- if (currentDirection == "left" && index > images.length - 2) return;
- setXOffset(-cxOffset * (index + (currentDirection == "left" ? 1 : -1)));
};
+ const test3 = (index, currentDirection, isActive) => {
+ // const rect = ref.current.getBoundingClientRect();
+ // console.log(ref.current.children[currentIndex].offsetTop);
+ setXOffsetMove(
+ ref.current.children[currentIndex].offsetLeft -
+ window.innerWidth * currentIndex
+ );
+ setYOffsetMove(ref.current.children[currentIndex].offsetTop + 54);
+
+ if (active || isActive) {
+ let cxOffset = window.innerWidth;
+ if (currentDirection == "left") {
+ if (index < images.length - 1) {
+ setCurrentIndex(index + 1);
+ } else {
+ ref.current.style.transform = `translateX(${-cxOffset * index}px)`;
+ }
+ } else {
+ if (index > 0) {
+ setCurrentIndex(index - 1);
+ } else {
+ ref.current.style.transform = `translateX(${-cxOffset * index}px)`;
+ }
+ }
+ // setInitialX(currentX);
+ setInitialX(
+ -cxOffset * (index + (currentDirection == "left" ? 1 : -1))
+ );
+ if (currentDirection == "left" && index > images.length - 2) return;
+ setXOffset(-cxOffset * (index + (currentDirection == "left" ? 1 : -1)));
+ }
+ };
+ // };
+ // };
+ // };
function downloadImage(url) {
let randomNum = "";
for (let i = 0; i < 10; i++) {
@@ -145,6 +231,7 @@ const ImagesMaskContaint = forwardRef(
a.click();
});
}
+
return (
{
setVisible(false), setImages([]), setCurrentIndex(null);
- // root.unmount();
+ root.unmount();
}}
color="#000000d9"
>
{images[currentIndex]?.type != "hid" && (
downloadImage(images[currentIndex]?.url)}
- className="z-50 flex justify-center items-center w-[38px] h-[38px] bg-[#ffffff1a] text-[#fff] rounded-full absolute top-[12px] left-[12px]"
+ className="z-50 flex justify-between items-center absolute top-[12px] left-[12px]"
+ style={{ width: "calc(100% - 24px)" }}
>
-
+
+ {/*
downloadImage(images[currentIndex]?.url)}
+ className="flex justify-center items-center w-[38px] h-[38px] bg-[#ffffff1a] text-[#fff] rounded-full"
+ >
+
+
*/}
+
+
+
{
+ setZoomed(!zoomed);
+ setActive(false);
+ ref.current.children[currentIndex].style.transform =
+ "matrix(" +
+ (zoomed ? 1 : 3) +
+ ", 0, 0, " +
+ (zoomed ? 1 : 3) +
+ ", 0, 0)";
+ ref.current.children[currentIndex].style.left = `0px`;
+ ref.current.children[currentIndex].style.top = `0px`;
+ }}
+ className="flex justify-center items-center w-[38px] h-[38px] bg-[#ffffff1a] text-[#fff] rounded-full"
+ >
+
+
+
)}
@@ -173,13 +289,13 @@ const ImagesMaskContaint = forwardRef(
style={{ height: "calc(100vh - 174px)" }}
onClick={() => {
setVisible(false), setImages([]), setCurrentIndex(null);
- // root.unmount();
+ root.unmount();
}}
>