Create professional demos and 3D mockups in seconds, directly in your browser
feat: add ElementsIcon component and replace SVG icons in editor menus
CristianOlivera1024f3e10e58c
diff --git a/app/components/ui/WalpaperSections.tsx b/app/components/ui/WallpaperSections.tsxsimilarity index 100%rename from app/components/ui/WalpaperSections.tsxrename to app/components/ui/WallpaperSections.tsxdiff --git a/app/components/ui/editor/ElementsMenu.tsx b/app/components/ui/editor/ElementsMenu.tsxindex 29a2825..f41c39f 100644--- a/app/components/ui/editor/ElementsMenu.tsx+++ b/app/components/ui/editor/ElementsMenu.tsx@@ -12,6 +12,7 @@ import { Button } from "@/components/ui/button";import { SVG_COMPONENTS } from "@/components/canvas-svg";import { TooltipAction } from "@/components/ui/tooltip-action";import { ProgressiveImg } from "@/components/ui/ProgressiveImg";+import { ElementsIcon } from "@/components/ui/ElementsIcon";interface ExtendedElementsMenuProps extends ElementsMenuProps {textTabTrigger?: number;@@ -218,10 +219,12 @@ export function ElementsMenu({<div className="p-4 flex flex-col gap-5"><div className="flex items-center gap-2 text-white font-medium">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className="transition-colors duration-200" aria-hidden="true">- <path d="M11 13.5V21.5H3V13.5H11ZM9 15.5H5V19.5H9V15.5ZM12 2L17.5 11H6.5L12 2ZM12 5.86L10.08 9H13.92L12 5.86Z" fill="currentColor" stroke="currentColor" strokeWidth="0.2" />- <path fillRule="evenodd" clipRule="evenodd" d="M13.7667 13.8246C13.7667 13.6323 13.8431 13.4479 13.9791 13.312C14.115 13.176 14.2994 13.0996 14.4917 13.0996H20.2917C20.484 13.0996 20.6684 13.176 20.8044 13.312C20.9403 13.4479 21.0167 13.6323 21.0167 13.8246V14.7913C21.0167 14.9836 20.9403 15.168 20.8044 15.3039C20.6684 15.4399 20.484 15.5163 20.2917 15.5163C20.0994 15.5163 19.915 15.4399 19.7791 15.3039C19.6431 15.168 19.5667 14.9836 19.5667 14.7913V14.5496H18.1167V20.3496H18.3584C18.5507 20.3496 18.7351 20.426 18.871 20.562C19.007 20.6979 19.0834 20.8823 19.0834 21.0746C19.0834 21.2669 19.007 21.4513 18.871 21.5873C18.7351 21.7232 18.5507 21.7996 18.3584 21.7996H16.4251C16.2328 21.7996 16.0484 21.7232 15.9124 21.5873C15.7764 21.4513 15.7001 21.2669 15.7001 21.0746C15.7001 20.8823 15.7764 20.6979 15.9124 20.562C16.0484 20.426 16.2328 20.3496 16.4251 20.3496H16.6667V14.5496H15.2167V14.7913C15.2167 14.9836 15.1403 15.168 15.0044 15.3039C14.8684 15.4399 14.684 15.5163 14.4917 15.5163C14.2994 15.5163 14.115 15.4399 13.9791 15.3039C13.8431 15.168 13.7667 14.9836 13.7667 14.7913V13.8246Z" fill="currentColor" stroke="currentColor" strokeWidth="0.5" />- </svg>+ <ElementsIcon+ width={20}+ height={20}+ className="transition-colors duration-200"+ aria-hidden="true"+ /><span>{t("title")}</span></div>diff --git a/app/components/ui/editor/MobileToolsMenu.tsx b/app/components/ui/editor/MobileToolsMenu.tsxindex 5e09cc4..1f0caf2 100644--- a/app/components/ui/editor/MobileToolsMenu.tsx+++ b/app/components/ui/editor/MobileToolsMenu.tsx@@ -5,6 +5,7 @@ import { Icon } from "@iconify/react";import * as Dialog from "@radix-ui/react-dialog";import { useTranslations } from "next-intl";import type { Tool } from "@/types";+import { ElementsIcon } from "@/components/ui/ElementsIcon";interface ToolButtonProps {label: string;@@ -24,13 +25,13 @@ const ToolButton = ({ label, icon, isActive, onClick, ariaLabel }: ToolButtonProstyle={isActive? {- background: "radial-gradient(circle at 50% 0%, #555555 0%, #454545 64%)",- boxShadow: "inset 0 1.01rem 0.2rem -1rem #fff, 0 0 0 1px #fff4, 0 4px 4px 0 #0004, 0 0 0 1px #333",- }+ background: "radial-gradient(circle at 50% 0%, #555555 0%, #454545 64%)",+ boxShadow: "inset 0 1.01rem 0.2rem -1rem #fff, 0 0 0 1px #fff4, 0 4px 4px 0 #0004, 0 0 0 1px #333",+ }: {- background: "rgba(255, 255, 255, 0.05)",- border: "1px solid rgba(255, 255, 255, 0.1)",- }+ background: "rgba(255, 255, 255, 0.05)",+ border: "1px solid rgba(255, 255, 255, 0.1)",+ }}><div className={`transition-transform duration-300 ${isActive ? "scale-110" : "group-hover:scale-105"}`}>@@ -149,10 +150,11 @@ export function MobileToolsMenu({isActive={activeTool === "elements"}onClick={() => handleToolChange("elements")}icon={- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" className={activeTool === "elements" ? "text-white" : "text-white/70"}>- <path d="M11 13.5V21.5H3V13.5H11ZM9 15.5H5V19.5H9V15.5ZM12 2L17.5 11H6.5L12 2ZM12 5.86L10.08 9H13.92L12 5.86Z" fill="currentColor" stroke="currentColor" strokeWidth="0.2" />- <path fillRule="evenodd" clipRule="evenodd" d="M13.7667 13.8246C13.7667 13.6323 13.8431 13.4479 13.9791 13.312C14.115 13.176 14.2994 13.0996 14.4917 13.0996H20.2917C20.484 13.0996 20.6684 13.176 20.8044 13.312C20.9403 13.4479 21.0167 13.6323 21.0167 13.8246V14.7913C21.0167 14.9836 20.9403 15.168 20.8044 15.3039C20.6684 15.4399 20.484 15.5163 20.2917 15.5163C20.0994 15.5163 19.915 15.4399 19.7791 15.3039C19.6431 15.168 19.5667 14.9836 19.5667 14.7913V14.5496H18.1167V20.3496H18.3584C18.5507 20.3496 18.7351 20.426 18.871 20.562C19.007 20.6979 19.0834 20.8823 19.0834 21.0746C19.0834 21.2669 19.007 21.4513 18.871 21.5873C18.7351 21.7232 18.5507 21.7996 18.3584 21.7996H16.4251C16.2328 21.7996 16.0484 21.7232 15.9124 21.5873C15.7764 21.4513 15.7001 21.2669 15.7001 21.0746C15.7001 20.8823 15.7764 20.6979 15.9124 20.562C16.0484 20.426 16.2328 20.3496 16.4251 20.3496H16.6667V14.5496H15.2167V14.7913C15.2167 14.9836 15.1403 15.168 15.0044 15.3039C14.8684 15.4399 14.684 15.5163 14.4917 15.5163C14.2994 15.5163 14.115 15.4399 13.9791 15.3039C13.8431 15.168 13.7667 14.9836 13.7667 14.7913V13.8246Z" fill="currentColor" stroke="currentColor" strokeWidth="0.5" />- </svg>+ <ElementsIcon+ width={24}+ height={24}+ className={activeTool === "elements" ? "text-white" : "text-white/70"}+ />}/>@@ -164,9 +166,8 @@ export function MobileToolsMenu({/><label- className={`flex items-center justify-center p-4 squircle-element transition-all duration-200 group relative flex-col gap-1 active:scale-95 cursor-pointer ${- isUploading ? "opacity-50 cursor-not-allowed" : ""- }`}+ className={`flex items-center justify-center p-4 squircle-element transition-all duration-200 group relative flex-col gap-1 active:scale-95 cursor-pointer ${isUploading ? "opacity-50 cursor-not-allowed" : ""+ }`}style={{background: "rgba(255, 255, 255, 0.05)",border: "1px solid rgba(255, 255, 255, 0.1)",diff --git a/app/components/ui/editor/ToolsSidebar.tsx b/app/components/ui/editor/ToolsSidebar.tsxindex c965e2b..06cdec2 100644--- a/app/components/ui/editor/ToolsSidebar.tsx+++ b/app/components/ui/editor/ToolsSidebar.tsx@@ -9,6 +9,7 @@ import { useTranslations } from "next-intl";import { TooltipAction } from "@/components/ui/tooltip-action";import { useRecording } from "@/app/contexts/RecordingContext";import RecordingSetupDialog from "../RecordingSetupDialog";+import { ElementsIcon } from "@/components/ui/ElementsIcon";interface ExtendedToolsSidebarProps extends ToolsSidebarProps {onVideoUpload?: (file: File) => void;@@ -310,13 +311,14 @@ export function ToolsSidebar({popover={{title: t("popovers.elements.title"),description: t("popovers.elements.description"),- videoSrc: "/videos/preview-menu/elements.mp4"+ videoSrc: "/videos/preview-menu/elements.mp4",}}icon={- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className="transition-colors duration-200">- <path d="M11 13.5V21.5H3V13.5H11ZM9 15.5H5V19.5H9V15.5ZM12 2L17.5 11H6.5L12 2ZM12 5.86L10.08 9H13.92L12 5.86Z" fill="currentColor" stroke="currentColor" strokeWidth="0.2" />- <path fillRule="evenodd" clipRule="evenodd" d="M13.7667 13.8246C13.7667 13.6323 13.8431 13.4479 13.9791 13.312C14.115 13.176 14.2994 13.0996 14.4917 13.0996H20.2917C20.484 13.0996 20.6684 13.176 20.8044 13.312C20.9403 13.4479 21.0167 13.6323 21.0167 13.8246V14.7913C21.0167 14.9836 20.9403 15.168 20.8044 15.3039C20.6684 15.4399 20.484 15.5163 20.2917 15.5163C20.0994 15.5163 19.915 15.4399 19.7791 15.3039C19.6431 15.168 19.5667 14.9836 19.5667 14.7913V14.5496H18.1167V20.3496H18.3584C18.5507 20.3496 18.7351 20.426 18.871 20.562C19.007 20.6979 19.0834 20.8823 19.0834 21.0746C19.0834 21.2669 19.007 21.4513 18.871 21.5873C18.7351 21.7232 18.5507 21.7996 18.3584 21.7996H16.4251C16.2328 21.7996 16.0484 21.7232 15.9124 21.5873C15.7764 21.4513 15.7001 21.2669 15.7001 21.0746C15.7001 20.8823 15.7764 20.6979 15.9124 20.562C16.0484 20.426 16.2328 20.3496 16.4251 20.3496H16.6667V14.5496H15.2167V14.7913C15.2167 14.9836 15.1403 15.168 15.0044 15.3039C14.8684 15.4399 14.684 15.5163 14.4917 15.5163C14.2994 15.5163 14.115 15.4399 13.9791 15.3039C13.8431 15.168 13.7667 14.9836 13.7667 14.7913V13.8246Z" fill="currentColor" stroke="currentColor" strokeWidth="0.5" />- </svg>+ <ElementsIcon+ width={24}+ height={24}+ className="transition-colors duration-200"+ />}/>diff --git a/app/components/ui/home/RecordingSteps.tsx b/app/components/ui/home/RecordingSteps.tsxindex 6fc9588..8ffb996 100644--- a/app/components/ui/home/RecordingSteps.tsx+++ b/app/components/ui/home/RecordingSteps.tsx@@ -28,7 +28,6 @@ export default function InteractiveRecordingSteps() {if (isCountdown) {return (<>- {/* Optimización: transform-gpu añadido al spinner */}<div className="w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin transform-gpu mr-2" />{t('step1.countdownButton')}</>@@ -37,7 +36,6 @@ export default function InteractiveRecordingSteps() {if (isRecording) {return (<>- {/* Optimización: transform-gpu añadido al pulse */}<div className="w-3 h-3 rounded-full bg-red-500 animate-pulse transform-gpu mr-2" />{t('step1.recordingButton')}</>@@ -188,7 +186,6 @@ export default function InteractiveRecordingSteps() {<div className="aspect-video bg-[#0A0A0A] border border-white/10 squircle-element-camera overflow-hidden flex items-center justify-center relative group shadow-xl p-4 transform-gpu isolate"><div className="absolute inset-0 bg-[radial-linear(#ffffff22_1px,transparent_1px)] [bg-size:16px_16px] opacity-10 pointer-events-none"></div>- {/* Optimización: Gradiente radial en lugar de blur-3xl */}<div className="absolute top-0 left-1/2 -translate-x-1/2 w-75 h-37.5 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-blue-500/20 via-blue-500/0 to-transparent pointer-events-none"></div><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-xl z-10 w-full sm:w-auto max-w-[90%] sm:max-w-none text-center sm:text-left transform-gpu">@@ -227,11 +224,9 @@ export default function InteractiveRecordingSteps() {actionButton: null,visual: (<div className="aspect-video bg-[#000B13] border border-white/10 squircle-element-camera overflow-hidden relative group shadow-xl transform-gpu isolate">- {/* Optimización: Opacidad 98% en lugar de backdrop-blur-md (Mismo efecto visual, cero pérdida de rendimiento) */}<div className="absolute inset-0 bg-[#000B13]/98 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-20 h-20 sm:w-32 sm:h-32 flex items-center justify-center shrink-0">- {/* Optimización: transform-gpu para la animación pulse */}<div className="absolute inset-0 rounded-full bg-[#00A3FF]/20 animate-pulse transform-gpu" /><div className="absolute inset-2 sm:inset-4 rounded-full bg-[#00A3FF]/10" /><div className="relative w-16 h-16 sm:w-28 sm:h-28 rounded-full bg-gradient-to-br from-[#00A3FF] to-blue-800 p-0.5 shadow-lg">@@ -292,7 +287,6 @@ export default function InteractiveRecordingSteps() {<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 squircle-element-camera sm:rounded-full py-3 sm:pl-5 sm:pr-2 sm:py-2 shadow-xl mx-auto max-w-[200px] sm:max-w-none transform-gpu"><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">- {/* Optimización: transform-gpu para el pulse de grabación */}<div className="w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-full bg-red-500 animate-pulse transform-gpu" /><span className="text-[11px] sm:text-[11px] text-white font-medium">{t('step4.visual.recording')}</span><span className="text-[11px] sm:text-[11px] text-red-400 font-mono font-bold">diff --git a/components/ui/ElementsIcon.tsx b/components/ui/ElementsIcon.tsxnew file mode 100644index 0000000..fec7d07--- /dev/null+++ b/components/ui/ElementsIcon.tsx@@ -0,0 +1,41 @@+import React from "react";++interface ElementsIconProps extends React.SVGProps<SVGSVGElement> {+ className?: string;+ width?: number | string;+ height?: number | string;+}++export function ElementsIcon({+ className,+ width = 18,+ height = 18,+ ...props+}: ElementsIconProps) {+ return (+ <svg+ width={width}+ height={height}+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ className={className}+ {...props}+ >+ <path+ d="M11 13.5V21.5H3V13.5H11ZM9 15.5H5V19.5H9V15.5ZM12 2L17.5 11H6.5L12 2ZM12 5.86L10.08 9H13.92L12 5.86Z"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="0.2"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M13.7667 13.8246C13.7667 13.6323 13.8431 13.4479 13.9791 13.312C14.115 13.176 14.2994 13.0996 14.4917 13.0996H20.2917C20.484 13.0996 20.6684 13.176 20.8044 13.312C20.9403 13.4479 21.0167 13.6323 21.0167 13.8246V14.7913C21.0167 14.9836 20.9403 15.168 20.8044 15.3039C20.6684 15.4399 20.484 15.5163 20.2917 15.5163C20.0994 15.5163 19.915 15.4399 19.7791 15.3039C19.6431 15.168 19.5667 14.9836 19.5667 14.7913V14.5496H18.1167V20.3496H18.3584C18.5507 20.3496 18.7351 20.426 18.871 20.562C19.007 20.6979 19.0834 20.8823 19.0834 21.0746C19.0834 21.2669 19.007 21.4513 18.871 21.5873C18.7351 21.7232 18.5507 21.7996 18.3584 21.7996H16.4251C16.2328 21.7996 16.0484 21.7232 15.9124 21.5873C15.7764 21.4513 15.7001 21.2669 15.7001 21.0746C15.7001 20.8823 15.7764 20.6979 15.9124 20.562C16.0484 20.426 16.2328 20.3496 16.4251 20.3496H16.6667V14.5496H15.2167V14.7913C15.2167 14.9836 15.1403 15.168 15.0044 15.3039C14.8684 15.4399 14.684 15.5163 14.4917 15.5163C14.2994 15.5163 14.115 15.4399 13.9791 15.3039C13.8431 15.168 13.7667 14.9836 13.7667 14.7913V13.8246Z"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="0.5"+ />+ </svg>+ );+}\ No newline at end of file