forked from Shinonome/dots-hyprland
lock: refactor error shake anim
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property Item target
|
||||||
|
property real distance: 30
|
||||||
|
|
||||||
|
NumberAnimation { target: root.target; property: "Layout.leftMargin"; to: -root.distance; duration: 50 }
|
||||||
|
NumberAnimation { target: root.target; property: "Layout.leftMargin"; to: root.distance; duration: 50 }
|
||||||
|
NumberAnimation { target: root.target; property: "Layout.leftMargin"; to: -root.distance / 2; duration: 40 }
|
||||||
|
NumberAnimation { target: root.target; property: "Layout.leftMargin"; to: root.distance / 2; duration: 40 }
|
||||||
|
NumberAnimation { target: root.target; property: "Layout.leftMargin"; to: 0; duration: 30 }
|
||||||
|
}
|
||||||
@@ -170,13 +170,9 @@ MouseArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Shake when wrong password
|
// Shake when wrong password
|
||||||
SequentialAnimation {
|
ErrorShakeAnimation {
|
||||||
id: wrongPasswordShakeAnim
|
id: wrongPasswordShakeAnim
|
||||||
NumberAnimation { target: passwordBox; property: "Layout.leftMargin"; to: -30; duration: 50 }
|
target: passwordBox
|
||||||
NumberAnimation { target: passwordBox; property: "Layout.leftMargin"; to: 30; duration: 50 }
|
|
||||||
NumberAnimation { target: passwordBox; property: "Layout.leftMargin"; to: -15; duration: 40 }
|
|
||||||
NumberAnimation { target: passwordBox; property: "Layout.leftMargin"; to: 15; duration: 40 }
|
|
||||||
NumberAnimation { target: passwordBox; property: "Layout.leftMargin"; to: 0; duration: 30 }
|
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: GlobalStates
|
target: GlobalStates
|
||||||
|
|||||||
Reference in New Issue
Block a user