1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

revise notification position and animations

This commit is contained in:
bbedward
2025-07-26 10:08:56 -04:00
parent 308d84bfa1
commit 7b8efd9114
7 changed files with 118 additions and 57 deletions

View File

@@ -7,44 +7,79 @@ import Quickshell
Singleton {
id: root
// Durations match M3 token tiers: short4/medium4/long4
readonly property int durShort: 200
readonly property int durMed: 400
readonly property int durLong: 600
readonly property int durMed: 450
readonly property int durLong: 600
readonly property int slidePx: 80
// Material Design 3 motion curves
readonly property var emphasized: [0.05, 0, 2/15, 0.06, 1/6, 0.4, 5/24, 0.82, 0.25, 1, 1, 1]
readonly property var emphasizedDecel: [0.05, 0.7, 0.1, 1, 1, 1]
readonly property var standard: [0.2, 0, 0, 1, 1, 1]
readonly property QtObject direction: QtObject {
readonly property int fromLeft: 0
readonly property int fromRight: 1
readonly property int fadeOnly: 2
}
// Material Design 3 motion curves (for QML BezierSpline)
// Use groups of: [cx1, cy1, cx2, cy2, endX, endY, ...]
// Single-segment cubics end with 1,1.
readonly property Component slideInLeft: Transition {
NumberAnimation { properties: "x"; from: -Anims.slidePx; to: 0; duration: Anims.durMed; easing.type: Easing.OutQuart }
}
// Emphasized (multi-segment) for on-screen-to-on-screen moves
readonly property var emphasized: [
0.05, 0.00, 0.133333, 0.06, 0.166667, 0.40,
0.208333, 0.82, 0.25, 1.00, 1.00, 1.00
]
readonly property Component slideOutLeft: Transition {
NumberAnimation { properties: "x"; to: -Anims.slidePx; duration: Anims.durShort; easing.type: Easing.InQuart }
}
// Emphasized decelerate entering
readonly property var emphasizedDecel: [ 0.05, 0.70, 0.10, 1.00, 1.00, 1.00 ]
readonly property Component slideInRight: Transition {
NumberAnimation { properties: "x"; from: Anims.slidePx; to: 0; duration: Anims.durMed; easing.type: Easing.OutQuart }
}
// Emphasized accelerate exiting
readonly property var emphasizedAccel: [ 0.30, 0.00, 0.80, 0.15, 1.00, 1.00 ]
readonly property Component slideOutRight: Transition {
NumberAnimation { properties: "x"; to: Anims.slidePx; duration: Anims.durShort; easing.type: Easing.InQuart }
}
// Standard set for small/subtle transitions
readonly property var standard: [ 0.20, 0.00, 0.00, 1.00, 1.00, 1.00 ]
readonly property var standardDecel: [ 0.00, 0.00, 0.00, 1.00, 1.00, 1.00 ]
readonly property var standardAccel: [ 0.30, 0.00, 1.00, 1.00, 1.00, 1.00 ]
readonly property Component fadeIn: Transition {
NumberAnimation { properties: "opacity"; from: 0.0; to: 1.0; duration: Anims.durMed; easing.type: Easing.OutQuart }
}
// readonly property QtObject direction: QtObject {
// readonly property int fromLeft: 0
// readonly property int fromRight: 1
// readonly property int fadeOnly: 2
// }
readonly property Component fadeOut: Transition {
NumberAnimation { properties: "opacity"; to: 0.0; duration: Anims.durShort; easing.type: Easing.InQuart }
}
}
// // Slide transitions (surface/large moves)
// // Enter = emphasizedDecel, Exit = emphasizedAccel
// readonly property Component slideInLeft: Transition {
// NumberAnimation {
// properties: "x"; from: -root.slidePx; to: 0; duration: root.durMed
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.emphasizedDecel
// }
// }
// readonly property Component slideOutLeft: Transition {
// NumberAnimation {
// properties: "x"; to: -root.slidePx; duration: root.durShort
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.emphasizedAccel
// }
// }
// readonly property Component slideInRight: Transition {
// NumberAnimation {
// properties: "x"; from: root.slidePx; to: 0; duration: root.durMed
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.emphasizedDecel
// }
// }
// readonly property Component slideOutRight: Transition {
// NumberAnimation {
// properties: "x"; to: root.slidePx; duration: root.durShort
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.emphasizedAccel
// }
// }
// // Fade transitions (small/subtle moves)
// // Enter = standardDecel, Exit = standardAccel
// readonly property Component fadeIn: Transition {
// NumberAnimation {
// properties: "opacity"; from: 0.0; to: 1.0; duration: root.durMed
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.standardDecel
// }
// }
// readonly property Component fadeOut: Transition {
// NumberAnimation {
// properties: "opacity"; to: 0.0; duration: root.durShort
// easing.type: Easing.BezierSpline; easing.bezierCurve: root.standardAccel
// }
// }
}