feat(ui): add smooth exit animations for modals - #40
Conversation
Replaced abrupt display: 'none' closures with a `window.closeModal` helper that applies a `.closing` class. Added matching 140ms CSS animations (`ci-overlay-fade-out`, `ci-modal-pop-out`) to `src/style.css` for tactile feedback. Updated `.Jules/palette.md` to document the new pattern. Co-authored-by: bugragungoz <209906170+bugragungoz@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Adds smooth “exit” animations for modal overlays by introducing a window.closeModal(overlay) helper that applies a .closing class before hiding the overlay, and wiring some existing close paths to use it.
Changes:
- Added
.modal-overlay.closing/.modal-overlay.closing .modalexit animations (fade + scale/translate) tosrc/style.css. - Replaced some direct
overlay.style.display = 'none'modal closes insrc/app.jswithwindow.closeModal(overlay), and updated generic close handlers (data-close, backdrop click, Escape). - Documented the new modal-closing paradigm in
.Jules/palette.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/style.css |
Adds keyframes and .closing rules for modal exit animations. |
src/app.js |
Introduces window.closeModal and routes several modal-close actions through it. |
.Jules/palette.md |
Documents the intended “always use window.closeModal” pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| window.closeModal = function(overlay) { | ||
| if (!overlay) return; | ||
| overlay.classList.add('closing'); | ||
| setTimeout(() => { | ||
| overlay.style.display = 'none'; | ||
| overlay.classList.remove('closing'); | ||
| }, 140); | ||
| }; |
| window.closeModal = function(overlay) { | ||
| if (!overlay) return; | ||
| overlay.classList.add('closing'); | ||
| setTimeout(() => { |
| @@ -0,0 +1,4 @@ | |||
| ## 2024-07-09 - [Modal Closing Animations] | |||
Added a micro-UX enhancement by implementing smooth exit animations (140ms fade and scale out) for all modal overlays. Replaced instances of
style.display = 'none'insrc/app.jswithwindow.closeModal(overlay), which adds a.closingCSS class before hiding the element. Recorded the paradigm in.Jules/palette.md.PR created automatically by Jules for task 9303383637367644224 started by @bugragungoz