Skip to content

Commit

Permalink
body overflow hidden when opening modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Link1515 committed Oct 14, 2024
1 parent 7ddddb1 commit be80caa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ const modal = ref();
const openModal = () => {
modal.value.classList.add('is-active');
document.body.style.overflow = 'hidden';
};
const closeModal = () => {
setTimeout(() => modal.value.classList.remove('is-active'), 300);
document.body.style.overflow = '';
};
watch(isOpen, () => {
Expand Down
5 changes: 5 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@import 'bulma/css/bulma.min.css';

body {
height: 100vh;
height: 100dvh;
}

.bounce-enter-active {
animation: bounce-in 0.5s;
}
Expand Down

0 comments on commit be80caa

Please sign in to comment.