-
Notifications
You must be signed in to change notification settings - Fork 7
/
TimeExample.js
68 lines (60 loc) · 1.94 KB
/
TimeExample.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* This Source Code is licensed under the MIT license. If a copy of the
* MIT-license was not distributed with this file, You can obtain one at:
* http://opensource.org/licenses/mit-license.html.
*
* @author: Hein Rutjes (IjzerenHein)
* @license MIT
* @copyright Gloey Apps, 2015
*/
/*global define, console*/
/*eslint no-use-before-define:0, no-console:0 */
define(function(require, exports, module) {
// import dependencies
require('./styles.css');
var View = require('famous/core/View');
var Surface = require('famous/core/Surface');
var Modifier = require('famous/core/Modifier');
var Transform = require('famous/core/Transform');
var DatePicker = require('famous-flex/widgets/DatePicker');
function TimeExample(options) {
View.apply(this, arguments);
_createDatePicker.call(this);
_createBack.call(this);
}
TimeExample.prototype = Object.create(View.prototype);
TimeExample.prototype.constructor = TimeExample;
function _createDatePicker() {
this.datePicker = new DatePicker({
perspective: 500,
date: new Date(),
wheelLayout: {
itemSize: 80,
diameter: 320,
radialOpacity: 0
},
createRenderables: {
top: true,
bottom: true
},
classes: ['time']
});
this.datePicker.setComponents([
new DatePicker.Component.Hour(),
new DatePicker.Component.Minute(),
new DatePicker.Component.Second()
]);
this.add(this.datePicker);
return this.datePicker;
}
function _createBack() {
this.back = new Surface({
classes: ['time', 'background']
});
var mod = new Modifier({
transform: Transform.translate(0, 0, -1000)
});
this.add(mod).add(this.back);
}
module.exports = TimeExample;
});