diff --git a/client/public/logos/facebook.svg b/client/public/logos/facebook.svg new file mode 100644 index 0000000..67b0879 Binary files /dev/null and b/client/public/logos/facebook.svg differ diff --git a/client/public/logos/instagram.svg b/client/public/logos/instagram.svg new file mode 100644 index 0000000..2f6065c Binary files /dev/null and b/client/public/logos/instagram.svg differ diff --git a/client/public/logos/linkedin.svg b/client/public/logos/linkedin.svg new file mode 100644 index 0000000..6a3da15 Binary files /dev/null and b/client/public/logos/linkedin.svg differ diff --git a/client/public/logos/x.svg b/client/public/logos/x.svg new file mode 100644 index 0000000..35c2ffd Binary files /dev/null and b/client/public/logos/x.svg differ diff --git a/client/public/logos/youtube.svg b/client/public/logos/youtube.svg new file mode 100644 index 0000000..2a52646 Binary files /dev/null and b/client/public/logos/youtube.svg differ diff --git a/client/src/app/dashboard/page.tsx b/client/src/app/dashboard/page.tsx index 89a3144..a74ccc0 100644 --- a/client/src/app/dashboard/page.tsx +++ b/client/src/app/dashboard/page.tsx @@ -286,7 +286,7 @@ export default function DashboardPage() {
- Edit Link + Edit QR Code {/* Move Folder Dropdown Toggle */} diff --git a/client/src/components/qr-editor/DesignPanel.tsx b/client/src/components/qr-editor/DesignPanel.tsx index dc7e00c..ab4d219 100644 --- a/client/src/components/qr-editor/DesignPanel.tsx +++ b/client/src/components/qr-editor/DesignPanel.tsx @@ -9,13 +9,34 @@ interface DesignPanelProps { export default function DesignPanel({ options, onChange }: DesignPanelProps) { - const handleColorChange = (e: React.ChangeEvent) => { + const [dotColorMode, setDotColorMode] = React.useState<'solid' | 'gradient'>( + options.dotsOptions?.gradient ? 'gradient' : 'solid' + ); + + const handleDotColorChange = (e: React.ChangeEvent) => { const newColor = e.target.value; onChange({ ...options, - dotsOptions: { ...options.dotsOptions, color: newColor }, - cornersSquareOptions: { ...options.cornersSquareOptions, color: newColor }, - cornersDotOptions: { ...options.cornersDotOptions, color: newColor } + dotsOptions: { ...options.dotsOptions, color: newColor, gradient: undefined }, + cornersSquareOptions: { ...options.cornersSquareOptions, color: newColor, gradient: undefined }, + cornersDotOptions: { ...options.cornersDotOptions, color: newColor, gradient: undefined } + }); + }; + + const handleDotGradientChange = (color1: string, color2: string) => { + const gradient: any = { + type: 'linear', + rotation: Math.PI / 4, + colorStops: [ + { offset: 0, color: color1 }, + { offset: 1, color: color2 } + ] + }; + onChange({ + ...options, + dotsOptions: { ...options.dotsOptions, gradient, color: undefined }, + cornersSquareOptions: { ...options.cornersSquareOptions, gradient, color: undefined }, + cornersDotOptions: { ...options.cornersDotOptions, gradient, color: undefined } }); }; @@ -32,6 +53,13 @@ export default function DesignPanel({ options, onChange }: DesignPanelProps) { cornersSquareOptions: { ...options.cornersSquareOptions, type: e.target.value as any } }); }; + + const handleInnerEyeTypeChange = (e: React.ChangeEvent) => { + onChange({ + ...options, + cornersDotOptions: { ...options.cornersDotOptions, type: e.target.value as any } + }); + }; const handleLogoUpload = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; @@ -48,6 +76,13 @@ export default function DesignPanel({ options, onChange }: DesignPanelProps) { reader.readAsDataURL(file); }; + const setPresetLogo = (path: string) => { + onChange({ + ...options, + image: path + }); + }; + const removeLogo = () => { onChange({ ...options, @@ -55,74 +90,152 @@ export default function DesignPanel({ options, onChange }: DesignPanelProps) { }); }; + // Helper to extract colors from gradient + const getGradientColors = () => { + if (options.dotsOptions?.gradient?.colorStops && options.dotsOptions.gradient.colorStops.length >= 2) { + return [ + options.dotsOptions.gradient.colorStops[0].color, + options.dotsOptions.gradient.colorStops[1].color + ]; + } + return ['#4f46e5', '#ec4899']; + }; + const [c1, c2] = getGradientColors(); + return (

Design Customization

{/* Colors */}
- -
- - {options.dotsOptions?.color} + + +
+ + +
+ + {dotColorMode === 'solid' ? ( +
+ + {options.dotsOptions?.color || '#000000'} +
+ ) : ( +
+
+ Color 1 + handleDotGradientChange(e.target.value, c2)} className="w-8 h-8 rounded cursor-pointer" /> +
+ +
+ Color 2 + handleDotGradientChange(c1, e.target.value)} className="w-8 h-8 rounded cursor-pointer" /> +
+
+ )} +
+ + {/* Shapes */} +
+
+ + +
+ +
+ + +
+ +
+ +
{/* Logo */} -
- +
+ + +
+ + + + + +
+
{options.image && ( )}
- - {/* Shapes */} -
- - -
- -
- - -
);