-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartAnimation.qml
More file actions
117 lines (112 loc) · 2.86 KB
/
StartAnimation.qml
File metadata and controls
117 lines (112 loc) · 2.86 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import QtQuick 2.12
import QtGraphicalEffects 1.12
import sunnygui 1.0
Rectangle {
id : root
anchors.fill : parent
color : SunStyles.bluOysterCult
property int startWidth : 266
property int startHeight : 66
property int endWidth : startWidth * 2
property int endHeight : startHeight * 2
property int startX : 0
property int startY : 0
property int endX : (width - endWidth) / 2
property int endY : (height - endHeight) / 2
property color startColor : "steelblue"
property color endColor : SunStyles.sunshineYellow
property int duration : 1000
signal finished()
states : [
State {
name : "init"
PropertyChanges {
target : logo
x : startX
y : startY
sourceSize.width: startWidth
sourceSize.height: startHeight
}
PropertyChanges {
target : overlay
color : startColor
}
},
State {
name : "end"
PropertyChanges {
target : logo
x : endX
y : endY
sourceSize.width: endWidth
sourceSize.height: endHeight
}
PropertyChanges {
target : overlay
color : endColor
}
PropertyChanges {
target : root
opacity : 0
}
StateChangeScript{
name: "fScript"
script: root.finished();
}
}
]
state : "init"
Image {
id : logo
source : "qrc:/boot_logo.svg"
antialiasing : true
x : root.startX
y : root.startY
sourceSize.width:startWidth
sourceSize.height:startHeight
transformOrigin: Item.Center
}
ColorOverlay {
id : overlay
anchors.fill : logo
source : logo
color : startColor
}
transitions : [Transition {
from : "init"
to : "end"
SequentialAnimation{
ParallelAnimation {
NumberAnimation {
properties : "x,y,sourceSize.width,sourceSize.height"
duration : root.duration
}
ColorAnimation {
duration : root.duration
}
}
OpacityAnimator
{
duration:2000
}
ScriptAction {
scriptName:"fScript"
}
}
}
]
Timer {
interval : 30;
running : true;
repeat : false
onTriggered : {
root.fn_startAni();
}
}
Component.onCompleted : {
root.state = "init";
}
function fn_startAni() {
root.state = "end";
}
}