Skip to content

Commit c0f7ae4

Browse files
feat: add transition group
1 parent ebe119b commit c0f7ae4

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

website/src/catalog/RuleList.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const rules = computed(() => getRules(props.filter))
1616
<h2>
1717
Rule List
1818
</h2>
19-
<ul class="rule-list">
19+
<TransitionGroup class="rule-list" tag="ul">
2020
<li v-for="rule in rules" :key="rule.language + rule.id" class="rule-item">
2121
<div class="rule-header">
2222
<a :href="rule.link" class="rule-name">{{ rule.name }}</a>
@@ -44,7 +44,7 @@ const rules = computed(() => getRules(props.filter))
4444
</a>
4545
</div>
4646
</li>
47-
</ul>
47+
</TransitionGroup>
4848
</template>
4949

5050
<style scoped>
@@ -60,7 +60,6 @@ const rules = computed(() => getRules(props.filter))
6060
border: 1px solid #e2e8f0;
6161
border-radius: 8px;
6262
padding: 1rem;
63-
background: white;
6463
transition: all 0.2s ease;
6564
}
6665
@@ -79,7 +78,6 @@ const rules = computed(() => getRules(props.filter))
7978
.rule-name {
8079
font-size: 1.1rem;
8180
font-weight: 600;
82-
color: #2563eb;
8381
text-decoration: none;
8482
}
8583
@@ -143,7 +141,6 @@ const rules = computed(() => getRules(props.filter))
143141
display: inline-flex;
144142
align-items: center;
145143
gap: 0.25rem;
146-
color: #2563eb;
147144
text-decoration: none;
148145
font-size: 0.875rem;
149146
}
@@ -160,4 +157,18 @@ const rules = computed(() => getRules(props.filter))
160157
.playground-link:hover .arrow {
161158
transform: translateX(2px);
162159
}
160+
.v-move,
161+
.v-enter-active,
162+
.v-leave-active {
163+
transition: all 0.4s ease;
164+
}
165+
.v-enter-from,
166+
.v-leave-to {
167+
opacity: 0;
168+
transform: scale(0.9);
169+
}
170+
.v-leave-active {
171+
position: absolute;
172+
width: 100%;
173+
}
163174
</style>

0 commit comments

Comments
 (0)