mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-29 06:25:19 -04:00
🚀 Github Action 'build'
This commit is contained in:
parent
e4aa2ccbee
commit
f4e1a7377a
12 changed files with 37 additions and 39 deletions
18
bitmapper/src/utils/getFrameName.ts
Normal file
18
bitmapper/src/utils/getFrameName.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import path from "path";
|
||||
|
||||
export const frameNumber = (index: number, endIndex: number) => {
|
||||
let result = "" + index;
|
||||
while (result.length < endIndex) {
|
||||
result = "0" + result;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getFrameName = (
|
||||
index: number,
|
||||
fileName: string,
|
||||
padding: number = 2
|
||||
) => {
|
||||
const frame = frameNumber(index, padding);
|
||||
return `${path.basename(fileName, ".svg")}-${frame}.png`;
|
||||
};
|
19
bitmapper/src/utils/toHTML.ts
Normal file
19
bitmapper/src/utils/toHTML.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
export const template = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Render Template</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<svginjection>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
export const toHTML = (svgData: string): string =>
|
||||
template.replace("<svginjection>", svgData);
|
Loading…
Add table
Add a link
Reference in a new issue