Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
transition for menu icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mort3za committed Jun 28, 2019
1 parent cde84ea commit 9f1f759
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/assets/img/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 39 additions & 3 deletions src/components/Board.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<template>
<div class="board-w mx-auto py-3">
<div class="toolbar d-flex">
<a class="menu-toggle d-block mx-3 mb-3" href="#" @click.prevent="menuToggle()"></a>
<a class="menu position-relative d-block mx-3 mb-3" href="#" @click.prevent="menuToggle()">
<transition name="fade">
<span v-if="!shouldShowMenu" class="menu-icon menu-open position-absolute d-block"></span>
</transition>
<transition name="fade">
<span v-if="shouldShowMenu" class="menu-icon menu-close position-absolute d-block"></span>
</transition>
</a>
</div>
<div class="mx-3">
<div class="aspect-ratio-box mb-3">
Expand Down Expand Up @@ -391,10 +398,39 @@ export default class BoardComponent extends Vue {
width: 100%;
height: 100%;
}
.menu-toggle {
background: url("../assets/img/menu.svg") no-repeat center;
.fade-enter-to, .fade-leave {
opacity: 1;
}
.fade-leave-to, .fade-enter {
opacity: 0;
}
.menu {
background-size: rem(32px);
width: rem(32px);
height: rem(32px);
}
.menu-icon {
transition: all 300ms ease 75ms;
position: absolute;
background-size: rem(32px);
width: rem(32px);
height: rem(32px);
}
.menu-open {
background: url("../assets/img/menu.svg") no-repeat center;
&.fade-enter-to {
transition-delay: 200ms;
}
}
.menu-close {
background: url("../assets/img/close.svg") no-repeat center;
&.fade-enter-to {
transition-delay: 200ms;
}
}
</style>

0 comments on commit 9f1f759

Please sign in to comment.