mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-23 11:37:04 -04:00
💖
This commit is contained in:
parent
561fdbca19
commit
f3f3778ab2
1 changed files with 3 additions and 13 deletions
16
src/index.ts
16
src/index.ts
|
@ -2,7 +2,8 @@ import fs from "fs";
|
|||
import path from "path";
|
||||
import puppeteer from "puppeteer";
|
||||
|
||||
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
||||
import { generateRenderTemplate } from "./utils/htmlTemplate";
|
||||
import { getFrameNumber } from "./utils/getFrameNumber";
|
||||
import {
|
||||
staticCursors,
|
||||
bitmapsDir,
|
||||
|
@ -11,17 +12,6 @@ import {
|
|||
animatedClip,
|
||||
} from "./config";
|
||||
|
||||
// --------------------------- Helpers
|
||||
const frameNumber = (number: number, length: number) => {
|
||||
var str = "" + number;
|
||||
while (str.length < length) {
|
||||
str = "0" + str;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
// --------------------------- Main
|
||||
|
||||
const main = async () => {
|
||||
const browser = await puppeteer.launch({
|
||||
ignoreDefaultArgs: [" --single-process ", "--no-sandbox"],
|
||||
|
@ -80,7 +70,7 @@ const main = async () => {
|
|||
// Render Frames
|
||||
for (let index = 1; index <= frames; index++) {
|
||||
// config
|
||||
const frame = frameNumber(index, frames.toString().length);
|
||||
const frame = getFrameNumber(index, frames.toString().length);
|
||||
const bitmap =
|
||||
frames == 1
|
||||
? `${path.basename(svg, ".svg")}.png`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue