🚀 Github Action 'build'

This commit is contained in:
ful1e5 2021-02-03 17:32:50 +05:30
parent e4aa2ccbee
commit f4e1a7377a
12 changed files with 37 additions and 39 deletions

View 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`;
};

View 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);