Create professional demos and 3D mockups in seconds, directly in your browser
feat: enhance Header component for mobile tour visibility and update HeroEditorPreview styles
CristianOlivera1594d4bf2f21a
diff --git a/app/components/common/Header.tsx b/app/components/common/Header.tsxindex 562f3a1..ca04cb5 100644--- a/app/components/common/Header.tsx+++ b/app/components/common/Header.tsx@@ -8,6 +8,7 @@ import { MobileMenu } from "./MobileMenu";import { LanguageSwitcher } from "./LanguageSwitcher";import { useTranslations } from "next-intl";import { Icon } from "@iconify/react";+import { getIsMobileSnapshot } from "@/lib/layers.utils";import { Button } from "@/components/ui/button";import { useRecording } from "@/app/contexts/RecordingContext";import RecordingSetupDialog from "../ui/RecordingSetupDialog";@@ -43,8 +44,10 @@ export default function Header() {useEffect(() => {const tourCompleted = localStorage.getItem("openvid-tour-completed");- if (!tourCompleted) {+ // El tour usa elementos ocultos en móvil (`hidden sm:flex`), así que no se muestra < sm.+ if (!tourCompleted && !getIsMobileSnapshot()) {const driverTimer = setTimeout(() => {+ if (getIsMobileSnapshot()) return;if (document.getElementById("tour-video-upload")) {const driverObj = driver({showProgress: true,@@ -167,7 +170,7 @@ export default function Header() {</Button><div className="flex items-center gap-2">{!isMounted ? (- <div className="w-25 h-9 rounded-md bg-white/10 animate-pulse border border-white/5"></div>+ <div className="hidden sm:flex w-25 h-9 rounded-md bg-white/10 animate-pulse border border-white/5"></div>) : (<LanguageSwitcher />)}diff --git a/app/components/ui/home/HeroEditorPreview.tsx b/app/components/ui/home/HeroEditorPreview.tsxindex fd3e1fd..44ff345 100644--- a/app/components/ui/home/HeroEditorPreview.tsx+++ b/app/components/ui/home/HeroEditorPreview.tsx@@ -32,6 +32,8 @@ import {} from "@/lib/editor-preview-hero.utils";import { BackgroundPanel, DraggableRange, MiniSidebar, TimelineClipContent, ZoomFragmentRangeItem } from "@/components/ui/HeroEditorPreviewComponents";+const RENDER_HEADROOM = 3;+function EditorCanvas({videoRef,videoTransform,@@ -152,9 +154,19 @@ function EditorCanvas({style={{transform: videoTransform,transformOrigin: transformOrigin,- willChange: "transform",}}>+ <div+ className="absolute"+ style={{+ left: "50%",+ top: "50%",+ width: `${RENDER_HEADROOM * 100}%`,+ height: `${RENDER_HEADROOM * 100}%`,+ transform: `translate(-50%, -50%) scale(${1 / RENDER_HEADROOM})`,+ transformOrigin: "center center",+ }}+ ><divclassName="absolute overflow-hidden bg-black squircle-corner"style={{@@ -170,7 +182,7 @@ function EditorCanvas({mutedplaysInlinepreload="metadata"- poster="/images/pages/demo-hero-poster.webp"+ poster="/images/pages/preview-editor-poster.webp"onLoadedMetadata={onLoadedMetadata}draggable={false}onDragStart={(e) => e.preventDefault()}@@ -190,9 +202,9 @@ function EditorCanvas({translateY: "-50%",transition: "left 90ms ease-out, top 90ms ease-out",}}- initial={{ opacity: 0, scale: 1.4 * inverseScale }}- animate={{ opacity: 0.9, scale: inverseScale }}- exit={{ opacity: 0, scale: 1.4 * inverseScale }}+ initial={{ opacity: 0, scale: 1.4 * inverseScale * RENDER_HEADROOM }}+ animate={{ opacity: 0.9, scale: inverseScale * RENDER_HEADROOM }}+ exit={{ opacity: 0, scale: 1.4 * inverseScale * RENDER_HEADROOM }}transition={{ duration: 0.35, ease: [0.22, 1, 0.36, 1] }}><div className="w-6 h-6 rounded-full border border-white/70" />@@ -213,13 +225,14 @@ function EditorCanvas({width: 24,height: 24,}}- initial={{ opacity: 0.55, scale: 0.4 * inverseScale }}- animate={{ opacity: 0, scale: 2.4 * inverseScale }}+ initial={{ opacity: 0.55, scale: 0.4 * inverseScale * RENDER_HEADROOM }}+ animate={{ opacity: 0, scale: 2.4 * inverseScale * RENDER_HEADROOM }}transition={{ duration: 0.55, ease: "easeOut" }}/>)}</AnimatePresence></div>+ </div></div><AnimatePresence>{isZoomActive && (@@ -496,8 +509,8 @@ export default function HeroEditorPreview() {const [blurPercent, setBlurPercent] = useState(0);const [paddingPercent, setPaddingPercent] = useState(0);- const [roundedPercent, setRoundedPercent] = useState(30);- const [shadowPercent, setShadowPercent] = useState(9);+ const [roundedPercent, setRoundedPercent] = useState(25);+ const [shadowPercent, setShadowPercent] = useState(30);const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });const userSelectedBackgroundRef = useRef(false);@@ -663,13 +676,13 @@ export default function HeroEditorPreview() {const transformOrigin = `${effectiveFocusX.toFixed(2)}% ${effectiveFocusY.toFixed(2)}%`;- const roundedPx = (roundedPercent / SLIDER_MAX) * 32;+ const roundedPx = (roundedPercent / SLIDER_MAX) * 100;const paddingPct = (paddingPercent / SLIDER_MAX) * 12;const backgroundBlurPx = (blurPercent / SLIDER_MAX) * 40;const shadowT = shadowPercent / SLIDER_MAX;- const shadowY = 8 + shadowT * 22;- const shadowBlur = 15 + shadowT * 70;- const shadowOpacity = 0.15 + shadowT * 0.35;+ const shadowY = 5 + shadowT * 16;+ const shadowBlur = 6 + shadowT * 44;+ const shadowOpacity = 0.22 + shadowT * 0.42;const dynamicShadow = `0 ${shadowY}px ${shadowBlur}px rgba(0,0,0,${shadowOpacity.toFixed(2)})`;const cursorTarget = useMemo(() => {diff --git a/public/images/pages/preview-editor-poster.webp b/public/images/pages/preview-editor-poster.webpnew file mode 100644index 0000000..bf0ec04Binary files /dev/null and b/public/images/pages/preview-editor-poster.webp differ