Original fade in transitions, PR now made into dev.
This commit is contained in:
@@ -99,6 +99,35 @@ h1 {
|
|||||||
grid-gap: 1rem;
|
grid-gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fade in title and cards and rows
|
||||||
|
.fade-title {
|
||||||
|
&-enter {
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
&-to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-active {
|
||||||
|
transition: opacity .1s ease-in-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-card {
|
||||||
|
&-enter {
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
&-to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-active {
|
||||||
|
transition: opacity .1s ease-in-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (max-width: 400px) {
|
@media (max-width: 400px) {
|
||||||
.layout {
|
.layout {
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
div
|
div
|
||||||
h1 {{ category.title }}
|
transition(name="fade-title" @after-enter="afterEnter")
|
||||||
.cards(v-if="areCardsVisible")
|
h1(v-if="showTitle") {{ category.title }}
|
||||||
template(v-for='resource in category.resources' )
|
transition(name="fade-card")
|
||||||
Card(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
|
.cards(v-if="areCardsVisible && showCards")
|
||||||
table(v-if="!areCardsVisible")
|
template(v-for='resource in category.resources' )
|
||||||
template(v-for='resource in category.resources' )
|
Card(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
|
||||||
TableRow(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
|
transition(name="fade-card")
|
||||||
|
table(v-if="!areCardsVisible && showCards")
|
||||||
|
template(v-for='resource in category.resources' )
|
||||||
|
TableRow(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -19,6 +22,8 @@ export default {
|
|||||||
categoryRouteTitle: this.$route.params.category,
|
categoryRouteTitle: this.$route.params.category,
|
||||||
index: '',
|
index: '',
|
||||||
activeCard: '',
|
activeCard: '',
|
||||||
|
showTitle: false,
|
||||||
|
showCards: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -42,8 +47,14 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
afterEnter(el) {
|
||||||
|
this.showCards = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.showTitle = true;
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.activeCard = this.$route.query.card || ''
|
this.activeCard = this.$route.query.card || ''
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user