-
updateProps({ background: { color: e.target.value } })}
- className="w-10 h-10 rounded cursor-pointer bg-transparent"
- />
+
)}
diff --git a/src/store/canvasStore.ts b/src/store/canvasStore.ts
index 8f19c1b..4f0d063 100644
--- a/src/store/canvasStore.ts
+++ b/src/store/canvasStore.ts
@@ -64,6 +64,16 @@ const defaultSnap: Snap = {
type: 'gradient',
solid: { color: '#101022' },
gradient: { from: '#101022', to: '#1f1f3a', angle: 135 },
+ brandStrip: {
+ enabled: false,
+ position: 'bottom',
+ height: 60,
+ color: '#000000',
+ text: '',
+ textColor: '#ffffff',
+ fontSize: 16,
+ fontFamily: 'Inter',
+ },
},
elements: [],
};
diff --git a/src/types/index.ts b/src/types/index.ts
index 49d639d..6ba600c 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -10,10 +10,22 @@ export interface GradientBackground {
angle: number;
}
+export interface BrandStrip {
+ enabled: boolean;
+ position: 'top' | 'bottom';
+ height: number;
+ color: string;
+ text: string;
+ textColor: string;
+ fontSize: number;
+ fontFamily: string;
+}
+
export interface Background {
type: BackgroundType;
solid: SolidBackground;
gradient: GradientBackground;
+ brandStrip: BrandStrip;
}
export interface Shadow {
@@ -61,6 +73,9 @@ export interface ArrowProps {
color: string;
thickness: number;
head: 'filled' | 'outline' | 'none';
+ controlPoints?: { x: number; y: number }[]; // For curved arrows - bezier control points
+ label?: string; // Optional text label
+ labelPosition?: number; // 0-1, position along the arrow
}
export type ElementType = 'code' | 'text' | 'arrow';
@@ -180,6 +195,24 @@ export const LANGUAGES = [
] as const;
export const FONT_FAMILIES = {
- code: ['JetBrains Mono', 'Fira Code', 'Source Code Pro', 'monospace'],
- text: ['Inter', 'Roboto', 'Open Sans', 'sans-serif'],
+ code: ['JetBrains Mono', 'Fira Code', 'Source Code Pro', 'IBM Plex Mono', 'Cascadia Code', 'monospace'],
+ text: ['Inter', 'Roboto', 'Open Sans', 'Poppins', 'Montserrat', 'Lato', 'Nunito', 'Raleway', 'sans-serif'],
+ brand: ['Inter', 'Roboto', 'Poppins', 'Montserrat', 'sans-serif'],
};
+
+// Google Fonts URLs for custom fonts
+export const GOOGLE_FONTS = [
+ { name: 'Inter', url: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap' },
+ { name: 'Roboto', url: 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap' },
+ { name: 'Poppins', url: 'https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap' },
+ { name: 'Montserrat', url: 'https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap' },
+ { name: 'Lato', url: 'https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap' },
+ { name: 'Nunito', url: 'https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap' },
+ { name: 'Raleway', url: 'https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap' },
+ { name: 'Open Sans', url: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap' },
+ { name: 'JetBrains Mono', url: 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap' },
+ { name: 'Fira Code', url: 'https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&display=swap' },
+ { name: 'Source Code Pro', url: 'https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;700&display=swap' },
+ { name: 'IBM Plex Mono', url: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&display=swap' },
+ { name: 'Cascadia Code', url: 'https://fonts.googleapis.com/css2?family=Cascadia+Code&display=swap' },
+];
diff --git a/src/utils/fontLoader.ts b/src/utils/fontLoader.ts
new file mode 100644
index 0000000..36e71ec
--- /dev/null
+++ b/src/utils/fontLoader.ts
@@ -0,0 +1,28 @@
+import { GOOGLE_FONTS } from '../types';
+
+// Track loaded fonts to avoid duplicate loading
+const loadedFonts = new Set
();
+
+export const loadFont = (fontName: string) => {
+ if (loadedFonts.has(fontName)) return;
+
+ const fontConfig = GOOGLE_FONTS.find(f => f.name === fontName);
+ if (!fontConfig) return;
+
+ // Check if link already exists
+ const existingLink = document.querySelector(`link[href="${fontConfig.url}"]`);
+ if (existingLink) {
+ loadedFonts.add(fontName);
+ return;
+ }
+
+ const link = document.createElement('link');
+ link.href = fontConfig.url;
+ link.rel = 'stylesheet';
+ document.head.appendChild(link);
+ loadedFonts.add(fontName);
+};
+
+export const loadAllFonts = () => {
+ GOOGLE_FONTS.forEach(font => loadFont(font.name));
+};