sync clock and widget fly-in animations to wave phase

This commit is contained in:
Damocles 2026-04-18 11:40:52 +02:00
parent e2f8accbc1
commit 570000f09a
3 changed files with 20 additions and 55 deletions

View file

@ -5,22 +5,15 @@ Item {
id: root id: root
required property real screenHeight required property real screenHeight
property real wavePhase: 0
property real unlockFade: 1
readonly property real _fontSize: Math.max(48, screenHeight * 0.28) readonly property real _fontSize: Math.max(48, screenHeight * 0.28)
opacity: 0 // Appear as wave reaches the clock (left edge)
property real _slideX: -80 readonly property real _progress: Math.max(0, Math.min(1, wavePhase / 300)) * unlockFade
opacity: _progress
NumberAnimation on opacity { property real _slideX: (1 - _progress) * -80
to: 1
duration: 400
easing.type: Easing.OutCubic
}
NumberAnimation on _slideX {
to: 0
duration: 500
easing.type: Easing.OutCubic
}
transform: Translate { transform: Translate {
x: root._slideX x: root._slideX

View file

@ -95,7 +95,7 @@ WlSessionLockSurface {
} }
} }
// Clock - rotated, left-aligned // Clock - rotated, left-aligned, flies in with wave
LockClock { LockClock {
id: _clockItem id: _clockItem
anchors.left: parent.left anchors.left: parent.left
@ -103,6 +103,8 @@ WlSessionLockSurface {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
screenHeight: root.height screenHeight: root.height
wavePhase: _hexWave.wavePhase
unlockFade: root._unlockFade
} }
// Center content - password and notifications // Center content - password and notifications
@ -163,12 +165,15 @@ WlSessionLockSurface {
} }
} }
// Right column - widgets // Right column - widgets, fly in when wave exits screen
LockWidgets { LockWidgets {
id: _widgetCol id: _widgetCol
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 48 anchors.rightMargin: 48
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
wavePhase: _hexWave.wavePhase
screenWidth: root.width
unlockFade: root._unlockFade
} }
onVisibleChanged: { onVisibleChanged: {
@ -202,20 +207,6 @@ WlSessionLockSurface {
id: _unlockAnim id: _unlockAnim
ParallelAnimation { ParallelAnimation {
NumberAnimation {
target: _clockItem
property: "opacity"
to: 0
duration: 200
easing.type: Easing.InCubic
}
NumberAnimation {
target: _clockItem
property: "_slideX"
to: -80
duration: 200
easing.type: Easing.InCubic
}
NumberAnimation { NumberAnimation {
target: content target: content
property: "opacity" property: "opacity"
@ -230,20 +221,6 @@ WlSessionLockSurface {
duration: 200 duration: 200
easing.type: Easing.InCubic easing.type: Easing.InCubic
} }
NumberAnimation {
target: _widgetCol
property: "opacity"
to: 0
duration: 200
easing.type: Easing.InCubic
}
NumberAnimation {
target: _widgetCol
property: "_slideX"
to: 80
duration: 200
easing.type: Easing.InCubic
}
NumberAnimation { NumberAnimation {
target: root target: root
property: "_unlockFade" property: "_unlockFade"

View file

@ -8,19 +8,14 @@ Item {
width: 280 width: 280
opacity: 0 property real wavePhase: 0
property real _slideX: 80 property real screenWidth: 0
property real unlockFade: 1
NumberAnimation on opacity { // Fly in when wave exits the right edge
to: 1 readonly property real _progress: (screenWidth > 0 ? Math.max(0, Math.min(1, (wavePhase - screenWidth) / 500)) : 0) * unlockFade
duration: 400 opacity: _progress
easing.type: Easing.OutCubic property real _slideX: (1 - _progress) * 80
}
NumberAnimation on _slideX {
to: 0
duration: 500
easing.type: Easing.OutCubic
}
transform: Translate { transform: Translate {
x: root._slideX x: root._slideX