Skip to content

Commit

Permalink
style: add animation and align content
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Dec 6, 2024
1 parent f3a3cd9 commit a52e5ee
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
37 changes: 36 additions & 1 deletion components/base/Accordion.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="column is-half">
<div>
<div class="card" :class="{ 'not-expanded': !expanded }">
<header class="card-header" @click="toggleCardState">
<p class="card-header-title">
Expand Down Expand Up @@ -42,3 +42,38 @@ export default {
},
};
</script>

<style lang="scss" scoped>
.card {
margin-bottom: 10px;
width: 100%;
.card-header {
cursor: pointer;
.icon {
transform: rotate(180deg);
transition: transform 150ms ease-out;
}
}
.card-content {
transition: all 150ms ease;
}
}
.card.not-expanded {
.card-header {
.icon {
transform: rotate(0deg);
}
}
.card-content {
transform: scaleY(0);
transform-origin: top;
opacity: 0;
height: 0;
padding: 0;
}
}
</style>
4 changes: 2 additions & 2 deletions components/storage/ServiceSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
matchingServices[i] ? 'has-background-info' : 'has-background-light',
]"
>
<div>
<div class="is-flex">
<button
class="button-nostyle"
type="button"
Expand All @@ -30,7 +30,7 @@
]"
/></span>
</button>
<Accordion title="{{humanize(s.name)}}">
<Accordion :title="humanize(s.name)">
<div class="content" v-html="$md.render(s.description || '')"></div>
</Accordion>
</div>
Expand Down

0 comments on commit a52e5ee

Please sign in to comment.