summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-26 02:21:04 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-26 02:21:04 +0200
commit24186fc504859d774ebda65d5702132098d6de97 (patch)
tree8717ce1e9fcc16533098ae44fad84339654f1efc /public/bundle.js
parentd4e707a501bd053de1110ba8d87891c1d3b65e45 (diff)
offsets
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js44
1 files changed, 26 insertions, 18 deletions
diff --git a/public/bundle.js b/public/bundle.js
index b7cffc1..5233f13 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -3698,8 +3698,6 @@ var Slider = function (_Component) {
var old_value = opt[name];
var new_value = e.target.value;
- console.log(this.props);
- console.log(new_value, this.props.defaultValue);
if (new_value === '') {
new_value = this.props.defaultValue || (this.props.max - this.props.min) / 2;
} else if (this.props.type === 'int') {
@@ -3757,9 +3755,7 @@ var Slider = function (_Component) {
min = 0;
max = this.props.options.length - 1;
step = 1;
- console.log('old', value);
value = this.props.options.indexOf(value);
- console.log('new', value, this.props.options[value]);
} else {
step = (this.props.max - this.props.min) / 100;
text_value = parseFloat(value).toFixed(2);
@@ -7309,9 +7305,14 @@ var MorphResults = function (_Component) {
a: "",
b: "",
a_offset: 0,
+ a_duration: 1,
+ a_pos: 0,
b_offset: 0,
+ b_duration: 1,
+ b_pos: 0,
steps: 16,
dilate: 2,
+ frames: 32,
smooth: true,
mode: 'mix'
};
@@ -7340,16 +7341,18 @@ var MorphResults = function (_Component) {
var sequence_options = sequences.map(function (sequence) {
return [sequence.name.split("_").slice(0, 3).join(" ") + "~ (" + sequence.count + ")", sequence.name];
});
+ var sequenceLookup = sequences.reduce(function (a, b) {
+ return a[b.name] = b, a;
+ }, {});
- console.log(sequence_options);
- var totalLength = this.state.steps * this.state.dilate / 25;
+ var totalLength = this.state.frames / 25;
var lengthWarning = void 0;
if (this.state.steps > 64) {
lengthWarning = (0, _preact.h)(
'span',
null,
(0, _preact.h)('br', null),
- 'warning, this may take a while'
+ 'warning, this will take a while'
);
}
@@ -7378,16 +7381,16 @@ var MorphResults = function (_Component) {
title: 'Starting sequence',
value: this.state.a,
options: sequence_options,
- onChange: function onChange(key) {
- return _this2.setState({ a: key });
+ onChange: function onChange(name, key) {
+ return _this2.setState({ a: key, a_duration: sequenceLookup[key].count, a_pos: 0, a_offset: 0 });
}
}),
(0, _preact.h)(_common.Slider, {
title: 'Offset',
- value: this.state.a_offset,
+ value: this.state.a_pos,
min: 0, max: 1, step: 0.01,
onChange: function onChange(key) {
- return _this2.setState({ a_offset: key });
+ return _this2.setState({ a_pos: key, a_offset: key * (_this2.state.a_duration - _this2.state.frames) });
}
})
),
@@ -7398,16 +7401,16 @@ var MorphResults = function (_Component) {
title: 'Ending sequence',
value: this.state.b,
options: sequence_options,
- onChange: function onChange(key) {
- return _this2.setState({ b: key });
+ onChange: function onChange(name, key) {
+ return _this2.setState({ b: key, b_duration: sequenceLookup[key].count, b_pos: 0, b_offset: 0 });
}
}),
(0, _preact.h)(_common.Slider, {
title: 'Offset',
- value: this.state.b_offset,
+ value: this.state.b_pos,
min: 0, max: 1, step: 0.01,
onChange: function onChange(key) {
- return _this2.setState({ b_offset: key });
+ return _this2.setState({ b_pos: key, b_offset: key * (_this2.state.b_duration - _this2.state.frames) });
}
})
),
@@ -7428,16 +7431,16 @@ var MorphResults = function (_Component) {
value: this.state.steps,
options: [2, 4, 8, 16, 32, 64, 128, 256],
onChange: function onChange(key) {
- return _this2.setState({ steps: key });
+ return _this2.setState({ steps: key, frames: key * _this2.state.dilate });
}
}),
(0, _preact.h)(_common.Slider, {
type: 'list',
title: 'Dilate',
value: this.state.dilate,
- options: [2, 4, 8, 16, 32],
+ options: [1, 2, 4, 8, 16, 32],
onChange: function onChange(key) {
- return _this2.setState({ dilate: key });
+ return _this2.setState({ dilate: key, frames: _this2.state.steps * key });
}
}),
(0, _preact.h)(_common.Checkbox, {
@@ -7460,6 +7463,11 @@ var MorphResults = function (_Component) {
{ title: 'Total length' },
totalLength.toFixed(1) + " seconds"
),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Total frames' },
+ this.state.frames + " frames"
+ ),
lengthWarning,
(0, _preact.h)('br', null)
)