Skip to content

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

feat: enhance EditorPreview with Atropos 3D effects and update styles across components

CristianOlivera178bfb122429b
diff --git a/app/components/ui/EditorPreview.tsx b/app/components/ui/EditorPreview.tsx
index a034d8a..efe2b8f 100644
--- a/app/components/ui/EditorPreview.tsx
+++ b/app/components/ui/EditorPreview.tsx
@@ -1,15 +1,54 @@
+'use client';
+import { useEffect, useRef } from 'react';
+import Atropos from 'atropos';
+import 'atropos/css';
+
export default function EditorPreview() {
+ const atroposRef = useRef<HTMLDivElement>(null);
+
+ useEffect(() => {
+ if (!atroposRef.current) return;
+
+ const myAtropos = Atropos({
+ el: atroposRef.current,
+ activeOffset: 40,
+ shadow: false,
+ highlight: true,
+ });
+
+ return () => {
+ myAtropos.destroy();
+ };
+ }, []);
+
return (
- <div className="relative max-w-6xl mx-auto">
- <div className="absolute -inset-1 bg-linear-to-b from-neutral-700/10 to-transparent rounded-2xl blur-md -z-10"></div>
+ <div className="relative max-w-6xl mx-auto mt-10 sm:mt-0 hero-perspective-container">
- <div>
- <img
- src="/images/pages/openvid.webp"
- alt="openvid Editor Preview"
- className="w-full h-auto object-cover"
- loading="lazy"
- />
+ <div className="hero-3d-wrapper relative w-full">
+
+ <div ref={atroposRef} className="atropos w-full rounded-2xl">
+ <div className="atropos-scale">
+ <div className="atropos-rotate">
+ <div className="atropos-inner rounded-2xl">
+
+ <div
+ className="absolute -inset-1 bg-linear-to-b from-neutral-700/10 to-transparent rounded-2xl blur-md -z-10"
+ data-atropos-offset="-5"
+ ></div>
+
+ <img
+ src="/images/pages/openvid.webp"
+ alt="openvid Editor Preview"
+ className="w-full h-auto object-cover rounded-xl"
+ loading="lazy"
+ data-atropos-offset="3"
+ />
+
+ </div>
+ </div>
+ </div>
+ </div>
+
</div>
</div>
);
diff --git a/app/components/ui/Hero.tsx b/app/components/ui/Hero.tsx
index e34e177..4f42412 100644
--- a/app/components/ui/Hero.tsx
+++ b/app/components/ui/Hero.tsx
@@ -20,14 +20,12 @@ export default function Hero({ onVideoUpload }: HeroProps) {
if (!file.type.startsWith("video/")) return;
setIsUploading(true);
try {
- // Save video to IndexedDB before navigating
await saveUploadedVideo(file);
if (onVideoUpload) {
onVideoUpload(file);
}
- // Navigate to editor after saving
router.push("/editor");
} catch (error) {
console.error("Error uploading video:", error);
@@ -50,7 +48,6 @@ export default function Hero({ onVideoUpload }: HeroProps) {
const handleDragLeave = (e: React.DragEvent) => {
e.preventDefault();
e.stopPropagation();
- // Evitamos que el leave se dispare si estamos dentro del mismo contenedor
setIsDragging(false);
};
diff --git a/app/components/ui/RecordingSteps.tsx b/app/components/ui/RecordingSteps.tsx
index 55a5e44..d34751e 100644
--- a/app/components/ui/RecordingSteps.tsx
+++ b/app/components/ui/RecordingSteps.tsx
@@ -61,7 +61,7 @@ export default function InteractiveRecordingSteps() {
);
};
- const stepsData = [
+ const stepsData = [
{
id: 1,
title: "Inicia la captura",
@@ -95,39 +95,39 @@ export default function InteractiveRecordingSteps() {
</div>
),
visual: (
- <div className="aspect-video bg-[#0A0A0A] border border-white/10 rounded-xl flex items-center justify-center relative group shadow-2xl">
+ <div className="aspect-video bg-[#0A0A0A] border border-white/10 rounded-xl flex items-center justify-center relative group shadow-2xl p-1 sm:p-0">
<div className="absolute inset-0 bg-[radial-linear(#ffffff22_1px,transparent_1px)] [bg-size:16px_16px] opacity-10"></div>
- <div className="bg-[#292A2D] rounded-xl w-full max-w-full shadow-2xl relative z-10 flex flex-col font-sans border border-white/5">
-
- <div className="flex justify-between px-4 pt-3 border-b border-white/10 text-[11px] font-medium">
- <div className="pb-2 text-neutral-400 hover:text-neutral-200 cursor-pointer flex-1 text-center transition-colors">
+ <div className="bg-[#292A2D] rounded-xl w-full max-w-full shadow-2xl relative z-10 flex flex-col font-sans border border-white/5 origin-center">
+
+ <div className="flex justify-between px-2 sm:px-4 pt-2 sm:pt-3 border-b border-white/10 text-[9px] sm:text-[11px] font-medium">
+ <div className="pb-2 text-neutral-400 hover:text-neutral-200 cursor-pointer flex-1 text-center transition-colors truncate px-1">
Pestaña de Brave
</div>
- <div className="pb-2 text-[#C0B4F0] border-b-2 border-[#C0B4F0] flex-1 text-center">
+ <div className="pb-2 text-[#C0B4F0] border-b-2 border-[#C0B4F0] flex-1 text-center truncate px-1">
Ventana
</div>
- <div className="pb-2 text-neutral-400 hover:text-neutral-200 cursor-pointer flex-1 text-center transition-colors">
+ <div className="pb-2 text-neutral-400 hover:text-neutral-200 cursor-pointer flex-1 text-center transition-colors truncate px-1 hidden sm:block">
Pantalla completa
</div>
</div>
- <div className="p-5 flex gap-4 h-37.5">
- <div className="w-32.5 flex flex-col gap-2">
- <div className="w-full h-18.75 bg-[#141414] rounded-md border-2 border-[#C0B4F0] overflow-hidden shadow-inner relative transition-colors cursor-pointer">
- <div className="absolute top-2 left-2 w-full h-full bg-neutral-800 rounded-t-md border border-white/5"></div>
+ <div className="p-3 sm:p-5 flex justify-center gap-3 sm:gap-4 h-auto sm:h-37.5">
+ <div className="w-24 sm:w-32.5 flex flex-col gap-2">
+ <div className="w-full h-14 sm:h-18.75 bg-[#141414] rounded-md border-2 border-[#C0B4F0] overflow-hidden shadow-inner relative transition-colors cursor-pointer">
+ <div className="absolute top-1 sm:top-2 left-1 sm:left-2 w-full h-full bg-neutral-800 rounded-t-md border border-white/5"></div>
</div>
- <div className="flex items-center gap-1.5 text-[10px] text-neutral-200">
+ <div className="flex items-center gap-1.5 text-[9px] sm:text-[10px] text-neutral-200">
<Icon icon="logos:brave" width="12" className="shrink-0" />
- <span className="truncate">openvid - Crea tomas ci...</span>
+ <span className="truncate">openvid - Crea tomas...</span>
</div>
</div>
- <div className="w-32.5 flex flex-col gap-2">
- <div className="w-full h-18.75 bg-[#141414] rounded-md border border-gray-500 overflow-hidden shadow-inner relative cursor-pointer">
+ <div className="w-24 sm:w-32.5 flex flex-col gap-2">
+ <div className="w-full h-14 sm:h-18.75 bg-[#141414] rounded-md border border-gray-500 overflow-hidden shadow-inner relative cursor-pointer">
<div className="absolute top-1 left-1 w-[95%] h-[90%] bg-[#1E1E1E] rounded border border-white/5 flex flex-col">
- <div className="h-2 border-b border-white/5"></div>
- <div className="p-1.5 space-y-1">
+ <div className="h-1.5 sm:h-2 border-b border-white/5"></div>
+ <div className="p-1 sm:p-1.5 space-y-1">
<div className="h-0.5 w-1/2 bg-blue-400/50 rounded"></div>
<div className="h-0.5 w-3/4 bg-green-400/50 rounded"></div>
<div className="h-0.5 w-1/3 bg-orange-400/50 rounded"></div>
@@ -135,29 +135,29 @@ export default function InteractiveRecordingSteps() {
</div>
</div>
</div>
- <div className="flex items-center gap-1.5 text-[10px] text-neutral-200">
+ <div className="flex items-center gap-1.5 text-[9px] sm:text-[10px] text-neutral-200">
<Icon icon="logos:visual-studio-code" width="12" className="shrink-0" />
- <span className="truncate">RecordingSteps.tsx - op...</span>
+ <span className="truncate">RecordingSteps.tsx</span>
</div>
</div>
</div>
- <div className="px-5 pb-5">
- <div className="border-t border-white/10 pt-4 flex justify-between items-center mb-6">
- <div className="flex items-center gap-2 text-[11px] text-neutral-300">
- <Icon icon="solar:volume-loud-bold" width="14" className="text-neutral-400" />
- Compartir también el audio del sistema
+ <div className="px-3 sm:px-5 pb-3 sm:pb-5">
+ <div className="border-t border-white/10 pt-3 sm:pt-4 flex flex-col sm:flex-row justify-between items-center mb-4 sm:mb-6 gap-3 sm:gap-0">
+ <div className="flex items-center gap-2 text-[10px] sm:text-[11px] text-neutral-300">
+ <Icon icon="solar:volume-loud-bold" width="14" className="text-neutral-400 shrink-0" />
+ Compartir también el audio
</div>
- <div className="w-7 h-4 bg-[#5F6368] rounded-full relative shadow-inner">
+ <div className="w-7 h-4 bg-[#5F6368] rounded-full relative shadow-inner shrink-0">
<div className="absolute top-0.5 left-0.5 w-3 h-3 bg-neutral-300 rounded-full shadow"></div>
</div>
</div>
- <div className="flex justify-end gap-3">
- <button className="px-5 py-1.5 bg-[#3C3D3F] text-neutral-400 rounded-full text-[11px] font-medium cursor-not-allowed">
+ <div className="flex w-full sm:w-auto justify-end gap-2 sm:gap-3">
+ <button className="flex-1 sm:flex-none px-4 sm:px-5 py-1.5 bg-[#3C3D3F] text-neutral-400 rounded-full text-[10px] sm:text-[11px] font-medium cursor-not-allowed">
Compartir
</button>
- <button className="px-5 py-1.5 bg-[#292A2D] text-white rounded-full text-[11px] font-medium border border-[#C0B4F0] ring-1 ring-[#C0B4F0] ring-offset-2 ring-offset-[#292A2D] outline-none">
+ <button className="flex-1 sm:flex-none px-4 sm:px-5 py-1.5 bg-[#292A2D] text-white rounded-full text-[10px] sm:text-[11px] font-medium border border-[#C0B4F0] ring-1 ring-[#C0B4F0] ring-offset-2 ring-offset-[#292A2D] outline-none">
Cancelar
</button>
</div>
@@ -177,31 +177,31 @@ export default function InteractiveRecordingSteps() {
isReversed: false,
actionButton: null,
visual: (
- <div className="aspect-video bg-[#0A0A0A] border border-white/10 rounded-xl overflow-hidden flex items-center justify-center relative group shadow-2xl">
+ <div className="aspect-video bg-[#0A0A0A] border border-white/10 rounded-xl overflow-hidden flex items-center justify-center relative group shadow-2xl p-4">
<div className="absolute inset-0 bg-[radial-linear(#ffffff22_1px,transparent_1px)] [bg-size:16px_16px] opacity-10"></div>
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-75 h-37.5 bg-blue-500/5 rounded-[100%] blur-3xl"></div>
- <div className="bg-[#1C1A20] border border-white/5 rounded-full pl-4 pr-6 py-2 flex items-center gap-4 shadow-2xl z-10">
-
- <div className="flex items-center gap-3">
- <Icon icon="ic:baseline-pause" className="text-white text-lg" />
- <span className="text-[11px] text-[#E8EAED]">
+ <div className="bg-[#1C1A20] border border-white/5 rounded-2xl sm:rounded-full px-4 sm:pl-4 sm:pr-6 py-3 sm:py-2 flex flex-col sm:flex-row items-center gap-3 sm:gap-4 shadow-2xl z-10 w-full sm:w-auto max-w-[90%] sm:max-w-none text-center sm:text-left">
+
+ <div className="flex flex-col sm:flex-row items-center gap-2 sm:gap-3">
+ <Icon icon="ic:baseline-pause" className="text-white text-lg hidden sm:block" />
+ <span className="text-[10px] sm:text-[11px] text-[#E8EAED] leading-tight">
https://openvid.dev está compartiendo una ventana.
</span>
</div>
- <div className="flex items-center gap-4 ml-2">
- <button className="bg-[#B7BEF8] hover:bg-[#A6AEF7] text-[#141414] text-[11px] font-medium px-4 py-1.5 rounded-full transition-colors">
+ <div className="flex items-center gap-3 sm:gap-4 sm:ml-2 mt-1 sm:mt-0">
+ <button className="bg-[#B7BEF8] hover:bg-[#A6AEF7] text-[#141414] text-[10px] sm:text-[11px] font-medium px-3 sm:px-4 py-1.5 rounded-full transition-colors whitespace-nowrap cursor-default!">
Dejar de compartir
</button>
<div className="relative group/btn cursor-pointer">
- <span className="text-[#8AB4F8] text-[11px] font-medium hover:text-white transition-colors">
+ <span className="text-[#8AB4F8] text-[10px] sm:text-[11px] font-medium hover:text-white transition-colors">
Ocultar
</span>
<Icon
icon="solar:cursor-default-bold"
- className="absolute -bottom-5 -right-3 text-white text-xl drop-shadow-[0_2px_4px_rgba(0,0,0,0.5)] z-20"
+ className="absolute -bottom-4 sm:-bottom-5 -right-2 sm:-right-3 text-white text-lg sm:text-xl drop-shadow-[0_2px_4px_rgba(0,0,0,0.5)] z-20"
/>
</div>
</div>
@@ -222,27 +222,27 @@ export default function InteractiveRecordingSteps() {
actionButton: null,
visual: (
<div className="aspect-video bg-[#000B13] border border-white/10 rounded-xl overflow-hidden relative group shadow-2xl">
- <div className="absolute inset-0 bg-[#000B13]/95 backdrop-blur-md flex items-center justify-center z-10 p-6">
+ <div className="absolute inset-0 bg-[#000B13]/95 backdrop-blur-md flex items-center justify-center z-10 p-4 sm:p-6">
<div className="flex flex-col items-center justify-center h-full w-full max-h-full">
-
- <div className="relative w-28 h-28 sm:w-32 sm:h-32 flex items-center justify-center shrink-0">
+ <div className="relative w-20 h-20 sm:w-32 sm:h-32 flex items-center justify-center shrink-0">
<div className="absolute inset-0 rounded-full bg-[#00A3FF]/20 animate-pulse" />
- <div className="absolute inset-4 rounded-full bg-[#00A3FF]/10" />
+ <div className="absolute inset-2 sm:inset-4 rounded-full bg-[#00A3FF]/10" />
- <div className="relative w-24 h-24 sm:w-28 sm:h-28 rounded-full bg-linear-to-br from-[#00A3FF] to-blue-800 p-0.5 shadow-[0_0_30px_rgba(0,163,255,0.2)]">
+ <div className="relative w-16 h-16 sm:w-28 sm:h-28 rounded-full bg-linear-to-br from-[#00A3FF] to-blue-800 p-0.5 shadow-[0_0_30px_rgba(0,163,255,0.2)]">
<div className="w-full h-full rounded-full bg-[#0E0E12] flex items-center justify-center">
- <span className="text-5xl sm:text-6xl font-bold text-white tabular-nums tracking-tighter">
+ <span className="text-3xl sm:text-6xl font-bold text-white tabular-nums tracking-tighter">
5
</span>
</div>
</div>
</div>
- <div className="text-center mt-4 sm:mt-6 flex flex-col gap-1 sm:gap-2">
- <h2 className="text-lg sm:text-xl md:text-2xl font-bold text-white tracking-tight leading-tight">
- ¡Cambia de pestaña ahora!
+
+ <div className="text-center mt-3 sm:mt-6 flex flex-col gap-1 sm:gap-2">
+ <h2 className="text-base sm:text-xl md:text-2xl font-bold text-white tracking-tight leading-tight">
+ ¡Cambia de pestaña!
</h2>
- <p className="text-xs sm:text-sm text-neutral-400 max-w-60 mx-auto leading-relaxed">
+ <p className="text-[10px] sm:text-sm text-neutral-400 max-w-48 sm:max-w-60 mx-auto leading-relaxed">
La grabación iniciará en la pantalla que seleccionaste.
</p>
</div>
@@ -282,26 +282,29 @@ export default function InteractiveRecordingSteps() {
<div className="absolute top-1/2 left-0 w-full h-px bg-white/5"></div>
<div className="absolute top-0 left-1/2 w-px h-full bg-white/5"></div>
- <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-auto scale-90 sm:scale-100">
- <div className="flex items-center gap-4 bg-[#1E1E20] border border-white/10 rounded-full pl-5 pr-2 py-2 shadow-2xl">
- <div className="flex items-center gap-3 pr-2 border-r border-white/10">
- <div className="w-3 h-3 rounded-full bg-red-500 animate-pulse" />
- <span className="text-[11px] text-white font-medium">Grabando</span>
- <span className="text-[11px] text-red-400 font-mono font-bold">
+ <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-auto w-full px-4 sm:px-0 sm:w-auto">
+ <div className="flex flex-col sm:flex-row items-center gap-3 sm:gap-4 bg-[#1E1E20] border border-white/10 rounded-2xl sm:rounded-full py-3 sm:pl-5 sm:pr-2 sm:py-2 shadow-2xl mx-auto max-w-[200px] sm:max-w-none">
+
+ <div className="flex items-center justify-center gap-2 sm:gap-3 w-full sm:w-auto pb-2 sm:pb-0 border-b sm:border-b-0 sm:border-r border-white/10 sm:pr-2">
+ <div className="w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-full bg-red-500 animate-pulse" />
+ <span className="text-[10px] sm:text-[11px] text-white font-medium">Grabando</span>
+ <span className="text-[10px] sm:text-[11px] text-red-400 font-mono font-bold">
00:42
</span>
</div>
- <button className="group flex items-center gap-3 px-4 py-1.5 bg-red-500/10 hover:bg-red-500/20 border border-red-500/30 hover:border-red-500/50 rounded-full transition-all">
- <div className="flex items-center gap-2 text-red-400 text-sm font-medium">
- <div className="w-3 h-3 bg-red-500 rounded-sm group-hover:scale-110 transition-transform" />
+
+ <button className="group flex items-center justify-center gap-2 sm:gap-3 px-3 sm:px-4 py-1.5 sm:bg-red-500/10 sm:hover:bg-red-500/20 sm:border border-transparent sm:border-red-500/30 hover:border-red-500/50 rounded-full transition-all w-full sm:w-auto cursor-default!">
+ <div className="flex items-center gap-2 text-red-400 text-xs sm:text-sm font-medium">
+ <div className="w-2.5 h-2.5 sm:w-3 sm:h-3 bg-red-500 rounded-sm group-hover:scale-110 transition-transform" />
Detener
</div>
- <div className="flex items-center gap-1 text-[10px] bg-red-500/10 text-red-300 px-1.5 py-0.5 rounded border border-red-500/20">
+ <div className="hidden sm:flex items-center gap-1 text-[10px] bg-red-500/10 text-red-300 px-1.5 py-0.5 rounded border border-red-500/20">
<kbd>Alt</kbd>
<span>+</span>
<kbd>D</kbd>
</div>
</button>
+
</div>
</div>
</div>
@@ -310,7 +313,7 @@ export default function InteractiveRecordingSteps() {
];
return (
- <div id="docs" className="w-full max-w-7xl mx-auto px-6 py-24 text-left">
+ <div id="docs" className="w-full max-w-7xl mx-auto px-0 sm:px-6 py-24 text-left">
<div className="max-w-3xl mx-auto text-center mb-32">
<h2 className="text-4xl md:text-6xl font-bold tracking-tighter text-white mb-6 leading-tight drop-shadow-[1.2px_1.2px_100.2px_rgba(183,203,248,1)]">
Crea tu toma en <br />
diff --git a/app/components/ui/editor/ElementsMenu.tsx b/app/components/ui/editor/ElementsMenu.tsx
index b58beaf..42956c2 100644
--- a/app/components/ui/editor/ElementsMenu.tsx
+++ b/app/components/ui/editor/ElementsMenu.tsx
@@ -21,19 +21,20 @@ export function ElementsMenu({
}: ElementsMenuProps) {
const [mode, setMode] = useState<"text" | "elements">("elements");
- const [shapeSize, setShapeSize] = useState(15);
+ // Professional default values for elements
+ const [shapeSize, setShapeSize] = useState(20);
const [shapeColor, setShapeColor] = useState("#FFFFFF");
const [shapeOpacity, setShapeOpacity] = useState(100);
const [textContent, setTextContent] = useState("Texto");
- const [textFontSize, setTextFontSize] = useState(32);
+ const [textFontSize, setTextFontSize] = useState(48);
const [textColor, setTextColor] = useState("#FFFFFF");
const [textOpacity, setTextOpacity] = useState(100);
const [textFontFamily, setTextFontFamily] = useState("Inter");
- const [textFontWeight, setTextFontWeight] = useState<"normal" | "medium" | "bold">("normal");
+ const [textFontWeight, setTextFontWeight] = useState<"normal" | "medium" | "bold">("bold");
const [imageOpacity, setImageOpacity] = useState(100);
- const [imageSize, setImageSize] = useState(25);
+ const [imageSize, setImageSize] = useState(30);
const [selectedSvgCategory, setSelectedSvgCategory] = useState<string>("all");
const [selectedImageCategory, setSelectedImageCategory] = useState<string>("all");
@@ -69,17 +70,18 @@ export function ElementsMenu({
setMode("text");
}
} else {
- setShapeSize(15);
+ // Reset to default values when no element is selected
+ setShapeSize(20);
setShapeColor("#FFFFFF");
setShapeOpacity(100);
- setImageSize(25);
+ setImageSize(30);
setImageOpacity(100);
setTextContent("Texto");
- setTextFontSize(32);
+ setTextFontSize(48);
setTextColor("#FFFFFF");
setTextOpacity(100);
setTextFontFamily("Inter");
- setTextFontWeight("normal");
+ setTextFontWeight("bold");
}
setTimeout(() => { isSyncing.current = false; }, 0);
diff --git a/app/components/ui/editor/VideoCanvas.tsx b/app/components/ui/editor/VideoCanvas.tsx
index b0ed10b..9c79c7a 100644
--- a/app/components/ui/editor/VideoCanvas.tsx
+++ b/app/components/ui/editor/VideoCanvas.tsx
@@ -182,15 +182,23 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
}
}
- // Load new images
+ // Load new images with enhanced error handling
for (const element of canvasElements) {
if (element.type === "image") {
const imageElement = element as ImageElement;
if (!cache.has(imageElement.imagePath)) {
const img = new Image();
img.crossOrigin = "anonymous"; // Prevenir problemas de CORS al exportar
+
+ img.onload = () => {
+ cache.set(imageElement.imagePath, img);
+ };
+
+ img.onerror = () => {
+ console.error(`Failed to load canvas element image: ${imageElement.imagePath}`);
+ };
+
img.src = imageElement.imagePath;
- img.onload = () => cache.set(imageElement.imagePath, img);
}
}
}
@@ -336,7 +344,9 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
behindVideo ? el.zIndex < VIDEO_Z_INDEX : el.zIndex >= VIDEO_Z_INDEX
);
const sortedElements = [...filteredElements].sort((a, b) => a.zIndex - b.zIndex);
- const SVG_SCALE_FACTOR = 0.45;
+
+ // Use smaller dimension as reference for consistent scaling across different aspect ratios
+ const referenceSize = Math.min(canvasWidth, canvasHeight);
for (const element of sortedElements) {
if (element.type === "svg") {
@@ -360,9 +370,11 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
const elemX = (svgElement.x / 100) * canvasWidth;
const elemY = (svgElement.y / 100) * canvasHeight;
- const elemWidth = (svgElement.width / 100) * canvasWidth * SVG_SCALE_FACTOR;
- const elemHeight = (svgElement.height / 100) * canvasWidth * SVG_SCALE_FACTOR;
+ // Use reference size for both width and height to maintain square aspect ratio for SVGs
+ const elemWidth = (svgElement.width / 100) * referenceSize;
+ const elemHeight = (svgElement.height / 100) * referenceSize;
+ // Translate to element position, rotate, then draw centered
ctx.translate(elemX, elemY);
ctx.rotate((svgElement.rotation * Math.PI) / 180);
ctx.globalAlpha = svgElement.opacity;
@@ -384,8 +396,25 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
const elemX = (element.x / 100) * canvasWidth;
const elemY = (element.y / 100) * canvasHeight;
- const elemWidth = (element.width / 100) * canvasWidth;
- const elemHeight = (element.height / 100) * canvasWidth;
+
+ // Calculate element dimensions using reference size to maintain consistent scaling
+ const elemWidth = (element.width / 100) * referenceSize;
+ const elemHeight = (element.height / 100) * referenceSize;
+
+ // For images, maintain the original aspect ratio
+ const imgAspectRatio = img.naturalWidth / img.naturalHeight;
+ let finalWidth = elemWidth;
+ let finalHeight = elemHeight;
+
+ // Apply object-contain logic: scale to fit within element bounds while maintaining aspect ratio
+ const elementAspectRatio = elemWidth / elemHeight;
+ if (imgAspectRatio > elementAspectRatio) {
+ // Image is wider - fit to width
+ finalHeight = elemWidth / imgAspectRatio;
+ } else {
+ // Image is taller - fit to height
+ finalWidth = elemHeight * imgAspectRatio;
+ }
ctx.translate(elemX, elemY);
ctx.rotate((element.rotation * Math.PI) / 180);
@@ -393,10 +422,10 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
ctx.drawImage(
img,
- -elemWidth / 2,
- -elemHeight / 2,
- elemWidth,
- elemHeight
+ -finalWidth / 2,
+ -finalHeight / 2,
+ finalWidth,
+ finalHeight
);
ctx.restore();
@@ -410,7 +439,9 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
ctx.rotate((element.rotation * Math.PI) / 180);
ctx.globalAlpha = element.opacity;
- const scaledFontSize = element.fontSize * (canvasWidth / 1080);
+ // Scale font size proportionally to canvas size using reference dimension
+ // Base reference is 1080px (typical preview height)
+ const scaledFontSize = element.fontSize * (referenceSize / 1080);
const fontWeight = element.fontWeight === 'normal' ? '400' : element.fontWeight === 'medium' ? '500' : '700';
ctx.font = `${fontWeight} ${scaledFontSize}px ${element.fontFamily}`;
ctx.fillStyle = element.color;
@@ -427,11 +458,19 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(funct
// Función para dibujar un frame en el canvas de exportación
const drawFrame = async () => {
const canvas = exportCanvasRef.current;
- const ctx = canvas?.getContext('2d');
+ const ctx = canvas?.getContext('2d', {
+ alpha: true,
+ desynchronized: false,
+ willReadFrequently: false
+ });
const video = videoRef.current;
if (!canvas || !ctx || !video) return;
+ // Enable high-quality rendering
+ ctx.imageSmoothingEnabled = true;
+ ctx.imageSmoothingQuality = 'high';
+
const canvasWidth = canvas.width;
const canvasHeight = canvas.height;
diff --git a/app/globals.css b/app/globals.css
index 5009b75..c70e4b6 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -168,13 +168,15 @@
@theme {
--ease-elegant: cubic-bezier(0.16, 1, 0.3, 1);
- --gradient-radial-primary: radial-gradient(circle at center, #00A3FF 0%, #0057FF 100%);
+ --gradient-radial-primary: radial-gradient(circle at center, #00A3FF 0%, #0057FF 100%);
+
@keyframes reveal {
from {
opacity: 0;
transform: translateY(20px) scale(0.98);
filter: blur(8px);
}
+
to {
opacity: 1;
transform: translateY(0) scale(1);
@@ -244,4 +246,40 @@ button {
.squircle-element {
corner-shape: squircle;
border-radius: 20px;
+}
+.hero-perspective-container {
+ perspective: 1500px;
+}
+
+.hero-3d-wrapper {
+ transform-style: preserve-3d;
+ will-change: transform, filter;
+
+ animation: heroImageAppear 1ms linear, heroImageFadeIn 1s ease-out;
+ animation-timeline: scroll(root), auto;
+ animation-range: 0% 12%;
+}
+
+@keyframes heroImageAppear {
+ from {
+ transform: translateY(-12rem) translateZ(-30rem) rotateX(45deg);
+ filter: drop-shadow(0 0 0 rgba(0, 163, 255, 0)) drop-shadow(0 0 0 rgba(0, 55, 128, 0));
+ }
+ to {
+ transform: translateY(0rem) translateZ(0rem) rotateX(0deg);
+ filter: drop-shadow(0 8px 16px rgba(0, 163, 255, 0.3)) drop-shadow(0 24px 48px rgba(0, 55, 128, 0.3));
+ }
+}
+
+@keyframes heroImageFadeIn {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+.atropos-highlight {
+ border-radius: 1rem;
}
\ No newline at end of file
diff --git a/package.json b/package.json
index f1a07cf..4d1c241 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@supabase/ssr": "^0.9.0",
"@supabase/supabase-js": "^2.100.1",
+ "atropos": "^2.0.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"framer-motion": "^12.34.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index df5969a..8fcc3b5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -29,6 +29,9 @@ importers:
'@supabase/supabase-js':
specifier: ^2.100.1
version: 2.100.1
+ atropos:
+ specifier: ^2.0.2
+ version: 2.0.2
class-variance-authority:
specifier: ^0.7.1
version: 0.7.1
@@ -1810,6 +1813,10 @@ packages:
resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-8f0u0hEOlBTWTSvzY17TcHuQjxUIpkTBq70/I4+UF5B43ORtOoRjm8TPBYEgLM8Ba9AWf6PDtkagbYoybdjaKg==}
+ engines: {node: '>= 12.0.0'}
+
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
@@ -5635,6 +5642,8 @@ snapshots:
+
dependencies:
possible-typed-array-names: 1.1.0
diff --git a/public/images/pages/openvid.webp b/public/images/pages/openvid.webp
index 2b01a23..7fc0338 100644
Binary files a/public/images/pages/openvid.webp and b/public/images/pages/openvid.webp differ