Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #338 from tiki/fix/overlay-slides-up-instead-of-fa…
Browse files Browse the repository at this point in the history
…des-in

fix: background overlay fade in
  • Loading branch information
timoguin authored Oct 17, 2023
2 parents f8ac009 + 4eb6615 commit 1641b18
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
35 changes: 21 additions & 14 deletions src/components/sheet/sheet-bottom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ const handleTouch = (element: any) =>{
</script>

<template>
<div class="overlay" @click.stop.prevent="isShow = false" @touchend="handleTouch">
<Transition appear name="slide" @leave="$emit('dismiss')">
<div v-if="isShow" class="bottom-sheet" @click.stop>
<slot />
</div>
</Transition>
</div>
<Transition name="fade" appear>
<div class="overlay" @click.stop.prevent="isShow = false" @touchend="handleTouch">
<Transition appear name="slide-fade" @leave="$emit('dismiss')">
<div v-if="isShow" class="bottom-sheet" @click.stop>
<slot />
</div>
</Transition>
</div>
</Transition>
</template>

<style scoped>
Expand Down Expand Up @@ -63,16 +65,21 @@ const handleTouch = (element: any) =>{
max-height: 95vh;
}

.slide-enter-active {
transition: all 0.5s ease-out;
.slide-fade-enter-active {
transition: all 0.4s ease;
}

.slide-leave-active {
.slide-fade-leave-active {
transition: all 0.3s ease-out;
}

.slide-enter-from,
.slide-leave-to {
.slide-fade-enter, .slide-fade-leave-to
{
transform: translate(-50%, 100%);
}

.fade-enter-active, .fade-leave-active {
transition: opacity 0.4s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
</style>
12 changes: 0 additions & 12 deletions src/tiki-receipt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,8 @@ watch(
</script>

<template>
<Transition appear name="slide-fade">
<nav-view :show="present" @update:show="update" />
</Transition>
</template>

<style scoped>
.slide-fade-enter-active {
transition: all 0.4s ease;
}
.slide-fade-leave-active {
transition: all 0.3s ease-out;
}
.slide-fade-enter, .slide-fade-leave-to
{
transform: translate(-50%, 100%);
}
</style>

0 comments on commit 1641b18

Please sign in to comment.