mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
feat(preview-comment): add symmetry preview (#3823)
This commit is contained in:
@@ -52,7 +52,8 @@ const getImageTagsByFiles = (
|
||||
const svgFiles = await readSvgDirectory(ICONS_DIR);
|
||||
const svgFilePaths = svgFiles.map((file) => `icons/${file}`);
|
||||
|
||||
const iconsFilteredByName = (search: string) => svgFilePaths.filter((file) => file.includes(search));
|
||||
const iconsFilteredByName = (search: string) =>
|
||||
svgFilePaths.filter((file) => file.includes(search));
|
||||
|
||||
const cohesionRandomImageTags = getImageTagsByFiles(
|
||||
shuffleArray(svgFilePaths).slice(0, changedFiles.length),
|
||||
@@ -120,6 +121,30 @@ const changeFilesDiffImageTags = getImageTagsByFiles(
|
||||
400,
|
||||
).join(' ');
|
||||
|
||||
const changeFilesSymmetryImageTagsRotate180 = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/symmetry/rotate-180`,
|
||||
400,
|
||||
).join(' ');
|
||||
|
||||
const changeFilesSymmetryImageTagsFlipHorizontal = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/symmetry/flip-horizontal`,
|
||||
400,
|
||||
).join(' ');
|
||||
|
||||
const changeFilesSymmetryImageTagsFlipVertical = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/symmetry/flip-vertical`,
|
||||
400,
|
||||
).join(' ');
|
||||
|
||||
const changeFilesSymmetryImageTagsFlipSlash = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/symmetry/flip-slash`,
|
||||
400,
|
||||
).join(' ');
|
||||
|
||||
const readyToUseCode = changedFiles
|
||||
.map((changedFile) => {
|
||||
const svgContent = fs.readFileSync(path.join(process.cwd(), changedFile), 'utf-8');
|
||||
@@ -179,6 +204,17 @@ ${changeFilesXRayImageTags}
|
||||
${changeFilesDiffImageTags}
|
||||
</details>
|
||||
<details>
|
||||
<summary>Icon Symmetry</summary>
|
||||
<h4>Flip Horizontal</h4>
|
||||
${changeFilesSymmetryImageTagsFlipHorizontal}
|
||||
<h4>Flip Vertical</h4>
|
||||
${changeFilesSymmetryImageTagsFlipVertical}
|
||||
<h4>Flip Diagonal</h4>
|
||||
${changeFilesSymmetryImageTagsFlipSlash}
|
||||
<h4>Rotate 180°</h4>
|
||||
${changeFilesSymmetryImageTagsRotate180}
|
||||
</details>
|
||||
<details>
|
||||
<summary>Icons as code</summary>
|
||||
|
||||
Works for: \`lucide-react\`, \`lucide-react-native\`, \`lucide-preact\`, \`lucide-vue-next\`
|
||||
|
||||
Reference in New Issue
Block a user