mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-17 16:44:59 -04:00
🧹 cleanup
This commit is contained in:
parent
cce5a2ed84
commit
2a8de5b4f6
1 changed files with 6 additions and 7 deletions
13
src/index.ts
13
src/index.ts
|
@ -2,9 +2,10 @@ import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
||||||
// import { renderSvg } from "./helpers/render";
|
|
||||||
import { staticSvgs, bitmapsDir } from "./config";
|
import { staticSvgs, bitmapsDir } from "./config";
|
||||||
|
|
||||||
|
import { renderSvg } from "./helpers/render";
|
||||||
|
|
||||||
const generateStaticSvgBitmaps = async (svg: string) => {
|
const generateStaticSvgBitmaps = async (svg: string) => {
|
||||||
fs.readFile(svg, "utf8", (error, data) => {
|
fs.readFile(svg, "utf8", (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -12,13 +13,11 @@ const generateStaticSvgBitmaps = async (svg: string) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generating HTML Template
|
// Generating HTML Template
|
||||||
generateRenderTemplate(data);
|
const template = generateRenderTemplate(data);
|
||||||
|
|
||||||
// preparing paths
|
// rendering with frames=1 beacause of static
|
||||||
let bitmap = path.parse(svg).base;
|
const bitmap = `${path.basename(svg, ".svg")}.png`;
|
||||||
bitmap = path.resolve(bitmapsDir, bitmap);
|
renderSvg(template, 1, bitmap, bitmapsDir);
|
||||||
|
|
||||||
console.log(bitmap);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue