const fs = require('fs'); const path = require('path'); // Exakte Maße in Pixeln für 300 DPI (2 5/16" x 3 9/16" -> 2.3125" x 3.5625") const width = 694; const height = 1069; const colors = { Rot: '#E53935', // Trumpf (R) Gelb: '#FDD835', // Gelb (G) Gruen: '#43A047', // Grün (GR) Schwarz: '#212121' // Schwarz (S) }; // Zielordner anlegen const outputDir = path.join(__dirname, 'karten_export_v2'); if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir); } // Schleife durch Farben und Zahlen for (const [colorName, hex] of Object.entries(colors)) { const shortColor = colorName === 'Rot' ? 'R' : colorName === 'Gelb' ? 'G' : colorName === 'Gruen' ? 'GR' : 'S'; for (let num = 1; num <= 20; num++) { // Offizieller Kartencode als Seriennummer anstelle des irritierenden Binärcodes const cardCode = `TK-${shortColor}${num}`; // Dynamische Generierung der vollkommen rotationssymmetrischen Symbole für die Mitte let centerIcons = ''; if (colorName === 'Rot') { // Symmetrisches Kronen-Paar für Trumpf centerIcons = ` `; } else if (colorName === 'Gruen') { // Symmetrisches Pflanzen/Blatt-Paar für Grün centerIcons = ` `; } else if (colorName === 'Gelb') { // Symmetrisches Sonnen/Sternen-Paar für Gelb const sunRay = ``; const singleSun = ` ${sunRay} ${sunRay} ${sunRay} ${sunRay} ${sunRay} ${sunRay} ${sunRay} ${sunRay} `; centerIcons = ` ${singleSun} ${singleSun} `; } else if (colorName === 'Schwarz') { // Symmetrisches Admin/IT-Zahnrad-Paar für Schwarz const singleGear = ` `; centerIcons = ` ${singleGear} ${singleGear} `; } const svgContent = ` ${num} ${cardCode} ${num} ${cardCode} ${num} ${cardCode} ${num} ${cardCode} ${num} ${centerIcons} ${num} `; // SVG Datei speichern const fileName = `${colorName}_${String(num).padStart(2, '0')}.svg`; fs.writeFileSync(path.join(outputDir, fileName), svgContent); } } console.log('Erfolgreich! 80 vollkommen rotationssymmetrische SVG-Karten wurden im Ordner "karten_export_v2" generiert.');