Vue js Bounce Transition
Web2tailwind.com

Output

Code

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
	<link href="https://unpkg.com/[email protected]^1.0/dist/tailwind.min.css" rel="stylesheet">
	<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
	<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto&display=swap" rel="stylesheet">
</head>

<body class="h-screen mt-12 container mx-auto" style="font-family:Roboto">
	<div id="app">
        <button type="button" @click="show = !show" class="bg-blue-600 text-gray-200 rounded hover:bg-blue-500 px-4 py-2 focus:outline-none">Toggle Button</button>
		<transition name="bounce">
			<p v-if="show">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris facilisis enim libero, at
				lacinia diam fermentum id. Pellentesque habitant morbi tristique senectus et netus.</p>
		</transition>
	</div>
	<script>
		new Vue({
	        el: '#app',
	        data: {
	            show: true
	        }
	    })
	</script>
	<style>
		.bounce-enter-active {
			animation: bounce-in .5s;
		}

		.bounce-leave-active {
			animation: bounce-in .5s reverse;
		}

		@keyframes bounce-in {
			0% {
				transform: scale(0);
			}

			50% {
				transform: scale(1.5);
			}

			100% {
				transform: scale(1);
			}
		}
	</style>
</body>

</html>
© 2019 - 2021 Web2tailwind.com