-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add new page-example for animation.
- Loading branch information
Showing
7 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script setup> | ||
import App from '../../examples/simple-animation/App.vue'; | ||
</script> | ||
|
||
# Custom Animation | ||
|
||
<App/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div> | ||
<button @click="openCodeModal">Open Again</button> | ||
|
||
<p>All information about current animation You can found in <b>examples/simple-animation</b></p> | ||
|
||
<modal-container/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import {config, container as ModalContainer, openModal} from "../../plugin/index"; | ||
import ModalProfile from "../pretty-modal/modals/modal-profile.vue"; | ||
import {onBeforeMount, onUnmounted} from "vue"; | ||
function openCodeModal() { | ||
openModal(ModalProfile); | ||
} | ||
/** | ||
* Please do it ones in main.ts, In this example I use onMounted and onUnmounted just for docs. In production, I recommend | ||
* init name of animation just in main.ts: | ||
* | ||
* // main.ts | ||
* | ||
* config({ | ||
* animation: 'your-custom-animation-name' | ||
* }) | ||
* */ | ||
onBeforeMount(() => { | ||
config({ | ||
animation: "custom-fade" | ||
}) | ||
}) | ||
onUnmounted(() => { | ||
config({ | ||
animation: "modal-list" | ||
}) | ||
}) | ||
</script> | ||
<style> | ||
@import "./../../web/default-style.css"; | ||
.custom-fade-enter-active, | ||
.custom-fade-leave-active, | ||
.custom-fade-enter-active .modal-item, | ||
.custom-fade-leave-active .modal-item{ | ||
transition: 1.0s; | ||
} | ||
.custom-fade-enter-from .modal-item, | ||
.custom-fade-leave-to .modal-item{ | ||
transform: scale(0); | ||
} | ||
.custom-fade-enter-from, | ||
.custom-fade-leave-to { | ||
background-color: transparent; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {createApp} from "vue" | ||
import App from "./App.vue"; | ||
import {config} from "../../plugin/utils/config"; | ||
|
||
config({ | ||
animation: "custom-fade" | ||
}) | ||
|
||
createApp(App) | ||
.mount("#app") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters