-
Notifications
You must be signed in to change notification settings - Fork 4
/
animations.js
45 lines (35 loc) · 1.03 KB
/
animations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(function($) {
'use strict';
if (window.JSVEE === undefined) {
return;
}
JSVEE.animations = {};
/**
* Returns the requested animation.
*
* @param id The unique id of the animation
* @memberOf JSVEE.animations
*/
JSVEE.animations.getAnimation = function(id) {
if (JSVEE.animations.hasOwnProperty(id)) {
return JSVEE.animations[id];
}
return null;
};
JSVEE.animations['hello'] = {
'lines': ['print(\"Hello world!\")'],
'settings': { 'code': 'left', 'heapHeight': 0, 'stackHeight': 150, 'width': 800 },
'init': [['createFrame'], ['setLine', '1'], ['createFunction', 'print', 'print(value)', '1', '-1']],
'steps': [['goto', '@l0'], ['_label', 'l0'], ['addFunction', 'print', '0', '1'],
['addValue', 'Hello world!', '0/0/0', 'str'], ['evaluateFunction', '0']]
};
$(function() {
// Create animations
$('.jsvee-animation').each(function() {
var id = $(this).attr('data-id');
if (id) {
new JSVEE.ui(id, this);
}
});
});
}(jQuery));