From 931f671dedbd44c94deef1923f127c9cf1053754 Mon Sep 17 00:00:00 2001 From: Aayush Date: Tue, 12 Nov 2024 18:14:52 +0530 Subject: [PATCH] Added toast animation --- src/components/toaster/Toast.jsx | 5 ++++- tailwind.config.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/toaster/Toast.jsx b/src/components/toaster/Toast.jsx index 5aea34c..29a42df 100644 --- a/src/components/toaster/Toast.jsx +++ b/src/components/toaster/Toast.jsx @@ -10,7 +10,10 @@ const Toast = ({ message, onClose, success }) => { }, []) return ( -
+
+
{ success ? : diff --git a/tailwind.config.js b/tailwind.config.js index 87bcef1..cbe4bc2 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -20,6 +20,10 @@ export default { 'in': { '0%': { transform: 'translateX(100%)', opacity: '0' }, '100%': { transform: 'translateX(0)', opacity: '1' } + }, + 'toast': { + '0%': { width: '100%' }, + '100%': { width: '0%' } } }, @@ -27,7 +31,8 @@ export default { 'load-1': 'loading 1s ease-in-out infinite', 'load-2': 'loading 1s ease-in-out 0.2s infinite', 'load-3': 'loading 1s ease-in-out 0.4s infinite', - 'in': 'in 0.2s ease-in-out' + 'in': 'in 0.2s ease-in-out', + 'toast': 'toast 4s linear forwards' } }, },