mirror of
https://github.com/robonen/canvas-3d.git
synced 2026-03-20 02:44:40 +00:00
feat(components): accordion icon animation
This commit is contained in:
@@ -5,6 +5,7 @@ const SRC = resolve(__dirname, 'src');
|
|||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
srcDir: SRC,
|
srcDir: SRC,
|
||||||
|
ssr: false,
|
||||||
app: {
|
app: {
|
||||||
head: {
|
head: {
|
||||||
title: 'Canvas 3D',
|
title: 'Canvas 3D',
|
||||||
|
|||||||
@@ -1,12 +1 @@
|
|||||||
.slide-leave-active,
|
|
||||||
.slide-enter-active {
|
|
||||||
transition: 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-enter {
|
|
||||||
transform: translate(100%, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-leave-to {
|
|
||||||
transform: translate(-100%, 0);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ const showForm = ref<boolean>(false);
|
|||||||
<div class="header" @click="showForm = !showForm">
|
<div class="header" @click="showForm = !showForm">
|
||||||
<h2>{{ title }}</h2>
|
<h2>{{ title }}</h2>
|
||||||
<button class="button">
|
<button class="button">
|
||||||
<IconClose v-if="showForm"/>
|
<IconOpen class="icon" :class="{icon_close: showForm}"/>
|
||||||
<IconOpen v-else/>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content" v-show="showForm">
|
<div class="content" v-show="showForm">
|
||||||
@@ -35,6 +34,14 @@ const showForm = ref<boolean>(false);
|
|||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
transition: transform 0.2s;
|
||||||
|
|
||||||
|
&_close {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
color: var(--icon-color);
|
color: var(--icon-color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const activeProjection = ref<number>(0);
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
<Accordion title="Проекции">
|
<Accordion title="Проекции">
|
||||||
<GridContainer>
|
<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"/>
|
:title="projection" @click="activeProjection = i"/>
|
||||||
</GridContainer>
|
</GridContainer>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|||||||
Reference in New Issue
Block a user