2021-09-10 12:45:15 +02:00
|
|
|
import QtQuick
|
2021-07-15 12:07:39 +02:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2020-08-20 17:21:09 +02:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
property string backgroundImage: ""
|
|
|
|
property int imageOffsetTop: 0
|
2021-09-23 15:55:40 +02:00
|
|
|
property int stackViewDepth: 0
|
|
|
|
onStackViewDepthChanged: {
|
|
|
|
if (stackViewDepth > 1) {
|
|
|
|
root.state = "backgroundBlur"
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
root.state = "backgroundImage"
|
|
|
|
return false
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
|
|
|
color: "#161C1D"
|
2021-02-05 11:48:06 +01:00
|
|
|
onImageOffsetTopChanged: {
|
2021-02-20 17:38:39 +01:00
|
|
|
if ((imageOffsetTop * -1) >= 200) {
|
2021-09-23 15:55:40 +02:00
|
|
|
root.state = "backgroundColor"
|
2020-08-20 17:21:09 +02:00
|
|
|
} else {
|
2021-05-16 19:37:55 +02:00
|
|
|
if (root.state !== "backgroundImage")
|
2021-09-23 15:55:40 +02:00
|
|
|
root.state = "backgroundImage"
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
}
|
2021-09-23 15:55:40 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
onBackgroundImageChanged: {
|
2021-05-16 19:37:55 +02:00
|
|
|
if (backgroundImage === "")
|
2021-09-23 15:55:40 +02:00
|
|
|
root.state = ""
|
2021-05-16 19:37:55 +02:00
|
|
|
else
|
2021-09-23 15:55:40 +02:00
|
|
|
root.state = "backgroundImage"
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: maskSource
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
visible: false
|
2022-04-23 14:32:36 +02:00
|
|
|
source: "qrc:/ScreenPlayWorkshop/assets/images/mask_workshop.png"
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: bgImage
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
height: bgImage.sourceSize.height
|
2021-07-15 12:07:39 +02:00
|
|
|
//fillMode: Image.PreserveAspectCrop
|
2021-05-16 19:37:55 +02:00
|
|
|
opacity: 0
|
|
|
|
source: root.backgroundImage
|
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors {
|
|
|
|
topMargin: root.imageOffsetTop
|
|
|
|
top: parent.top
|
|
|
|
right: parent.right
|
|
|
|
left: parent.left
|
|
|
|
}
|
|
|
|
|
|
|
|
LinearGradient {
|
|
|
|
id: gradient
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
z: 4
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
gradient: Gradient {
|
|
|
|
GradientStop {
|
2021-05-16 19:37:55 +02:00
|
|
|
position: 0
|
2020-08-20 17:21:09 +02:00
|
|
|
color: "#00ffffff"
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
GradientStop {
|
2021-02-05 11:48:06 +01:00
|
|
|
position: 0.6
|
|
|
|
color: "#00ffffff"
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-02-05 11:48:06 +01:00
|
|
|
GradientStop {
|
|
|
|
position: 1
|
2020-08-20 17:21:09 +02:00
|
|
|
color: "#161C1D"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-15 12:07:39 +02:00
|
|
|
FastBlur {
|
2021-02-05 11:48:06 +01:00
|
|
|
id: blur
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
anchors.fill: bgImage
|
|
|
|
source: bgImage
|
|
|
|
radius: 16
|
|
|
|
cached: true
|
2021-02-05 11:48:06 +01:00
|
|
|
opacity: 0
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: bgColor
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
color: "#161C1D"
|
|
|
|
opacity: 0
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
states: [
|
|
|
|
State {
|
2021-02-05 11:48:06 +01:00
|
|
|
name: ""
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: bgImage
|
|
|
|
opacity: 0
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: bgColor
|
|
|
|
opacity: 0
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: blur
|
|
|
|
opacity: 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "backgroundImage"
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: bgImage
|
|
|
|
opacity: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: bgColor
|
|
|
|
opacity: 0
|
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: blur
|
2021-02-05 11:48:06 +01:00
|
|
|
opacity: 0
|
2021-09-23 15:55:40 +02:00
|
|
|
radius: 16
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "backgroundColor"
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: bgImage
|
2021-02-05 11:48:06 +01:00
|
|
|
opacity: 1
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: bgColor
|
2021-02-20 17:38:39 +01:00
|
|
|
opacity: 0.8
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: blur
|
|
|
|
opacity: 1
|
2021-09-23 15:55:40 +02:00
|
|
|
radius: 16
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "backgroundBlur"
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: bgImage
|
|
|
|
opacity: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: bgColor
|
|
|
|
opacity: 0.85
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-09-23 15:55:40 +02:00
|
|
|
PropertyChanges {
|
|
|
|
target: blur
|
|
|
|
opacity: 1
|
|
|
|
radius: 64
|
|
|
|
}
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
transitions: [
|
|
|
|
Transition {
|
2021-02-05 11:48:06 +01:00
|
|
|
from: ""
|
2020-08-20 17:21:09 +02:00
|
|
|
to: "backgroundImage"
|
|
|
|
reversible: true
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyAnimation {
|
2021-02-05 11:48:06 +01:00
|
|
|
targets: [bgImage, bgColor, blur]
|
2021-02-20 17:38:39 +01:00
|
|
|
duration: 500
|
2020-08-20 17:21:09 +02:00
|
|
|
easing.type: Easing.InOutQuart
|
|
|
|
property: "opacity"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
Transition {
|
|
|
|
from: "backgroundImage"
|
|
|
|
to: "backgroundColor"
|
|
|
|
reversible: true
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2020-08-20 17:21:09 +02:00
|
|
|
PropertyAnimation {
|
2021-02-20 17:38:39 +01:00
|
|
|
targets: [bgImage, bgColor, blur]
|
|
|
|
duration: 200
|
2020-08-20 17:21:09 +02:00
|
|
|
easing.type: Easing.InOutQuart
|
|
|
|
property: "opacity"
|
|
|
|
}
|
2021-09-23 15:55:40 +02:00
|
|
|
},
|
|
|
|
Transition {
|
|
|
|
from: "backgroundImage"
|
|
|
|
to: "backgroundBlur"
|
|
|
|
reversible: true
|
2021-05-16 19:37:55 +02:00
|
|
|
|
2021-09-23 15:55:40 +02:00
|
|
|
PropertyAnimation {
|
|
|
|
targets: [bgImage, bgColor, blur]
|
|
|
|
duration: 300
|
|
|
|
easing.type: Easing.InOutQuart
|
|
|
|
property: "opacity"
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
target: blur
|
|
|
|
duration: 300
|
|
|
|
easing.type: Easing.InOutQuart
|
|
|
|
property: "radius"
|
|
|
|
}
|
2020-08-20 17:21:09 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|