-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEasterEgg.qml
69 lines (56 loc) · 1.43 KB
/
EasterEgg.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
import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
Rectangle {
id: background
color: "black"
anchors.fill: parent
Column {
anchors.centerIn: parent
Label {
text: "Have a nice day <3"
font.pointSize: 20
anchors.horizontalCenter: parent.horizontalCenter
}
Label {
text: "\n😊"
font.pointSize: 20
anchors.horizontalCenter: parent.horizontalCenter
}
}
opacity: 0
OpacityAnimator {
id: fadeInAnimation
target: background;
from: 0;
to: 1;
duration: 1000
running: false
}
OpacityAnimator {
id: fadeOutAnimation
target: background;
from: 1;
to: 0;
duration: 1000
running: false
}
}
Button {
text: "Click me!"
width: 20
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.right
anchors.leftMargin: -12
onClicked: {
if (text == "Click me!") {
text = "😊"
fadeInAnimation.running = true
}
else if (text == "😊") {
text = "Click me!"
fadeOutAnimation.running = true
}
}
}
}