Skip to content

Create professional demos and 3D mockups in seconds, directly in your browser

feat: update DropImage component for localization support and enhance visual styling; adjust ControlsPopup position

CristianOlivera1ebfd618fe5e1
diff --git a/app/components/ui/editor/EditorHoverTooltip.tsx b/app/components/ui/editor/EditorHoverTooltip.tsx
index 845beed..4ed4905 100644
--- a/app/components/ui/editor/EditorHoverTooltip.tsx
+++ b/app/components/ui/editor/EditorHoverTooltip.tsx
@@ -11,10 +11,9 @@ export function EditorHoverTooltip({ show }: EditorHoverTooltipProps) {
if (!show) return null;
return (
- <div className="absolute inset-0 flex items-center justify-center pointer-events-none animate-in fade-in zoom-in-95 duration-200">
- <div className="flex items-center gap-4 px-4 py-2 bg-[#0A0A0A]/90 backdrop-blur-md rounded-full border border-white/30 shadow-2xl">
- <div className="flex items-center gap-3">
- <span className="text-[11px] text-white/70 font-medium tracking-tight">Zoom</span>
+ <div className="flex items-center justify-center pointer-events-none animate-in fade-in zoom-in-95 duration-200">
+ <div className="flex items-center gap-4 px-4 py-2 w-fit h-auto bg-[#0A0A0A]/90 backdrop-blur-md rounded-full border border-white/30 shadow-2xl">
+ <div className="flex items-center gap-3 shrink-0">
<div className="flex items-center gap-1">
<kbd className="h-5 px-1.5 flex items-center justify-center bg-[#171717] rounded border border-white/30 text-[9px] text-white font-mono">
Ctrl
@@ -26,10 +25,11 @@ export function EditorHoverTooltip({ show }: EditorHoverTooltipProps) {
</div>
</div>
- <div className="w-px h-4 bg-white/30" />
+ <div className="w-px h-4 bg-white/30 shrink-0" />
- <div className="flex items-center gap-3">
- <span className="text-[11px] text-white/70 font-medium tracking-tight"><span>{t("paste")}</span>
+ <div className="flex items-center gap-3 shrink-0">
+ <span className="text-[11px] text-white/70 font-medium tracking-tight whitespace-nowrap">
+ {t("paste")}
</span>
<div className="flex items-center gap-1">
<kbd className="h-5 px-1.5 flex items-center justify-center bg-[#171717] rounded border border-white/30 text-[9px] text-white font-mono">
diff --git a/app/components/ui/editor/GetMediaMaskStyles.tsx b/app/components/ui/editor/GetMediaMaskStyles.tsx
deleted file mode 100644
index 3e2c82f..0000000
--- a/app/components/ui/editor/GetMediaMaskStyles.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import type { ImageMaskConfig } from "@/types/photo.types";
-
-export function GetMediaMaskStyles(maskConfig?: ImageMaskConfig | null): React.CSSProperties {
- if (!maskConfig || !maskConfig.enabled) return {};
-
- const masks: string[] = [];
-
- if (maskConfig.top) {
- masks.push(`linear-gradient(180deg, transparent ${maskConfig.top.from}%, black ${maskConfig.top.to ?? 100}%)`);
- }
- if (maskConfig.bottom) {
- masks.push(`linear-gradient(0deg, transparent ${maskConfig.bottom.from}%, black ${maskConfig.bottom.to ?? 100}%)`);
- }
- if (maskConfig.left) {
- masks.push(`linear-gradient(90deg, transparent ${maskConfig.left.from}%, black ${maskConfig.left.to ?? 100}%)`);
- }
- if (maskConfig.right) {
- masks.push(`linear-gradient(270deg, transparent ${maskConfig.right.from}%, black ${maskConfig.right.to ?? 100}%)`);
- }
- if (maskConfig.angle !== undefined) {
- masks.push(`linear-gradient(${maskConfig.angle}deg, transparent ${maskConfig.angleFrom ?? 0}%, black ${maskConfig.angleTo ?? 100}%)`);
- }
-
- if (masks.length === 0) return {};
-
- return {
- WebkitMaskImage: masks.join(', '),
- WebkitMaskComposite: 'source-in',
- maskImage: masks.join(', '),
- maskComposite: 'intersect',
- };
-}
\ No newline at end of file
diff --git a/components/ui/ControlsPopup.tsx b/components/ui/ControlsPopup.tsx
index b1ef7ae..a7f3f4a 100644
--- a/components/ui/ControlsPopup.tsx
+++ b/components/ui/ControlsPopup.tsx
@@ -21,7 +21,7 @@ export function ControlsPopup() {
style={{
position: "fixed",
bottom: "220px",
- right: "290px",
+ right: "275px",
width: "320px",
zIndex: 10,
}}
diff --git a/components/ui/DropImage.tsx b/components/ui/DropImage.tsx
index 823337e..6acbda4 100644
--- a/components/ui/DropImage.tsx
+++ b/components/ui/DropImage.tsx
@@ -1,14 +1,17 @@
import { Icon } from "@iconify/react";
+import { useTranslations } from "next-intl";
export default function DropImage() {
+ const t = useTranslations("dropImage");
+
return (
<div className="absolute inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm pointer-events-none">
- <div className="flex flex-col items-center gap-4 text-white mask-[radial-gradient(circle,black_50%,transparent_95%)]">
+ <div className="flex flex-col items-center gap-4 text-white mask-[radial-gradient(circle,black_70%,transparent_99%)]">
<Icon icon="hugeicons:image-upload" width="120" />
- <div className="text-xl font-semibold uppercase tracking-wider">
- Suelta la imagen
+ <div className="text-3xl font-extrabold uppercase tracking-wider">
+ {t("title")}
</div>
</div>
</div>
);
-}
\ No newline at end of file
+}