1
0
mirror of https://github.com/robonen/canvas-3d.git synced 2026-03-20 10:54:39 +00:00

feat(components): accordion icon animation

This commit is contained in:
2022-11-21 05:40:46 +07:00
parent eec4d3d061
commit 2d891c76cd
4 changed files with 11 additions and 14 deletions

View File

@@ -1,12 +1 @@
.slide-leave-active,
.slide-enter-active {
transition: 1s;
}
.slide-enter {
transform: translate(100%, 0);
}
.slide-leave-to {
transform: translate(-100%, 0);
}

View File

@@ -8,8 +8,7 @@ const showForm = ref<boolean>(false);
<div class="header" @click="showForm = !showForm">
<h2>{{ title }}</h2>
<button class="button">
<IconClose v-if="showForm"/>
<IconOpen v-else/>
<IconOpen class="icon" :class="{icon_close: showForm}"/>
</button>
</div>
<div class="content" v-show="showForm">
@@ -35,6 +34,14 @@ const showForm = ref<boolean>(false);
padding: 8px 0;
}
.icon {
transition: transform 0.2s;
&_close {
transform: rotate(180deg);
}
}
.button {
color: var(--icon-color);
}

View File

@@ -26,7 +26,7 @@ const activeProjection = ref<number>(0);
</Accordion>
<Accordion title="Проекции">
<GridContainer>
<GridElement v-for="(projection, i) in projections" :is-active="activeProjection === i" :key="projection"
<GridElement v-for="(projection, i) in projections" :key="projection" :is-active="activeProjection === i"
:title="projection" @click="activeProjection = i"/>
</GridContainer>
</Accordion>