-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLogo.qml
126 lines (103 loc) · 1.92 KB
/
Logo.qml
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
118
119
120
121
122
123
124
125
126
import QtQuick 2.3
import QtGraphicalEffects 1.0
Item {
id: logo;
visible: true;
anchors.margins: 20;
signal finished();
Image {
id: imageSource;
width: parent.width;
fillMode: Image.PreserveAspectFit;
asynchronous: true;
cache: true;
mipmap: true;
source: 'logo/HackathonTW.png'
layer.enabled: true;
layer.effect: Glow {
radius: 8;
samples: 16;
transparentBorder: true;
spread: 0.2;
cached: true;
color: '#33aaff';
source: imageSource
}
Behavior on scale {
NumberAnimation {
duration: 600;
easing.type: Easing.OutBack;
}
}
SequentialAnimation {
running: logo.visible;
ParallelAnimation {
NumberAnimation {
target: imageSource;
property: 'scale';
duration: 1000;
easing.type: Easing.OutBack;
from: 0;
to: 1;
}
NumberAnimation {
target: effect;
property: 'opacity';
duration: 1000;
easing.type: Easing.OutCubic;
from: 0;
to: 1;
}
NumberAnimation {
target: imageSource;
property: 'opacity';
duration: 1000;
easing.type: Easing.OutCubic;
from: 0;
to: 1;
}
}
}
}
ShaderEffect {
id: effect;
anchors.fill: imageSource;
property variant source: imageSource;
fragmentShader: "
varying highp vec2 qt_TexCoord0;
uniform lowp sampler2D source;
void main() {
gl_FragColor = texture2D(source, qt_TexCoord0);
}"
}
Timer {
interval: 2000;
running: logo.visible;
repeat: false;
onTriggered: {
effect.visible = false;
imageSource.scale = 0.7;
logo.anchors.centerIn = undefined;
logo.state = 'normal';
finished();
}
}
states: [
State {
name: 'normal';
AnchorChanges {
target: logo;
anchors.top: logo.parent.top
anchors.right: logo.parent.right
}
}
]
transitions: Transition {
SequentialAnimation {
AnchorAnimation {
duration: 600;
easing.type: Easing.OutBack;
}
}
}
}