Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit af520f9

Browse files
committed
Add inspection modal transition
1 parent 66470e8 commit af520f9

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

components/Inspect.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export default {
5555
left: 0;
5656
width: 100vw;
5757
height: 100vh;
58-
background-color: hsla(0, 0%, 0%, 0.4);
5958
padding: 2em;
6059
}
6160

pages/index.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<Header/>
66
<CarbonAd/>
77
<Effects :effects="effects" @inspect="inspect"/>
8-
<Inspect v-if="inspecting" :src="inspectSrc" @close="closeInspect"/>
8+
<div class="inspect-bg" v-if="inspecting"></div>
9+
<transition name="inspect">
10+
<Inspect v-if="inspecting" :src="inspectSrc" @close="closeInspect"/>
11+
</transition>
912
<Controls @shuffle="shuffle" @reset="reset" @filter="filter"/>
1013
</div>
1114
</template>
@@ -61,5 +64,24 @@ export default {
6164
hsl(341, 100%, 55%)
6265
);
6366
}
64-
</style>
6567
68+
.inspect-bg {
69+
z-index: 998;
70+
position: fixed;
71+
top: 0;
72+
left: 0;
73+
width: 100vw;
74+
height: 100vh;
75+
background-color: hsla(0, 0%, 0%, 0.4);
76+
}
77+
78+
.inspect-enter-active,
79+
.inspect-leave-active {
80+
transition: all 0.25s ease-in-out;
81+
}
82+
.inspect-enter,
83+
.inspect-leave-to {
84+
opacity: 0;
85+
transform: scale(0);
86+
}
87+
</style>

0 commit comments

Comments
 (0)