primevue-mirror/doc/styleclass/AnimationDoc.vue

165 lines
4.2 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
Classes to apply during enter and leave animations are specified using the <i>enterClass</i>, <i>enterActiveClass</i>, <i>enterToClass</i>, <i>leaveClass</i>, <i>leaveActiveClass</i>,<i>leaveToClass</i>properties. In addition in case the
target is an overlay, <i>hideOnOutsideClick</i> would be handy to hide the target if outside of the popup is clicked.
</p>
</DocSectionText>
<div class="card flex flex-column align-items-center">
<div>
2024-03-27 08:30:38 +00:00
<Button v-styleclass="{ selector: '.box', enterClass: 'my-hidden', enterActiveClass: 'my-fadein' }" label="Show" class="mr-2" />
<Button v-styleclass="{ selector: '.box', leaveActiveClass: 'my-fadeout', leaveToClass: 'my-hidden' }" label="Hide" severity="secondary" />
2023-02-28 08:29:30 +00:00
</div>
2024-03-27 08:30:38 +00:00
<div class="my-hidden animation-duration-500 box">
2024-01-24 10:57:05 +00:00
<div class="flex bg-green-500 text-white align-items-center justify-content-center py-3 border-round-md mt-3 font-bold w-8rem h-8rem">Content</div>
2023-02-28 08:29:30 +00:00
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-03-27 08:30:38 +00:00
<Button v-styleclass="{ selector: '.box', enterClass: 'my-hidden', enterActiveClass: 'my-fadein' }" label="Show" class="mr-2" />
<Button v-styleclass="{ selector: '.box', leaveActiveClass: 'my-fadeout', leaveToClass: 'my-hidden' }" label="Hide" severity="secondary" />
<div class="my-hidden animation-duration-500 box">
2024-01-24 10:57:05 +00:00
<div class="flex bg-green-500 text-white align-items-center justify-content-center py-3 border-round-md mt-3 font-bold w-8rem h-8rem">Content</div>
2023-10-15 09:38:39 +00:00
</div>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-column align-items-center">
<div>
2024-03-27 08:30:38 +00:00
<Button v-styleclass="{ selector: '.box', enterClass: 'my-hidden', enterActiveClass: 'my-fadein' }" label="Show" class="mr-2" />
<Button v-styleclass="{ selector: '.box', leaveActiveClass: 'my-fadeout', leaveToClass: 'my-hidden' }" label="Hide" severity="secondary" />
2023-02-28 08:29:30 +00:00
</div>
2024-03-27 08:30:38 +00:00
<div class="my-hidden animation-duration-500 box">
2024-01-24 10:57:05 +00:00
<div class="flex bg-green-500 text-white align-items-center justify-content-center py-3 border-round-md mt-3 font-bold w-8rem h-8rem">Content</div>
2023-02-28 08:29:30 +00:00
</div>
</div>
</template>
<script>
<\/script>
<style scoped>
@keyframes my-fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes my-fadeout {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
2024-03-27 08:30:38 +00:00
.my-hidden {
display: none;
}
2023-02-28 08:29:30 +00:00
.my-fadein {
animation: my-fadein 150ms linear;
}
.my-fadeout {
animation: my-fadeout 150ms linear;
}
2023-10-15 09:38:39 +00:00
</style>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-column align-items-center">
<div>
2024-03-27 08:30:38 +00:00
<Button v-styleclass="{ selector: '.box', enterClass: 'my-hidden', enterActiveClass: 'my-fadein' }" label="Show" class="mr-2" />
<Button v-styleclass="{ selector: '.box', leaveActiveClass: 'my-fadeout', leaveToClass: 'my-hidden' }" label="Hide" severity="secondary" />
2023-02-28 08:29:30 +00:00
</div>
2024-03-27 08:30:38 +00:00
<div class="my-hidden animation-duration-500 box">
2024-01-24 10:57:05 +00:00
<div class="flex bg-green-500 text-white align-items-center justify-content-center py-3 border-round-md mt-3 font-bold w-8rem h-8rem">Content</div>
2023-02-28 08:29:30 +00:00
</div>
</div>
</template>
<script setup>
<\/script>
<style scoped>
@keyframes my-fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes my-fadeout {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
2024-03-27 08:30:38 +00:00
.my-hidden {
display: none;
}
2023-02-28 08:29:30 +00:00
.my-fadein {
animation: my-fadein 150ms linear;
}
.my-fadeout {
animation: my-fadeout 150ms linear;
}
2023-11-01 14:36:59 +00:00
</style>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>
<style lang="scss" scoped>
@keyframes my-fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes my-fadeout {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
2024-03-27 08:30:38 +00:00
.my-hidden {
display: none;
}
2023-02-28 08:29:30 +00:00
.my-fadein {
animation: my-fadein 150ms linear;
}
.my-fadeout {
animation: my-fadeout 150ms linear;
}
</style>