diff --git a/.gitignore b/.gitignore index 211dd33..6a67cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .DS_Store release -lib/node_modules/ -wordpress-plugin/ +node_modules +dist diff --git a/lib/index.html b/lib/index.html new file mode 100644 index 0000000..ccc5650 --- /dev/null +++ b/lib/index.html @@ -0,0 +1,49 @@ + + + + + + Yoone Snow Preview + + + + + + + diff --git a/lib/src/animator/SnowAnimator.ts b/lib/src/animator/SnowAnimator.ts index 86fa087..0433ad6 100644 --- a/lib/src/animator/SnowAnimator.ts +++ b/lib/src/animator/SnowAnimator.ts @@ -6,6 +6,7 @@ export function runSnow(canvas: HTMLCanvasElement, settings: SystemSettings){ let viewportWidth = window.innerWidth let viewportHeight = window.innerHeight const dpr = window.devicePixelRatio || 1 + const system = createSystem(context, () => viewportWidth, () => viewportHeight, settings) function resize(){ viewportWidth = window.innerWidth viewportHeight = window.innerHeight @@ -18,7 +19,6 @@ export function runSnow(canvas: HTMLCanvasElement, settings: SystemSettings){ system.recomputeTarget() } resize() - const system = createSystem(context, () => viewportWidth, () => viewportHeight, settings) const animator = new Animator( (dt) => { system.updateSystem(dt); system.renderSystem() }, () => system.shouldStop(),