summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-10-15 21:34:35 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-10-15 21:34:35 +0200
commit6fd0aafada7091c929920910a94cd71c6334ec1f (patch)
tree4aa827f2b74092880fb47840fb89f706b1aa42a1
parente5091ff17c95240c22892afbb4d35baf1e09ba3c (diff)
downloadgnome-shell-gbsneto/new-lock-screen.tar.gz
authPrompt: Wiggle on failuregbsneto/new-lock-screen
WIP
-rw-r--r--js/gdm/authPrompt.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index f01a2fce1..13fc6223b 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -16,6 +16,10 @@ var DEFAULT_BUTTON_WELL_ANIMATION_TIME = 300;
var MESSAGE_FADE_OUT_ANIMATION_TIME = 500;
+const WIGGLE_OFFSET = 6;
+const WIGGLE_DURATION = 65;
+const N_WIGGLES = 3;
+
var AuthPromptMode = {
UNLOCK_ONLY: 0,
UNLOCK_OR_LOG_IN: 1
@@ -200,6 +204,35 @@ var AuthPrompt = class {
this.updateSensitivity(canRetry);
this.setActorInDefaultButtonWell(null);
this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
+
+ this._wiggle();
+ }
+
+ _wiggle() {
+ // Accelerate before wiggling
+ this._entry.ease({
+ translation_x: -WIGGLE_OFFSET,
+ duration: WIGGLE_DURATION,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: () => {
+ // Wiggle
+ this._entry.ease({
+ translation_x: WIGGLE_OFFSET,
+ duration: WIGGLE_DURATION,
+ mode: Clutter.AnimationMode.LINEAR,
+ repeat_count: N_WIGGLES,
+ auto_reverse: true,
+ onComplete: () => {
+ // Decelerate and return to the original position
+ this._entry.ease({
+ translation_x: 0,
+ duration: WIGGLE_DURATION,
+ mode: Clutter.AnimationMode.EASE_IN_QUAD,
+ });
+ }
+ });
+ }
+ });
}
_onVerificationComplete() {