Skip to content

Commit

Permalink
ADD range to manipulate single animate obj
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasKulhanek committed May 18, 2023
1 parent dbdc637 commit 2500c9c
Show file tree
Hide file tree
Showing 7 changed files with 41,278 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/bodylight.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bodylight.bundle.map

Large diffs are not rendered by default.

41,241 changes: 41,241 additions & 0 deletions src_aurelia-bodylight-plugin/docs/SrdceRezZluteHotovo.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src_aurelia-bodylight-plugin/docs/example/animationrange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Animation driven by range component

```
<bdl-animate-adobe src="SrdceRezZluteHotovo.js" width="800" height="600" name="SrdceRezZluteHotovo" fromid="id1" responsive="true" playafterstart="false"></bdl-animate-adobe>
<bdl-range id="id1" title="" min="0" max="100" default="0" step="1" showicons="false" globalanim="true" animobj="children.0.LevaPredsin_anim"></bdl-range>
<bdl-range id="id2" title="" min="0" max="100" default="0" step="1" showicons="false" globalanim="true" animobj="children.0.PravaPredsin_anim"></bdl-range>
```

<bdl-animate-adobe src="SrdceRezZluteHotovo.js" width="800" height="600" name="SrdceRezZluteHotovo" fromid="id1" responsive="true" playafterstart="false"></bdl-animate-adobe>


<bdl-range id="id1" title="" min="0" max="100" default="0" step="1" showicons="false" globalanim="true" animobj="children.0.LevaPredsin_anim"></bdl-range>

<bdl-range id="id2" title="" min="0" max="100" default="0" step="1" showicons="false" globalanim="true" animobj="children.0.PravaPredsin_anim"></bdl-range>
1 change: 1 addition & 0 deletions src_aurelia-bodylight-plugin/docs/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
* [Performance](#example/performance.md)
* [Remote Value](#example/remotevaluedemo.md)
* [Manequin Demo](#example/manequindemo.md)
* [Animation Range](#example/animationrange.md)
* [About](#about.md)
2 changes: 1 addition & 1 deletion src_aurelia-bodylight-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aurelia-bodylight-plugin",
"description": "Bodylight plugin for Aurelia framework",
"version": "2.2.4",
"version": "2.2.5",
"repository": {
"type": "git",
"url": "git+https://github.com/creative-connections/Bodylight.js-Components.git"
Expand Down
18 changes: 16 additions & 2 deletions src_aurelia-bodylight-plugin/src/elements/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class Range {
@bindable title;
@bindable showicons = true;
@bindable globalanim = false;
@bindable animobj;
//@bindable firedata = false; //'position'
@bindable fireevent = 'input'; //name of the event to be dispatched - should be same as fmi eventlisten
refinput;
Expand Down Expand Up @@ -172,8 +173,21 @@ export class Range {
//single value is change e.g. externally
this.setValue(newValue);
if (this.globalanim) {
if (window.ani && window.ani.exportRoot)
window.ani.exportRoot.children[0].gotoAndStop(newValue);
if (this.animobj) {
//animate local object
if (!window.ani.animationstarted ) window.ani.enableAnimation();

if (window.ani) window.ani.setAnimationValue(this.animobj, newValue);
}
else {
//animate globally
if (window.ani && window.ani.exportRoot) {
for (animchild of window.ani.exportRoot.children) {
if (typeof animchild.gotoAndStop === 'function')
animchild.gotoAndStop (newValue);
}
}
}
}
}
}
Expand Down

0 comments on commit 2500c9c

Please sign in to comment.