summaryrefslogtreecommitdiffstats
path: root/weather-qml/Mist.qml
blob: d30e604afe7258d42b6d133e857eb9187d9c3799 (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(297)
        y: scaledY(-800)
        finalY: scaledY(-460);
        type: "cloud_rain"
    }

    SmallCloud {
        id: cloud4
        x: scaledX(64)
        y: scaledY(-800)
        finalY: scaledY(-436)
        type: "cloud_rain"
    }

    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: cloud3
        x: scaledX(154)
        y: scaledY(-800)
        finalY: scaledY(-296)
        type: "cloud_rain"
    }

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

    LargeCloud {
        id: cloud2
        x: scaledX(315)
        y: scaledY(-800)
        finalY: scaledY(-351)
        type: "cloud_rain"
    }

    LargeCloud {
        id: cloud1
        x: scaledX(-70)
        y: scaledY(-800)
        finalY: scaledY(-294)
        type: "cloud_rain"
    }

    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: cloud2; properties: "y";
                                     easing.type: "OutBack"; duration: 500 }
               }

               SequentialAnimation {
                   PauseAnimation { duration: 400 }
                   NumberAnimation { target: cloud3; 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"; }
}