-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainView.ux
88 lines (77 loc) · 2.28 KB
/
MainView.ux
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<App>
<JavaScript>
var Observable = require('FuseJS/Observable');
var hours = Observable();
var minutes = Observable();
function formatTime(time) {
if (time < 10) {
return "0" + time;
}
return time;
};
function Minute(minute) {
this.caption = minute;
this.type = "minute";
};
function Hour(hour) {
this.caption = hour;
this.type = "hour";
}
function setupHours() {
var hourBucket = [];
for (var i = 0; i < 24; i++) {
hourBucket.push(new Hour(formatTime(i)));
}
hours.replaceAll(hourBucket);
}
function setupMinutes() {
var minuteBucket = [];
for (var i = -5; i < 55; i += 5) {
minuteBucket.push(new Minute(formatTime(i + 5)));
}
minutes.replaceAll(minuteBucket);
}
function activated(args) {
//args.data.type == hour or minute
//args.data.caption == value selected
console.log(JSON.stringify(args));
}
setupHours();
setupMinutes();
module.exports = {
hours: hours,
minutes: minutes,
activated:activated,
};
</JavaScript>
<Panel ux:Class="ClockCard" Opacity="0.4" Width="75">
<string ux:Property="Caption" />
<Scaling ux:Name="pageScaling" Factor="0.95" />
<ActivatingAnimation>
<Change this.Opacity="1" Duration="0.5" />
<Change pageScaling.Factor="1" Duration="0.5" />
</ActivatingAnimation>
<EnteringAnimation Scale="0.5">
<Move Y="-1" RelativeTo="ParentSize" Duration="0.5" />
</EnteringAnimation>
<ExitingAnimation Scale="0.5">
<Move Y="1" RelativeTo="ParentSize" Duration="0.5" />
</ExitingAnimation>
<Panel Width="95%" Height="60%" Background="#E1FFB9" Alignment="Center">
<Text Value="{ReadProperty Caption}" Alignment="Center" />
</Panel>
</Panel>
<StackPanel Orientation="Horizontal" Height="60" Width="150">
<PageControl IsRouterOutlet="false" ActiveIndex="18" Orientation="Vertical" InactiveState="Unchanged" Transition="None">
<Each Items="{hours}">
<ClockCard Activated="{activated}" Caption="{caption}" />
</Each>
</PageControl>
<Text Value=":" FontSize="20" Alignment="Center"/>
<PageControl IsRouterOutlet="false" ActiveIndex="6" Orientation="Vertical" InactiveState="Unchanged" Transition="None">
<Each Items="{minutes}">
<ClockCard Activated="{activated}" Caption="{caption}"/>
</Each>
</PageControl>
</StackPanel>
</App>