Skip to content

Commit d049264

Browse files
committed
dashoffset demo
1 parent c4aabb3 commit d049264

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

bin/scriptimate.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,15 @@ const addPart = async (lang, filename, left, top, opacity, scale, toBoxHole, das
249249
const filePath = `${proc_args.basedir}/src/${fn}.svg`;
250250
return fsExtra.readFileSync(filePath, 'utf-8').toString();
251251
};
252+
let fname = `${filename}_${lang}`;
252253
try {
253-
f = readFname(`${filename}_${lang}`)
254+
f = readFname(fname);
254255
} catch (e) {
255-
f = readFname(filename)
256+
fname = filename;
257+
f = readFname(fname)
256258
}
257259
await new Promise((resolve) => {
258-
svgDim.get(f, function(err, dimensions) {
260+
svgDim.get(`${proc_args.basedir}/src/${fname}.svg`, function(err, dimensions) {
259261
if (err) {
260262
console.log(`INFO: can't read ${filename} dimensions`, err);
261263
} else {

examples/7_dashoffset.smte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set_frame_size 300 300
2+
3+
place stroke 10 10 1 1 0 -1000
4+
addstyle stroke stroke-dasharray:1000;
5+
6+
animate_2000 dashoffset stroke 0

examples/src/stroke.svg

Lines changed: 7 additions & 0 deletions
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptimate",
3-
"version": "1.2.10",
3+
"version": "1.2.14",
44
"description": "Open-source SVG animation tool",
55
"main": "bin/index.js",
66
"keywords": [

readme.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You will get:
3333
You need to have next packages on your system (works for Ubuntu and [Windows WSL2](https://hinty.io/devforth/how-to-install-wsl-2-best-way-to-run-real-linux-on-windows/)):
3434

3535
```
36-
sudo apt-get install libnss3-dev libatk-bridge2.0-0 libcups2 libgtk-3-0 libgbm-dev ffmpeg
36+
sudo apt install libnss3-dev libatk-bridge2.0-0 libcups2 libgtk-3-0 libgbm-dev ffmpeg
3737
```
3838

3939
(All apart `ffmpeg` required to run pupeeter which is used to generate high-qaulity frames, some taken from here https://gist.github.com/winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01)s
@@ -50,6 +50,17 @@ sudo apt install fonts-roboto
5050

5151
Read here: https://tracklify.com/blog/scriptimate-an-open-source-tool-to-create-svg-animations-in-a-coding-way/
5252

53+
# Development
54+
55+
Just do:
56+
57+
```
58+
npm ci
59+
cd examples
60+
node ../bin/scriptimate.js -i 7_dashoffset.smte -f gif
61+
```
62+
63+
5364
## How to run examples from this repo
5465

5566
1. Pull the repo

0 commit comments

Comments
 (0)