summaryrefslogtreecommitdiffstats
path: root/weather-qml/Storm.qml
blob: d92de47a10db37c2cd3bba2fddf03f2429ca8394 (plain)
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
import Qt 4.6

ForecastView {
    id: root
    isClear: false

    SmallCloud {
        id: cloud5
        x: scaledX(280)
        y: scaledY(-800)
        finalY: scaledY(-480)
        type: "cloud_storm"
    }

    SmallCloud {
        id: cloud4
        x: scaledX(36)
        y: scaledY(-800)
        finalY: scaledY(-494)
        type: "cloud_storm"
    }

    HungItem {
        id: sun
        x: isDay ? scaledX(198) : scaledX(220)
        y: scaledY(-800)
        itemX: 0
        itemY:  isDay ? 176 : 180
        height:  isDay ? 460 : 440
        finalY: isDay ? scaledY(-255) : scaledY(-205)
        itemImage: isDay ? "images/cold_sun.png" : "images/moon.png"
        lineImage: isDay ? "images/cold_sun_line.png" : "images/moon_line.png"
    }

    MediumCloud {
        id: cloud2
        x: scaledX(340)
        y: scaledY(-800)
        finalY: scaledY(-350)
        type: "cloud_storm"
    }

    LargeCloud {
        id: cloud3
        x: scaledX(-30)
        y: scaledY(-800)
        finalY: scaledY(-345)
        type: "cloud_storm"
    }

    RainItem {
        id: rain
        x: scaledX(70)
        y: scaledY(376)
        visible: false
        rainType: "storm"
    }

    LargeCloud {
        id: cloud1
        x: scaledX(202)
        y: scaledY(-800)
        finalY: scaledY(-310)
        type: "cloud_storm"
    }

    states : State {
        name: "final"
        PropertyChanges { target: sun; y: sun.finalY; }
        PropertyChanges { target: cloud1; y: cloud1.finalY; }
        PropertyChanges { target: cloud2; y: cloud2.finalY; }
        PropertyChanges { target: cloud3; y: cloud3.finalY; }
        PropertyChanges { target: cloud4; y: cloud4.finalY; }
        PropertyChanges { target: cloud5; y: cloud5.finalY; }
        PropertyChanges { target: rain; visible: true; }
    }

    transitions: Transition {
        SequentialAnimation {
            ParallelAnimation {
               NumberAnimation { target: cloud1; properties: "y";
                                 easing.type: "OutBack"; duration: 500 }

               SequentialAnimation {
                   PauseAnimation { duration: 200 }
                   NumberAnimation { target: cloud3; properties: "y";
                                     easing.type: "OutBack"; duration: 500 }
               }

               SequentialAnimation {
                   PauseAnimation { duration: 400 }
                   NumberAnimation { target: cloud2; properties: "y";
                                     easing.type: "OutBack"; duration: 500 }
               }

               SequentialAnimation {
                   PauseAnimation { duration: 600 }
                   NumberAnimation { target: cloud4; properties: "y";
                                     easing.type: "OutBack"; duration: 500 }
               }

               SequentialAnimation {
                   PauseAnimation { duration: 800 }
                   NumberAnimation { target: cloud5; properties: "y";
                                     easing.type: "OutBack"; duration: 500 }
               }
            }

            NumberAnimation { target: sun; properties: "y";
                              easing.type: "OutBack"; duration: 500 }

            PauseAnimation { duration: 100 }

            NumberAnimation { target: rain; properties: "visible"; duration: 0 }
        }
    }

    onPresent: { root.state = "final"; }
}