diff --git a/main.qml b/main.qml index 5c8806d..588b43b 100644 --- a/main.qml +++ b/main.qml @@ -22,12 +22,6 @@ Window { background: Item { id: lamp - Image { - id: lampOn - source: "on.png" - anchors.fill: parent - scale: 0 - } Image { id: lampOn0 source: "on0.png" @@ -39,30 +33,100 @@ Window { source: "on1.png" anchors.fill: parent scale: 0 + Behavior on scale { + SequentialAnimation { + PauseAnimation { + duration: 200 + } + NumberAnimation { + duration: 200 + properties: "scale" + from: app.state === "on" ? 0:1 + to: app.state === "on" ? 1:0 + target: lampOn1 + } + } + } } Image { id: lampOn2 source: "on2.png" anchors.fill: parent scale: 0 + Behavior on scale { + SequentialAnimation { + PauseAnimation { + duration: 400 + } + NumberAnimation { + duration: 200 + properties: "scale" + from: app.state === "on" ? 0:1 + to: app.state === "on" ? 1:0 + target: lampOn2 + } + } + } } Image { id: lampOn3 source: "on3.png" anchors.fill: parent scale: 0 + Behavior on scale { + SequentialAnimation { + PauseAnimation { + duration: 600 + } + NumberAnimation { + duration: 200 + properties: "scale" + from: app.state === "on" ? 0:1 + to: app.state === "on" ? 1:0 + target: lampOn3 + } + } + } } Image { id: lampOn4 source: "on4.png" anchors.fill: parent scale: 0 + Behavior on scale { + SequentialAnimation { + PauseAnimation { + duration: 800 + } + NumberAnimation { + duration: 200 + properties: "scale" + from: app.state === "on" ? 0:1 + to: app.state === "on" ? 1:0 + target: lampOn4 + } + } + } } Image { id: lampOn5 - source: "on4.png" + source: "on5.png" anchors.fill: parent scale: 0 + Behavior on scale { + SequentialAnimation { + PauseAnimation { + duration: 1000 + } + NumberAnimation { + duration: 200 + properties: "scale" + from: app.state === "on" ? 0:1 + to: app.state === "on" ? 1:0 + target: lampOn5 + } + } + } } Image { id: lampOff @@ -79,11 +143,32 @@ Window { } } } + states: [ State { name: "on" PropertyChanges { - target: lampOn + target: lampOn0 + scale: 1 + } + PropertyChanges { + target: lampOn1 + scale: 1 + } + PropertyChanges { + target: lampOn2 + scale: 1 + } + PropertyChanges { + target: lampOn3 + scale: 1 + } + PropertyChanges { + target: lampOn4 + scale: 1 + } + PropertyChanges { + target: lampOn5 scale: 1 } PropertyChanges { diff --git a/on.png b/on.png deleted file mode 100644 index 6380424..0000000 Binary files a/on.png and /dev/null differ diff --git a/shared.qrc b/shared.qrc index b164dec..188a299 100644 --- a/shared.qrc +++ b/shared.qrc @@ -1,7 +1,6 @@ off.png - on.png on5.png on4.png on3.png