mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-17 08:35:03 -04:00
🎥 Clip path rendering for Animated cursors
This commit is contained in:
parent
dc8f9aa69c
commit
fefc743998
2 changed files with 14 additions and 4 deletions
14
src/index.ts
14
src/index.ts
|
@ -3,7 +3,13 @@ import path from "path";
|
|||
import puppeteer from "puppeteer";
|
||||
|
||||
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
||||
import { staticSvgs, bitmapsDir, svgsDir, animatedCursors } from "./config";
|
||||
import {
|
||||
staticSvgs,
|
||||
bitmapsDir,
|
||||
svgsDir,
|
||||
animatedCursors,
|
||||
animatedClip,
|
||||
} from "./config";
|
||||
|
||||
// --------------------------- Helpers
|
||||
const frameNumber = (number: number, length: number) => {
|
||||
|
@ -86,7 +92,11 @@ const frameNumber = (number: number, length: number) => {
|
|||
const out = path.resolve(bitmapsDir, bitmap);
|
||||
|
||||
// Render
|
||||
await svgElement.screenshot({ omitBackground: true, path: out });
|
||||
await svgElement.screenshot({
|
||||
omitBackground: true,
|
||||
path: out,
|
||||
clip: animatedClip,
|
||||
});
|
||||
// console.log(`${svg} frame ${frame}/${frames} rendered at ${out}`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue