Files
klz-cables.com/scripts/convert-logo.cjs
Marc Mintel 0f8a92693e
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
fix: correctly map exact logo vectors from public/logo-white.svg with correct viewBox
- Previously, the logo was cropped because of an incorrect viewBox (100x100 instead of 295x99)

- Mapped all vector paths perfectly to ensure exact branding parity
2026-06-09 15:54:04 +02:00

35 lines
857 B
JavaScript

const fs = require('fs');
const svgContent = fs.readFileSync('public/logo-white.svg', 'utf8');
const pathRegex = /<path d="([^"]+)"/g;
let paths = [];
let match;
while ((match = pathRegex.exec(svgContent)) !== null) {
paths.push(match[1]);
}
const componentCode = `import React from 'react';
import { Svg, G, Path } from '@react-pdf/renderer';
interface KLZLogoVectorProps {
width?: number;
color?: string;
}
export const KLZLogoVector: React.FC<KLZLogoVectorProps> = ({ width = 140, color = '#ffffff' }) => {
const height = width * (99 / 295);
return (
<Svg viewBox="0 0 295 99" style={{ width, height }}>
<G>
${paths.map(d => ` <Path d="${d}" fill={color} />`).join('\n')}
</G>
</Svg>
);
};
`;
fs.writeFileSync('lib/KLZLogoVector.tsx', componentCode);
console.log('Successfully wrote lib/KLZLogoVector.tsx');