[branding] Put sponsor behind the smoke bar

This commit is contained in:
Artem Grinev 2023-12-10 04:39:13 +03:00
parent 4eac6fa8dc
commit 34feef79b5
2 changed files with 44 additions and 53 deletions

View File

@ -10,7 +10,6 @@ Rectangle {
property int height: 6950 property int height: 6950
} }
SystemPalette { SystemPalette {
id: systemPalette id: systemPalette
} }
@ -63,14 +62,14 @@ Rectangle {
properties: "x" properties: "x"
duration: 700 duration: 700
easing.type: Easing.OutQuad easing.type: Easing.OutQuad
to: comet.x-100 to: comet.x - 100
} }
NumberAnimation { NumberAnimation {
target: comet target: comet
properties: "y" properties: "y"
duration: 700 duration: 700
easing.type: Easing.OutQuad easing.type: Easing.OutQuad
to: comet.y+100 to: comet.y + 100
} }
} }
} }
@ -84,21 +83,19 @@ Rectangle {
top: parent.top top: parent.top
topMargin: -starsClose1.sourceSize.height topMargin: -starsClose1.sourceSize.height
} }
height: starsClose1.height+starsClose2.height height: starsClose1.height + starsClose2.height
Image { Image {
fillMode: Image.Tile
id: starsClose1 id: starsClose1
fillMode: Image.Tile
source: 'starsClose.svg' source: 'starsClose.svg'
height: maxSceneSize.height height: maxSceneSize.height
width: maxSceneSize.width width: maxSceneSize.width
} }
Image { Image {
fillMode: Image.Tile
id: starsClose2 id: starsClose2
fillMode: Image.Tile
source: 'starsClose.svg' source: 'starsClose.svg'
height: maxSceneSize.height height: maxSceneSize.height
@ -126,20 +123,19 @@ Rectangle {
top: parent.top top: parent.top
topMargin: -starsFar1.sourceSize.height topMargin: -starsFar1.sourceSize.height
} }
height: starsFar1.height+starsFar2.height height: starsFar1.height + starsFar2.height
Image { Image {
fillMode: Image.Tile
id: starsFar1 id: starsFar1
fillMode: Image.Tile
source: 'starsFar.svg' source: 'starsFar.svg'
height: maxSceneSize.height height: maxSceneSize.height
width: maxSceneSize.width width: maxSceneSize.width
} }
Image { Image {
fillMode: Image.Tile
id: starsFar2 id: starsFar2
fillMode: Image.Tile
source: 'starsFar.svg' source: 'starsFar.svg'
height: maxSceneSize.height height: maxSceneSize.height
@ -173,8 +169,7 @@ Rectangle {
interval: 25000 interval: 25000
repeat: true repeat: true
onTriggered: { onTriggered: {
moon.height = Math.floor(Math.random() * (45 - 200) + 200) moon.height = Math.floor(Math.random() * (45 - 200) + 200);
moon.x = Math.floor(Math.random() * root.width); moon.x = Math.floor(Math.random() * root.width);
moonShowupAnimation.start(); moonShowupAnimation.start();
} }
@ -185,9 +180,8 @@ Rectangle {
properties: "y" properties: "y"
duration: 25000 duration: 25000
from: -moon.height from: -moon.height
to: maxSceneSize.height+moon.height to: maxSceneSize.height + moon.height
} }
} }
Image { Image {
@ -196,17 +190,22 @@ Rectangle {
mipmap: true mipmap: true
source: systemPalette.window.hslLightness > 0.5 ? "background.svg" : "background_dark.svg" source: systemPalette.window.hslLightness > 0.5 ? "background.svg" : "background_dark.svg"
}
sourceSize { Loader {
height: maxSceneSize.height source: "sponsor/SponsoredBy.qml"
width: maxSceneSize.width
anchors {
bottom: parent.bottom
right: parent.right
margins: 10
} }
} }
Item { Item {
id: smoke id: smoke
anchors{ anchors {
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
left: parent.left left: parent.left
@ -214,7 +213,7 @@ Rectangle {
height: smokeAsset.paintedHeight height: smokeAsset.paintedHeight
Rectangle { Rectangle {
anchors{ anchors {
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
left: parent.left left: parent.left
@ -225,7 +224,7 @@ Rectangle {
} }
Image { Image {
id: smokeAsset id: smokeAsset
anchors{ anchors {
bottom: parent.bottom bottom: parent.bottom
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
@ -241,7 +240,7 @@ Rectangle {
anchors { anchors {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: -(height-lift) bottomMargin: -(height - lift)
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -235 horizontalCenterOffset: -235
} }
@ -286,17 +285,17 @@ Rectangle {
name: "nearGround" name: "nearGround"
PropertyChanges { PropertyChanges {
target: rocket target: rocket
lift: root.height/2 + 150 lift: root.height / 2 + 150
} }
PropertyChanges { PropertyChanges {
target: smoke target: smoke
anchors.bottomMargin: -smoke.height/2 + 100 anchors.bottomMargin: -smoke.height / 2 + 100
} }
PropertyChanges { PropertyChanges {
target: background target: background
anchors.bottomMargin: -(root.height*0.2) anchors.bottomMargin: -(root.height * 0.2)
anchors.topMargin: -root.height+root.height*0.2 anchors.topMargin: -root.height + root.height * 0.2
} }
}, },
State { State {
@ -308,20 +307,20 @@ Rectangle {
} }
PropertyChanges { PropertyChanges {
target: rocket target: rocket
lift: root.height/2 + 100 lift: root.height / 2 + 100
} }
PropertyChanges { PropertyChanges {
target: background target: background
anchors.bottomMargin: -root.height*0.9 anchors.bottomMargin: -root.height * 0.9
anchors.topMargin: 0 anchors.topMargin: 0
} }
}, },
State { State {
extend: "inAtmosphere" extend: "inAtmosphere"
name: "inSpace" name: "inSpace"
PropertyChanges { PropertyChanges {
target: background target: background
anchors.bottomMargin: -(root.height*2) anchors.bottomMargin: -(root.height * 2)
anchors.topMargin: root.height anchors.topMargin: root.height
} }
PropertyChanges { PropertyChanges {
@ -344,7 +343,7 @@ Rectangle {
] ]
transitions: [ transitions: [
Transition{ Transition {
id: transition1 id: transition1
from: "onGround" from: "onGround"
to: "nearGround" to: "nearGround"
@ -355,14 +354,15 @@ Rectangle {
duration: 10000 duration: 10000
easing.type: Easing.InQuad easing.type: Easing.InQuad
} }
ScriptAction { script: root.state = "inAtmosphere" } ScriptAction {
script: root.state = "inAtmosphere"
}
} }
NumberAnimation { NumberAnimation {
target: smoke target: smoke
property: "bottomMargin" property: "bottomMargin"
duration: 10000 duration: 10000
easing.type: Easing.InQuad easing.type: Easing.InQuad
} }
NumberAnimation { NumberAnimation {
target: background target: background
@ -387,7 +387,9 @@ Rectangle {
properties: "anchors.topMargin,anchors.bottomMargin" properties: "anchors.topMargin,anchors.bottomMargin"
duration: 5000 duration: 5000
} }
ScriptAction { script: root.state = "inSpace" } ScriptAction {
script: root.state = "inSpace"
}
} }
}, },
Transition { Transition {
@ -423,19 +425,22 @@ Rectangle {
interval: 1 interval: 1
onTriggered: { onTriggered: {
switch(state) { switch (state) {
case "nearGround": case "nearGround":
if(!transition1.running) return; if (!transition1.running)
return;
state = "onGround"; state = "onGround";
state = "nearGround"; state = "nearGround";
break; break;
case "inAtmosphere": case "inAtmosphere":
if(!transition2.running) return; if (!transition2.running)
return;
state = "nearGround"; state = "nearGround";
state = "inAtmosphere"; state = "inAtmosphere";
break; break;
case "inSpace": case "inSpace":
if(!transition3.running) return; if (!transition3.running)
return;
state = "inAtmosphere"; state = "inAtmosphere";
state = "inSpace"; state = "inSpace";
} }
@ -445,5 +450,4 @@ Rectangle {
onHeightChanged: { onHeightChanged: {
sizeChangeTimeout.restart(); sizeChangeTimeout.restart();
} }
} }

View File

@ -70,18 +70,5 @@ Item {
horizontalCenterOffset: -100 horizontalCenterOffset: -100
verticalCenterOffset: -57 verticalCenterOffset: -57
} }
} }
Loader {
source: "sponsor/SponsoredBy.qml"
anchors {
bottom: parent.bottom
right: parent.right
margins: 10
}
}
} }