-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSplashScreens.qml
92 lines (84 loc) · 2.08 KB
/
SplashScreens.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
import QtQuick 2.15
import QtQuick.Controls
import QtQuick.Layouts
Item {
id: root
signal completed()
property alias title: title
property bool on: true
onOnChanged: {
if(!on){
opacityTimer.start()
}
}
ColumnLayout {
anchors.centerIn: parent
Text {
id: title
Layout.alignment: Qt.AlignHCenter
text: qsTr("RAEMON")
font.family: "Lato"
font.letterSpacing: -12
font.pixelSize: 96
font.weight: Font.ExtraBold
color: "#FFFFFF"
onOpacityChanged: {
if(opacity === 0 && root.on){
root.completed()
}
}
}
Text {
id: subTitle
Layout.alignment: Qt.AlignHCenter
text: qsTr("It’s your drive.")
font.family: "Lato"
font.italic: true
font.pixelSize: 20
font.weight: Font.ExtraLight
color: "#FFFFFF"
opacity: title.opacity
}
}
Text {
id: loading
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 100
visible: false
text: root.on ? qsTr("Loading...") : qsTr("Powering off...")
font.family: "Lato"
font.pixelSize: 20
font.weight: Font.Bold
color: "#FFFFFF"
opacity: title.opacity
}
Timer {
id: loadingTimer
running: false
repeat: false
interval: 500
onTriggered: {
loading.visible = true
opacityTimer.start()
}
}
Timer {
id: opacityTimer
running: false
repeat: false
interval: 1000
onTriggered: {
opacityAnimation.start()
}
}
NumberAnimation {
id: opacityAnimation
target: title
property: "opacity"
from: 1
to: 0
duration: 1000 // Duration in milliseconds
}
Component.onCompleted: loadingTimer.start()
}