primevue-mirror/doc/animateonscroll/BasicDoc.vue

253 lines
12 KiB
Vue
Raw Normal View History

<template>
<DocSectionText v-bind="$attrs">
2023-10-26 17:53:11 +00:00
<p>Animation classes are defined with the <i>enterClass</i> and <i>leaveClass</i> properties. This example utilizes PrimeFlex animations however any valid CSS animation is supported.</p>
</DocSectionText>
2023-10-26 17:53:11 +00:00
<div class="card flex flex-column align-items-center overflow-hidden">
2023-10-25 04:01:16 +00:00
<div class="flex flex-column align-items-center gap-2">
<span class="text-xl font-medium">Scroll Down</span>
<span class="slidedown-icon h-2rem w-2rem bg-primary border-circle inline-flex align-items-center justify-content-center">
<i class="pi pi-arrow-down" />
</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-25 04:01:16 +00:00
<span class="text-3xl font-bold">fade-in</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div
v-animateonscroll="{ enterClass: 'fadeinleft', leaveClass: 'fadeoutleft' }"
class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out"
>
2023-10-25 04:01:16 +00:00
<span class="text-3xl font-bold">fade-left</span>
</div>
2023-10-26 06:09:43 +00:00
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div
v-animateonscroll="{ enterClass: 'fadeinright', leaveClass: 'fadeoutright' }"
class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out"
>
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-right</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'zoomin', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">zoom</span>
2023-10-26 06:09:43 +00:00
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipleft', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-left</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipup', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-y</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'scalein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">scalein</span>
2023-10-26 06:09:43 +00:00
</div>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
<span class="text-3xl font-bold">fade-in</span>
</div>
<div v-animateonscroll="{ enterClass: 'fadeinleft', leaveClass: 'fadeoutleft' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
<span class="text-3xl font-bold">fade-left</span>
</div>
<div v-animateonscroll="{ enterClass: 'fadeinright', leaveClass: 'fadeoutright' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
<span class="text-3xl font-bold">fade-right</span>
</div>
<div v-animateonscroll="{ enterClass: 'zoomin', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
<span class="text-3xl font-bold">zoom</span>
</div>
<div v-animateonscroll="{ enterClass: 'flipleft', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
<span class="text-3xl font-bold">flip-left</span>
</div>
<div v-animateonscroll="{ enterClass: 'flipup', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
<span class="text-3xl font-bold">flip-y</span>
</div>
<div v-animateonscroll="{ enterClass: 'scalein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
<span class="text-3xl font-bold">scalein</span>
2023-10-15 09:38:39 +00:00
</div>
`,
options: `
<template>
<div class="card flex flex-column align-items-center">
2023-10-26 07:38:05 +00:00
<div class="flex flex-column align-items-center gap-2">
<span class="text-xl font-medium">Scroll Down</span>
<span class="slidedown-icon h-2rem w-2rem bg-primary border-circle inline-flex align-items-center justify-content-center">
<i class="pi pi-arrow-down" />
</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-in</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadeinleft', leaveClass: 'fadeoutleft' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-left</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadeinright', leaveClass: 'fadeoutright' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-right</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'zoomin', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">zoom</span>
2023-10-26 06:09:43 +00:00
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipleft', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-left</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipup', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-y</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'scalein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">scalein</span>
</div>
</div>
2023-10-15 09:38:39 +00:00
</template>
2023-10-26 17:53:11 +00:00
<style scoped>
@keyframes slidedown-icon {
0% {
transform: translateY(0);
}
50% {
transform: translateY(20px);
}
100% {
transform: translateY(0);
}
}
.slidedown-icon {
animation: slidedown-icon;
animation-duration: 3s;
animation-iteration-count: infinite;
}
.box {
2024-03-27 08:30:38 +00:00
background: var(--p-primary-color);
border-radius: 12px !important;
color: var(--p-primary-inverse-color);
2023-10-26 17:53:11 +00:00
}
</style>
2023-10-15 09:38:39 +00:00
`,
composition: `
<template>
<div class="card flex flex-column align-items-center">
2023-10-26 07:38:05 +00:00
<div class="flex flex-column align-items-center gap-2">
<span class="text-xl font-medium">Scroll Down</span>
<span class="slidedown-icon h-2rem w-2rem bg-primary border-circle inline-flex align-items-center justify-content-center">
<i class="pi pi-arrow-down" />
</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-in</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadeinleft', leaveClass: 'fadeoutleft' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-left</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'fadeinright', leaveClass: 'fadeoutright' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 06:09:43 +00:00
<span class="text-3xl font-bold">fade-right</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'zoomin', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">zoom</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipleft', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-left</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'flipup', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">flip-y</span>
</div>
<div class="h-30rem"></div>
2023-10-26 17:53:11 +00:00
<div v-animateonscroll="{ enterClass: 'scalein', leaveClass: 'fadeout' }" class="flex box shadow-4 justify-content-center align-items-center h-10rem w-10rem sm:h-15rem sm:w-15rem border-round animation-duration-1000 animation-ease-in-out">
2023-10-26 07:38:05 +00:00
<span class="text-3xl font-bold">scalein</span>
</div>
</div>
2023-10-26 06:29:07 +00:00
</template>
2023-10-26 17:53:11 +00:00
<style scoped>
@keyframes slidedown-icon {
0% {
transform: translateY(0);
}
50% {
transform: translateY(20px);
}
100% {
transform: translateY(0);
}
}
.slidedown-icon {
animation: slidedown-icon;
animation-duration: 3s;
animation-iteration-count: infinite;
}
.box {
2024-03-27 08:30:38 +00:00
background: var(--p-primary-color);
border-radius: 12px !important;
color: var(--p-primary-inverse-color);
2023-10-26 17:53:11 +00:00
}
</style>
2023-10-26 06:29:07 +00:00
`
}
};
}
};
</script>
2023-10-25 04:01:16 +00:00
<style scoped>
@keyframes slidedown-icon {
0% {
transform: translateY(0);
}
50% {
transform: translateY(20px);
}
100% {
transform: translateY(0);
}
}
.slidedown-icon {
animation: slidedown-icon;
animation-duration: 3s;
animation-iteration-count: infinite;
}
2023-10-26 17:53:11 +00:00
.box {
2024-03-27 08:30:38 +00:00
background: var(--p-primary-color);
border-radius: 12px !important;
color: var(--p-primary-inverse-color);
2023-10-26 17:53:11 +00:00
}
2023-10-25 04:01:16 +00:00
</style>