mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2024-10-18 05:20:38 -04:00
💾 semi-animated cursors frames setting
This commit is contained in:
parent
8397de3716
commit
0ce972356c
1 changed files with 7 additions and 1 deletions
|
@ -12,6 +12,8 @@ import { getFrameName } from "./utils/getFrameName";
|
|||
import { generateRenderTemplate } from "./utils/htmlTemplate";
|
||||
import { matchImages } from "./utils/matchImages";
|
||||
|
||||
const normalAnimatedCursors: string[] = ["left_ptr_watch", "wait"];
|
||||
|
||||
export class BitmapsGenerator {
|
||||
private readonly staticCurs: Cursors;
|
||||
private readonly animatedCurs: Cursors;
|
||||
|
@ -138,6 +140,8 @@ export class BitmapsGenerator {
|
|||
|
||||
// Pushing frames until it match to 1st frame
|
||||
index++;
|
||||
|
||||
// Minimum frames no. = 5
|
||||
while (!breakRendering) {
|
||||
const key = getFrameName(index, cursor);
|
||||
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
||||
|
@ -152,7 +156,9 @@ export class BitmapsGenerator {
|
|||
img2Buff: newFrame
|
||||
});
|
||||
|
||||
if (matched && index > this.minimumFrames) {
|
||||
if (matched && !normalAnimatedCursors.includes(cursor) && index > 5) {
|
||||
breakRendering = true;
|
||||
} else if (matched && index > this.minimumFrames) {
|
||||
breakRendering = true;
|
||||
} else {
|
||||
frames[key] = { buffer: newFrame };
|
||||
|
|
Loading…
Reference in a new issue