From a5158d55b3e5797e1184fc986ca338675bd86568 Mon Sep 17 00:00:00 2001 From: Simon Ilincev Date: Mon, 18 Nov 2024 22:15:17 -0500 Subject: [PATCH 01/12] checkpoint: mocked (on-enter) note shaking --- src/components/Course/Course.vue | 39 ++++++++++++++++++++++++++++++-- src/components/Notes/Note.vue | 10 +++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/components/Course/Course.vue b/src/components/Course/Course.vue index 7b78e4efc..65b758bee 100644 --- a/src/components/Course/Course.vue +++ b/src/components/Course/Course.vue @@ -1,5 +1,8 @@ @@ -174,6 +179,7 @@ export default defineComponent({ isExpanded: false, isNoteVisible: false, expandNote: false, + isShaking: false, }; }, computed: { @@ -281,6 +287,12 @@ export default defineComponent({ closeNote() { this.isNoteVisible = false; }, + triggerCourseCardShake() { + this.isShaking = true; + setTimeout(() => { + this.isShaking = false; + }, 900); // 3 shakes * 0.3s = 0.9s + }, }, directives: { 'click-outside': clickOutside, @@ -296,6 +308,29 @@ export default defineComponent({ padding-bottom: 20px; } +.figma-shake { + animation: tilt-shaking 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) 3; + transform-origin: center center; +} + +@keyframes tilt-shaking { + 0% { + transform: rotate(0deg) translateX(0); + } + 25% { + transform: rotate(4deg) translateX(6px); + } + 50% { + transform: rotate(0deg) translateX(0); + } + 75% { + transform: rotate(-4deg) translateX(-6px); + } + 100% { + transform: rotate(0deg) translateX(0); + } +} + .course { box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.055); position: relative; diff --git a/src/components/Notes/Note.vue b/src/components/Notes/Note.vue index 4d670525b..f9fe87ad8 100644 --- a/src/components/Notes/Note.vue +++ b/src/components/Notes/Note.vue @@ -1,7 +1,12 @@