toastify-pro 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -37
- package/assets/site/site.webmanifest +1 -1
- package/dist/toastify-pro.esm.js +658 -67
- package/dist/toastify-pro.esm.js.map +1 -0
- package/dist/toastify-pro.umd.js +661 -71
- package/dist/toastify-pro.umd.js.map +1 -0
- package/dist/toastify-pro.umd.min.js +21 -1
- package/dist/toastify-pro.umd.min.js.map +1 -0
- package/package.json +46 -5
- package/src/toastify-pro.js +656 -66
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastify-pro.umd.js","sources":["../src/toastify-pro.js"],"sourcesContent":["/**\r\n * ToastifyPro - Modern Toast Notification Library\r\n * A beautiful, customizable toast notification library with glassmorphism design,\r\n * Apple AirDrop-style animations, and car swipe exit effects.\r\n * \r\n * Features:\r\n * - Glassmorphism design with backdrop-filter effects\r\n * - Apple AirDrop-style entrance animations\r\n * - Position-aware car swipe exit animations \r\n * - Description support for enhanced messaging\r\n * - Six theme variants (success, error, info, warning, dark, light)\r\n * - Progress bar with shimmer effects\r\n * - Responsive design for mobile devices\r\n * - Framework agnostic (works with React, Vue, Angular, etc.)\r\n * \r\n * @version 1.2.0\r\n * @author ToastifyPro Team\r\n * @license MIT\r\n */\r\nclass ToastifyPro {\r\n /**\r\n * Creates a new ToastifyPro instance\r\n * @param {Object} options - Configuration options\r\n * @param {string} options.position - Toast position (top-left, top-right, bottom-left, bottom-right, top-center, bottom-center)\r\n * @param {number} options.timeout - Auto-dismiss timeout in milliseconds (0 to disable)\r\n * @param {boolean} options.allowClose - Whether to show close button\r\n * @param {number} options.maxLength - Maximum message length\r\n */\r\n constructor(options = {}) {\r\n // Validate options parameter\r\n if (typeof options !== 'object' || options === null) {\r\n console.warn('ToastifyPro: Invalid options parameter. Using defaults.');\r\n options = {};\r\n }\r\n\r\n // Merge with default options\r\n this.defaultOptions = {\r\n position: options.position || \"bottom-center\", // top-left, top-right, bottom-left, bottom-right, top-center, bottom-center\r\n timeout: options.timeout || 3000,\r\n allowClose: options.allowClose !== false, // default true\r\n maxLength: options.maxLength || 100,\r\n };\r\n\r\n // Validate position\r\n const validPositions = ['top-left', 'top-right', 'bottom-left', 'bottom-right', 'top-center', 'bottom-center'];\r\n if (!validPositions.includes(this.defaultOptions.position)) {\r\n console.warn(`ToastifyPro: Invalid position \"${this.defaultOptions.position}\". Using \"bottom-center\".`);\r\n this.defaultOptions.position = \"bottom-center\";\r\n }\r\n\r\n // Check if we're in a browser environment\r\n if (typeof document === 'undefined') {\r\n throw new Error('ToastifyPro: This library requires a DOM environment (browser).');\r\n }\r\n\r\n // Create or reuse container for this position\r\n const existing = document.querySelector(\r\n `.toastify-pro-container.${this.defaultOptions.position}`\r\n );\r\n \r\n if (existing) {\r\n this.container = existing;\r\n } else {\r\n try {\r\n this.container = document.createElement(\"div\");\r\n this.container.className = `toastify-pro-container ${this.defaultOptions.position}`;\r\n document.body.appendChild(this.container);\r\n } catch (error) {\r\n throw new Error('ToastifyPro: Failed to create container element. DOM may not be ready.');\r\n }\r\n }\r\n\r\n // Inject styles once\r\n this.injectStyles();\r\n }\r\n\r\n /**\r\n * Returns the SVG icon for a given toast type\r\n * @param {string} type - Toast type (success, error, info, warning, dark, light)\r\n * @returns {string} SVG icon markup\r\n */\r\n getIconSVG(type) {\r\n // Validate type parameter\r\n if (typeof type !== 'string') {\r\n console.warn('ToastifyPro: Invalid icon type. Using default info icon.');\r\n type = 'info';\r\n }\r\n\r\n const icons = {\r\n success: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n error: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n info: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n warning: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n dark: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n light: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M9 11H7v6h2v-6zm4 0h-2v6h2v-6zm4 0h-2v6h2v-6zm2.5-9H19V1h-2v1H7V1H5v1H4.5C3.11 2 2 3.11 2 4.5v14C2 19.89 3.11 21 4.5 21h15c1.39 0 2.5-1.11 2.5-2.5v-14C22 3.11 20.89 2 19.5 2zm0 16h-15v-11h15v11z\" fill=\"currentColor\"/>\r\n </svg>`\r\n };\r\n \r\n return icons[type] || icons.info;\r\n }\r\n\r\n /**\r\n * Injects the CSS styles into the document head\r\n * Styles include glassmorphism design, animations, and responsive layout\r\n */\r\n injectStyles() {\r\n // Prevent duplicate style injection\r\n if (document.getElementById(\"toastify-pro-styles\")) return;\r\n \r\n try {\r\n const style = document.createElement(\"style\");\r\n style.id = \"toastify-pro-styles\";\r\n style.textContent = `\r\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');\r\n \r\n .toastify-pro-container {\r\n position: fixed;\r\n z-index: 9999;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 16px;\r\n pointer-events: none;\r\n }\r\n .toastify-pro-container.top-left { top: 50px; left: 24px; align-items: flex-start; }\r\n .toastify-pro-container.top-right { top: 50px; right: 24px; align-items: flex-end; }\r\n .toastify-pro-container.bottom-left { bottom: 50px; left: 24px; align-items: flex-start; }\r\n .toastify-pro-container.bottom-right { bottom: 50px; right: 24px; align-items: flex-end; }\r\n .toastify-pro-container.top-center { top: 50px; left: 50%; transform: translateX(-50%); }\r\n .toastify-pro-container.bottom-center { bottom: 50px; left: 50%; transform: translateX(-50%); }\r\n\r\n .toastify-pro {\r\n min-width: 280px;\r\n max-width: 400px;\r\n padding: 20px 24px;\r\n border-radius: 16px;\r\n font-size: 15px;\r\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\r\n font-weight: 500;\r\n color: white;\r\n opacity: 0;\r\n transform: scale(0.3);\r\n transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\r\n pointer-events: auto;\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n backdrop-filter: blur(20px);\r\n border: 1px solid rgba(255, 255, 255, 0.1);\r\n box-shadow: \r\n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\r\n 0 10px 10px -5px rgba(0, 0, 0, 0.04),\r\n 0 0 0 1px rgba(255, 255, 255, 0.05);\r\n overflow: hidden;\r\n }\r\n \r\n .toastify-pro::before {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: 3px;\r\n background: linear-gradient(90deg, \r\n rgba(255, 255, 255, 0.8) 0%,\r\n rgba(255, 255, 255, 0.4) 50%,\r\n rgba(255, 255, 255, 0.8) 100%);\r\n animation: shimmer 2s infinite;\r\n transition: opacity 0.8s ease;\r\n }\r\n \r\n .toastify-pro::after {\r\n content: '';\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n height: 3px;\r\n background: rgba(255, 255, 255, 0.6);\r\n animation: progress var(--duration, 5s) linear;\r\n border-radius: 0 0 16px 16px;\r\n }\r\n \r\n @keyframes airdropPop {\r\n 0% { \r\n opacity: 0;\r\n transform: scale(0.3) rotateY(-20deg); \r\n }\r\n 30% { \r\n opacity: 0.8;\r\n transform: scale(1.1) rotateY(10deg); \r\n }\r\n 60% { \r\n opacity: 1;\r\n transform: scale(0.98) rotateY(-3deg); \r\n }\r\n 100% { \r\n opacity: 1;\r\n transform: scale(1) rotateY(0deg); \r\n }\r\n }\r\n \r\n @keyframes carSwipeBottom {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(-8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateY(200px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeTop {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateY(-200px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeLeft {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateX(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateX(8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateX(-300px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeRight {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateX(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateX(-8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateX(300px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeCenter {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(-5px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.6) translateY(150px); \r\n }\r\n }\r\n \r\n @keyframes progress {\r\n 0% { width: 100%; }\r\n 100% { width: 0%; }\r\n }\r\n \r\n @keyframes shimmer {\r\n 0% { transform: translateX(-100%); }\r\n 100% { transform: translateX(100%); }\r\n }\r\n \r\n .toastify-pro.show { \r\n opacity: 1; \r\n transform: scale(1);\r\n animation: airdropPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\r\n }\r\n \r\n .toastify-pro.success { \r\n background: linear-gradient(135deg, \r\n rgba(34, 197, 94, 0.9) 0%,\r\n rgba(21, 128, 61, 0.9) 100%);\r\n border-color: rgba(34, 197, 94, 0.3);\r\n }\r\n \r\n .toastify-pro.error { \r\n background: linear-gradient(135deg, \r\n rgba(239, 68, 68, 0.9) 0%,\r\n rgba(185, 28, 28, 0.9) 100%);\r\n border-color: rgba(239, 68, 68, 0.3);\r\n }\r\n \r\n .toastify-pro.info { \r\n background: linear-gradient(135deg, \r\n rgba(59, 130, 246, 0.9) 0%,\r\n rgba(29, 78, 216, 0.9) 100%);\r\n border-color: rgba(59, 130, 246, 0.3);\r\n }\r\n \r\n .toastify-pro.warning { \r\n background: linear-gradient(135deg, \r\n rgba(245, 158, 11, 0.9) 0%,\r\n rgba(217, 119, 6, 0.9) 100%);\r\n border-color: rgba(245, 158, 11, 0.3);\r\n }\r\n \r\n .toastify-pro.dark { \r\n background: linear-gradient(135deg, \r\n rgba(15, 23, 42, 0.95) 0%,\r\n rgba(30, 41, 59, 0.95) 100%);\r\n border-color: rgba(148, 163, 184, 0.2);\r\n }\r\n \r\n .toastify-pro.light { \r\n background: linear-gradient(135deg, \r\n rgba(255, 255, 255, 0.95) 0%,\r\n rgba(248, 250, 252, 0.95) 100%);\r\n color: #1e293b;\r\n border-color: rgba(226, 232, 240, 0.8);\r\n box-shadow: \r\n 0 20px 25px -5px rgba(0, 0, 0, 0.08),\r\n 0 10px 10px -5px rgba(0, 0, 0, 0.03);\r\n }\r\n \r\n .toastify-pro.light::before {\r\n background: linear-gradient(90deg, \r\n rgba(30, 41, 59, 0.8) 0%,\r\n rgba(30, 41, 59, 0.4) 50%,\r\n rgba(30, 41, 59, 0.8) 100%);\r\n }\r\n \r\n .toastify-pro.light::after {\r\n background: rgba(30, 41, 59, 0.6);\r\n }\r\n\r\n .toastify-pro .toast-icon {\r\n flex-shrink: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 28px;\r\n height: 28px;\r\n border-radius: 50%;\r\n background: rgba(255, 255, 255, 0.2);\r\n backdrop-filter: blur(10px);\r\n animation: iconPulse 2s infinite;\r\n }\r\n \r\n @keyframes iconPulse {\r\n 0%, 100% { transform: scale(1); }\r\n 50% { transform: scale(1.05); }\r\n }\r\n \r\n @keyframes iconBounce {\r\n 0% { transform: scale(0.2) rotate(-15deg); }\r\n 40% { transform: scale(1.2) rotate(8deg); }\r\n 70% { transform: scale(0.95) rotate(-3deg); }\r\n 100% { transform: scale(1) rotate(0deg); }\r\n }\r\n \r\n @keyframes iconCarExit {\r\n 0% { \r\n transform: scale(1) rotate(0deg); \r\n opacity: 1;\r\n }\r\n 20% { \r\n transform: scale(1.1) rotate(-10deg); \r\n opacity: 0.9;\r\n }\r\n 100% { \r\n transform: scale(0.3) rotate(180deg); \r\n opacity: 0;\r\n }\r\n }\r\n\r\n .toastify-pro .toast-icon svg {\r\n width: 18px;\r\n height: 18px;\r\n color: inherit;\r\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\r\n }\r\n\r\n .toastify-pro.light .toast-icon {\r\n background: rgba(15, 23, 42, 0.1);\r\n }\r\n\r\n .toastify-pro .toast-content {\r\n flex: 1;\r\n line-height: 1.5;\r\n font-weight: 500;\r\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n .toastify-pro .toast-message {\r\n font-size: 15px;\r\n font-weight: 500;\r\n margin-bottom: 0;\r\n }\r\n\r\n .toastify-pro .toast-description {\r\n font-size: 13px;\r\n font-weight: 400;\r\n opacity: 0.85;\r\n margin-top: 4px;\r\n line-height: 1.4;\r\n }\r\n\r\n .toastify-pro .close-btn {\r\n cursor: pointer;\r\n font-size: 20px;\r\n color: inherit;\r\n opacity: 0.7;\r\n padding: 8px;\r\n border-radius: 50%;\r\n transition: all 0.2s ease;\r\n flex-shrink: 0;\r\n width: 32px;\r\n height: 32px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: rgba(255, 255, 255, 0.1);\r\n backdrop-filter: blur(10px);\r\n font-weight: 300;\r\n line-height: 1;\r\n }\r\n \r\n .toastify-pro .close-btn:hover { \r\n opacity: 1; \r\n background: rgba(255, 255, 255, 0.2);\r\n transform: scale(1.1);\r\n }\r\n \r\n .toastify-pro.light .close-btn {\r\n background: rgba(15, 23, 42, 0.08);\r\n }\r\n \r\n .toastify-pro.light .close-btn:hover { \r\n background: rgba(15, 23, 42, 0.15);\r\n }\r\n \r\n @media (max-width: 640px) {\r\n .toastify-pro {\r\n min-width: 260px;\r\n max-width: calc(100vw - 48px);\r\n margin: 0 8px;\r\n }\r\n \r\n .toastify-pro-container.top-left,\r\n .toastify-pro-container.bottom-left { left: 16px; }\r\n .toastify-pro-container.top-right,\r\n .toastify-pro-container.bottom-right { right: 16px; }\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n } catch (error) {\r\n console.error('ToastifyPro: Failed to inject styles:', error);\r\n }\r\n }\r\n\r\n /**\r\n * Creates and displays a toast notification\r\n * @param {string} message - Main message text\r\n * @param {string} type - Toast type (success, error, info, warning, dark, light)\r\n * @param {Object} opts - Additional options\r\n * @param {string} opts.description - Optional description text\r\n * @param {number} opts.timeout - Override default timeout\r\n * @param {boolean} opts.allowClose - Override close button setting\r\n * @param {number} opts.maxLength - Override max message length\r\n */\r\n show(message, type = \"dark\", opts = {}) {\r\n // Input validation\r\n if (typeof message !== 'string') {\r\n console.warn('ToastifyPro: Message must be a string. Converting to string.');\r\n message = String(message);\r\n }\r\n\r\n if (!message.trim()) {\r\n console.warn('ToastifyPro: Empty message provided.');\r\n return;\r\n }\r\n\r\n // Validate type\r\n const validTypes = ['success', 'error', 'info', 'warning', 'dark', 'light'];\r\n if (!validTypes.includes(type)) {\r\n console.warn(`ToastifyPro: Invalid type \"${type}\". Using \"dark\".`);\r\n type = 'dark';\r\n }\r\n\r\n // Validate and merge options\r\n if (typeof opts !== 'object' || opts === null) {\r\n console.warn('ToastifyPro: Invalid options parameter. Using defaults.');\r\n opts = {};\r\n }\r\n\r\n const options = { ...this.defaultOptions, ...opts };\r\n\r\n try {\r\n // Create toast element\r\n const toast = document.createElement(\"div\");\r\n toast.className = `toastify-pro ${type}`;\r\n \r\n // Set duration for progress bar animation\r\n if (options.timeout > 0) {\r\n toast.style.setProperty('--duration', `${options.timeout}ms`);\r\n }\r\n\r\n // Create icon wrapper\r\n const iconWrapper = document.createElement(\"div\");\r\n iconWrapper.className = \"toast-icon\";\r\n iconWrapper.innerHTML = this.getIconSVG(type);\r\n toast.appendChild(iconWrapper);\r\n\r\n // Create content wrapper for the message and description\r\n const contentWrapper = document.createElement(\"div\");\r\n contentWrapper.className = \"toast-content\";\r\n \r\n // Main message\r\n const messageElement = document.createElement(\"div\");\r\n messageElement.className = \"toast-message\";\r\n messageElement.textContent = message.substring(0, options.maxLength);\r\n contentWrapper.appendChild(messageElement);\r\n \r\n // Optional description (if provided)\r\n if (options.description && typeof options.description === 'string') {\r\n const descriptionElement = document.createElement(\"div\");\r\n descriptionElement.className = \"toast-description\";\r\n descriptionElement.textContent = options.description.substring(0, options.maxLength * 2);\r\n contentWrapper.appendChild(descriptionElement);\r\n }\r\n \r\n toast.appendChild(contentWrapper);\r\n\r\n // Add close button if enabled\r\n if (options.allowClose) {\r\n const closeBtn = document.createElement(\"span\");\r\n closeBtn.className = \"close-btn\";\r\n closeBtn.innerHTML = \"×\";\r\n closeBtn.setAttribute('aria-label', 'Close notification');\r\n closeBtn.onclick = () => this.removeToast(toast);\r\n toast.appendChild(closeBtn);\r\n }\r\n\r\n // Add toast to container\r\n this.container.appendChild(toast);\r\n\r\n // Apple AirDrop-style entrance animation\r\n setTimeout(() => {\r\n toast.classList.add(\"show\");\r\n // Add icon bounce effect with Apple-style timing\r\n const icon = toast.querySelector('.toast-icon');\r\n if (icon) {\r\n icon.style.animation = 'iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)';\r\n }\r\n }, 10);\r\n\r\n // Auto-remove after timeout\r\n if (options.timeout > 0) {\r\n setTimeout(() => this.removeToast(toast), options.timeout);\r\n }\r\n\r\n return toast; // Return element for potential future manipulation\r\n } catch (error) {\r\n console.error('ToastifyPro: Failed to create toast:', error);\r\n }\r\n }\r\n\r\n /**\r\n * Removes a toast with position-aware car swipe animation\r\n * @param {HTMLElement} toast - Toast element to remove\r\n */\r\n removeToast(toast) {\r\n if (!toast || !toast.parentNode) {\r\n console.warn('ToastifyPro: Invalid toast element for removal.');\r\n return;\r\n }\r\n\r\n try {\r\n // Detect position to choose the right swipe direction\r\n const container = toast.parentNode;\r\n const position = container.className.split(' ')[1]; // get position class\r\n \r\n let swipeAnimation = 'carSwipeBottom'; // default fallback\r\n \r\n // Choose animation based on position - car swipes away from screen edge\r\n if (position.includes('bottom')) {\r\n swipeAnimation = 'carSwipeBottom'; // swipe down off screen\r\n } else if (position.includes('top')) {\r\n swipeAnimation = 'carSwipeTop'; // swipe up off screen\r\n } else if (position.includes('left')) {\r\n swipeAnimation = 'carSwipeLeft'; // swipe left off screen\r\n } else if (position.includes('right')) {\r\n swipeAnimation = 'carSwipeRight'; // swipe right off screen\r\n } else if (position.includes('center')) {\r\n swipeAnimation = 'carSwipeCenter'; // swipe down for center\r\n }\r\n \r\n // Apply fast car swipe animation with improved easing\r\n toast.style.animation = `${swipeAnimation} 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards`;\r\n \r\n // Add spinning icon animation for extra polish\r\n const icon = toast.querySelector('.toast-icon');\r\n if (icon) {\r\n icon.style.animation = 'iconCarExit 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards';\r\n }\r\n \r\n // Remove element after animation completes\r\n setTimeout(() => {\r\n if (toast.parentNode) {\r\n toast.remove();\r\n }\r\n }, 400);\r\n } catch (error) {\r\n console.error('ToastifyPro: Error removing toast:', error);\r\n // Fallback: remove immediately if animation fails\r\n if (toast.parentNode) {\r\n toast.remove();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Shows a success toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n success(msg, opts) {\r\n // Handle both (message) and (message, description) formats\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"success\", opts);\r\n }\r\n\r\n /**\r\n * Shows an error toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n error(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"error\", opts);\r\n }\r\n\r\n /**\r\n * Shows an info toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n info(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"info\", opts);\r\n }\r\n\r\n /**\r\n * Shows a warning toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n warning(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"warning\", opts);\r\n }\r\n\r\n /**\r\n * Shows a dark-themed toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n dark(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"dark\", opts);\r\n }\r\n\r\n /**\r\n * Shows a light-themed toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n light(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"light\", opts);\r\n }\r\n}\r\n\r\n/**\r\n * Export for different environments\r\n * Supports CommonJS (Node.js), AMD, and browser globals\r\n */\r\n\r\n// CommonJS export (Node.js/npm)\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = ToastifyPro;\r\n}\r\n\r\n// ES6 module export\r\nif (typeof exports !== 'undefined') {\r\n exports.ToastifyPro = ToastifyPro;\r\n exports.default = ToastifyPro;\r\n}\r\n\r\n// AMD export (RequireJS)\r\nif (typeof define === 'function' && define.amd) {\r\n define(function() {\r\n return ToastifyPro;\r\n });\r\n}\r\n\r\n// Browser global\r\nif (typeof window !== 'undefined') {\r\n window.ToastifyPro = ToastifyPro;\r\n}\r\n"],"names":[],"mappings":";;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,WAAW,CAAC;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;EAC5B;EACA,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE;EACzD,MAAM,OAAO,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;EAC9E,MAAM,OAAO,GAAG,EAAE,CAAC;EACnB,IAAI,CAAC;AACL;EACA;E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C,OAAO,CAAC,CAAC;EACpD,MAAM,KAAK,CAAC,EAAE,GAAG,qBAAqB,CAAC;EACvC,MAAM,KAAK,CAAC,WAAW,GAAG,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,CAAC,CAAC;EACJ,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;EACvC,IAAI,CAAC,CAAC,OAAO,KAAK,EAAE;EACpB,MAAM,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;EACpE,IAAI,CAAC;EACL,EAAE,CAAC;AACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE;EAC1C;EACA,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;EACrC,MAAM,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;EACnF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;EAChC,IAAI,CAAC;AACL;EACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;EACzB,MAAM,OAAO,CAAC,IAAI,C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D;EACA;EACA,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,EAAE;EAChD,EAAE,MAAM,CAAC,WAAW;EACpB,IAAI,OAAO,WAAW,CAAC;EACvB,EAAE,CAAC,CAAC,CAAC;EACL,CAAC;AACD;EACA;EACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;EACnC,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;EACnC;;;;;;"}
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ToastifyPro - Modern Toast Notification Library
|
|
4
|
+
* A beautiful, customizable toast notification library with glassmorphism design,
|
|
5
|
+
* Apple AirDrop-style animations, and car swipe exit effects.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Glassmorphism design with backdrop-filter effects
|
|
9
|
+
* - Apple AirDrop-style entrance animations
|
|
10
|
+
* - Position-aware car swipe exit animations
|
|
11
|
+
* - Description support for enhanced messaging
|
|
12
|
+
* - Six theme variants (success, error, info, warning, dark, light)
|
|
13
|
+
* - Progress bar with shimmer effects
|
|
14
|
+
* - Responsive design for mobile devices
|
|
15
|
+
* - Framework agnostic (works with React, Vue, Angular, etc.)
|
|
16
|
+
*
|
|
17
|
+
* @version 1.2.0
|
|
18
|
+
* @author ToastifyPro Team
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/class n{constructor(n={}){"object"==typeof n&&null!==n||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),n={}),this.defaultOptions={position:n.position||"bottom-center",timeout:n.timeout||3e3,allowClose:!1!==n.allowClose,maxLength:n.maxLength||100};if(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center"].includes(this.defaultOptions.position)||(console.warn(`ToastifyPro: Invalid position "${this.defaultOptions.position}". Using "bottom-center".`),this.defaultOptions.position="bottom-center"),"undefined"==typeof document)throw new Error("ToastifyPro: This library requires a DOM environment (browser).");const t=document.querySelector(`.toastify-pro-container.${this.defaultOptions.position}`);if(t)this.container=t;else try{this.container=document.createElement("div"),this.container.className=`toastify-pro-container ${this.defaultOptions.position}`,document.body.appendChild(this.container)}catch(n){throw new Error("ToastifyPro: Failed to create container element. DOM may not be ready.")}this.injectStyles()}getIconSVG(n){"string"!=typeof n&&(console.warn("ToastifyPro: Invalid icon type. Using default info icon."),n="info");const t={success:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>\n </svg>',error:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" fill="currentColor"/>\n </svg>',info:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" fill="currentColor"/>\n </svg>',warning:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" fill="currentColor"/>\n </svg>',dark:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="currentColor"/>\n </svg>',light:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 11H7v6h2v-6zm4 0h-2v6h2v-6zm4 0h-2v6h2v-6zm2.5-9H19V1h-2v1H7V1H5v1H4.5C3.11 2 2 3.11 2 4.5v14C2 19.89 3.11 21 4.5 21h15c1.39 0 2.5-1.11 2.5-2.5v-14C22 3.11 20.89 2 19.5 2zm0 16h-15v-11h15v11z" fill="currentColor"/>\n </svg>'};return t[n]||t.info}injectStyles(){if(!document.getElementById("toastify-pro-styles"))try{const n=document.createElement("style");n.id="toastify-pro-styles",n.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');\n \n .toastify-pro-container {\n position: fixed;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 16px;\n pointer-events: none;\n }\n .toastify-pro-container.top-left { top: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.top-right { top: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.bottom-left { bottom: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.bottom-right { bottom: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.top-center { top: 50px; left: 50%; transform: translateX(-50%); }\n .toastify-pro-container.bottom-center { bottom: 50px; left: 50%; transform: translateX(-50%); }\n\n .toastify-pro {\n min-width: 280px;\n max-width: 400px;\n padding: 20px 24px;\n border-radius: 16px;\n font-size: 15px;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n font-weight: 500;\n color: white;\n opacity: 0;\n transform: scale(0.3);\n transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n pointer-events: auto;\n position: relative;\n display: flex;\n align-items: center;\n gap: 16px;\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 10px 10px -5px rgba(0, 0, 0, 0.04),\n 0 0 0 1px rgba(255, 255, 255, 0.05);\n overflow: hidden;\n }\n \n .toastify-pro::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 3px;\n background: linear-gradient(90deg, \n rgba(255, 255, 255, 0.8) 0%,\n rgba(255, 255, 255, 0.4) 50%,\n rgba(255, 255, 255, 0.8) 100%);\n animation: shimmer 2s infinite;\n transition: opacity 0.8s ease;\n }\n \n .toastify-pro::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3px;\n background: rgba(255, 255, 255, 0.6);\n animation: progress var(--duration, 5s) linear;\n border-radius: 0 0 16px 16px;\n }\n \n @keyframes airdropPop {\n 0% { \n opacity: 0;\n transform: scale(0.3) rotateY(-20deg); \n }\n 30% { \n opacity: 0.8;\n transform: scale(1.1) rotateY(10deg); \n }\n 60% { \n opacity: 1;\n transform: scale(0.98) rotateY(-3deg); \n }\n 100% { \n opacity: 1;\n transform: scale(1) rotateY(0deg); \n }\n }\n \n @keyframes carSwipeBottom {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(200px); \n }\n }\n \n @keyframes carSwipeTop {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(-200px); \n }\n }\n \n @keyframes carSwipeLeft {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(-300px); \n }\n }\n \n @keyframes carSwipeRight {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(300px); \n }\n }\n \n @keyframes carSwipeCenter {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-5px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.6) translateY(150px); \n }\n }\n \n @keyframes progress {\n 0% { width: 100%; }\n 100% { width: 0%; }\n }\n \n @keyframes shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(100%); }\n }\n \n .toastify-pro.show { \n opacity: 1; \n transform: scale(1);\n animation: airdropPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n }\n \n .toastify-pro.success { \n background: linear-gradient(135deg, \n rgba(34, 197, 94, 0.9) 0%,\n rgba(21, 128, 61, 0.9) 100%);\n border-color: rgba(34, 197, 94, 0.3);\n }\n \n .toastify-pro.error { \n background: linear-gradient(135deg, \n rgba(239, 68, 68, 0.9) 0%,\n rgba(185, 28, 28, 0.9) 100%);\n border-color: rgba(239, 68, 68, 0.3);\n }\n \n .toastify-pro.info { \n background: linear-gradient(135deg, \n rgba(59, 130, 246, 0.9) 0%,\n rgba(29, 78, 216, 0.9) 100%);\n border-color: rgba(59, 130, 246, 0.3);\n }\n \n .toastify-pro.warning { \n background: linear-gradient(135deg, \n rgba(245, 158, 11, 0.9) 0%,\n rgba(217, 119, 6, 0.9) 100%);\n border-color: rgba(245, 158, 11, 0.3);\n }\n \n .toastify-pro.dark { \n background: linear-gradient(135deg, \n rgba(15, 23, 42, 0.95) 0%,\n rgba(30, 41, 59, 0.95) 100%);\n border-color: rgba(148, 163, 184, 0.2);\n }\n \n .toastify-pro.light { \n background: linear-gradient(135deg, \n rgba(255, 255, 255, 0.95) 0%,\n rgba(248, 250, 252, 0.95) 100%);\n color: #1e293b;\n border-color: rgba(226, 232, 240, 0.8);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.08),\n 0 10px 10px -5px rgba(0, 0, 0, 0.03);\n }\n \n .toastify-pro.light::before {\n background: linear-gradient(90deg, \n rgba(30, 41, 59, 0.8) 0%,\n rgba(30, 41, 59, 0.4) 50%,\n rgba(30, 41, 59, 0.8) 100%);\n }\n \n .toastify-pro.light::after {\n background: rgba(30, 41, 59, 0.6);\n }\n\n .toastify-pro .toast-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n backdrop-filter: blur(10px);\n animation: iconPulse 2s infinite;\n }\n \n @keyframes iconPulse {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n }\n \n @keyframes iconBounce {\n 0% { transform: scale(0.2) rotate(-15deg); }\n 40% { transform: scale(1.2) rotate(8deg); }\n 70% { transform: scale(0.95) rotate(-3deg); }\n 100% { transform: scale(1) rotate(0deg); }\n }\n \n @keyframes iconCarExit {\n 0% { \n transform: scale(1) rotate(0deg); \n opacity: 1;\n }\n 20% { \n transform: scale(1.1) rotate(-10deg); \n opacity: 0.9;\n }\n 100% { \n transform: scale(0.3) rotate(180deg); \n opacity: 0;\n }\n }\n\n .toastify-pro .toast-icon svg {\n width: 18px;\n height: 18px;\n color: inherit;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n }\n\n .toastify-pro.light .toast-icon {\n background: rgba(15, 23, 42, 0.1);\n }\n\n .toastify-pro .toast-content {\n flex: 1;\n line-height: 1.5;\n font-weight: 500;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n\n .toastify-pro .toast-message {\n font-size: 15px;\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .toastify-pro .toast-description {\n font-size: 13px;\n font-weight: 400;\n opacity: 0.85;\n margin-top: 4px;\n line-height: 1.4;\n }\n\n .toastify-pro .close-btn {\n cursor: pointer;\n font-size: 20px;\n color: inherit;\n opacity: 0.7;\n padding: 8px;\n border-radius: 50%;\n transition: all 0.2s ease;\n flex-shrink: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.1);\n backdrop-filter: blur(10px);\n font-weight: 300;\n line-height: 1;\n }\n \n .toastify-pro .close-btn:hover { \n opacity: 1; \n background: rgba(255, 255, 255, 0.2);\n transform: scale(1.1);\n }\n \n .toastify-pro.light .close-btn {\n background: rgba(15, 23, 42, 0.08);\n }\n \n .toastify-pro.light .close-btn:hover { \n background: rgba(15, 23, 42, 0.15);\n }\n \n @media (max-width: 640px) {\n .toastify-pro {\n min-width: 260px;\n max-width: calc(100vw - 48px);\n margin: 0 8px;\n }\n \n .toastify-pro-container.top-left,\n .toastify-pro-container.bottom-left { left: 16px; }\n .toastify-pro-container.top-right,\n .toastify-pro-container.bottom-right { right: 16px; }\n }\n ",document.head.appendChild(n)}catch(n){console.error("ToastifyPro: Failed to inject styles:",n)}}show(n,t="dark",o={}){if("string"!=typeof n&&(console.warn("ToastifyPro: Message must be a string. Converting to string."),n=String(n)),!n.trim())return void console.warn("ToastifyPro: Empty message provided.");["success","error","info","warning","dark","light"].includes(t)||(console.warn(`ToastifyPro: Invalid type "${t}". Using "dark".`),t="dark"),"object"==typeof o&&null!==o||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),o={});const e={...this.defaultOptions,...o};try{const o=document.createElement("div");o.className=`toastify-pro ${t}`,e.timeout>0&&o.style.setProperty("--duration",`${e.timeout}ms`);const r=document.createElement("div");r.className="toast-icon",r.innerHTML=this.getIconSVG(t),o.appendChild(r);const a=document.createElement("div");a.className="toast-content";const i=document.createElement("div");if(i.className="toast-message",i.textContent=n.substring(0,e.maxLength),a.appendChild(i),e.description&&"string"==typeof e.description){const n=document.createElement("div");n.className="toast-description",n.textContent=e.description.substring(0,2*e.maxLength),a.appendChild(n)}if(o.appendChild(a),e.allowClose){const n=document.createElement("span");n.className="close-btn",n.innerHTML="×",n.setAttribute("aria-label","Close notification"),n.onclick=()=>this.removeToast(o),o.appendChild(n)}return this.container.appendChild(o),setTimeout(()=>{o.classList.add("show");const n=o.querySelector(".toast-icon");n&&(n.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)")},10),e.timeout>0&&setTimeout(()=>this.removeToast(o),e.timeout),o}catch(n){console.error("ToastifyPro: Failed to create toast:",n)}}removeToast(n){if(n&&n.parentNode)try{const t=n.parentNode.className.split(" ")[1];let o="carSwipeBottom";t.includes("bottom")?o="carSwipeBottom":t.includes("top")?o="carSwipeTop":t.includes("left")?o="carSwipeLeft":t.includes("right")?o="carSwipeRight":t.includes("center")&&(o="carSwipeCenter"),n.style.animation=`${o} 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards`;const e=n.querySelector(".toast-icon");e&&(e.style.animation="iconCarExit 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards"),setTimeout(()=>{n.parentNode&&n.remove()},400)}catch(t){console.error("ToastifyPro: Error removing toast:",t),n.parentNode&&n.remove()}else console.warn("ToastifyPro: Invalid toast element for removal.")}success(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"success",t)}error(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"error",t)}info(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"info",t)}warning(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"warning",t)}dark(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"dark",t)}light(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"light",t)}}"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"!=typeof exports&&(exports.ToastifyPro=n,exports.default=n),"function"==typeof define&&define.amd&&define(function(){return n}),"undefined"!=typeof window&&(window.ToastifyPro=n)});
|
|
21
|
+
//# sourceMappingURL=toastify-pro.umd.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastify-pro.umd.min.js","sources":["../src/toastify-pro.js"],"sourcesContent":["/**\r\n * ToastifyPro - Modern Toast Notification Library\r\n * A beautiful, customizable toast notification library with glassmorphism design,\r\n * Apple AirDrop-style animations, and car swipe exit effects.\r\n * \r\n * Features:\r\n * - Glassmorphism design with backdrop-filter effects\r\n * - Apple AirDrop-style entrance animations\r\n * - Position-aware car swipe exit animations \r\n * - Description support for enhanced messaging\r\n * - Six theme variants (success, error, info, warning, dark, light)\r\n * - Progress bar with shimmer effects\r\n * - Responsive design for mobile devices\r\n * - Framework agnostic (works with React, Vue, Angular, etc.)\r\n * \r\n * @version 1.2.0\r\n * @author ToastifyPro Team\r\n * @license MIT\r\n */\r\nclass ToastifyPro {\r\n /**\r\n * Creates a new ToastifyPro instance\r\n * @param {Object} options - Configuration options\r\n * @param {string} options.position - Toast position (top-left, top-right, bottom-left, bottom-right, top-center, bottom-center)\r\n * @param {number} options.timeout - Auto-dismiss timeout in milliseconds (0 to disable)\r\n * @param {boolean} options.allowClose - Whether to show close button\r\n * @param {number} options.maxLength - Maximum message length\r\n */\r\n constructor(options = {}) {\r\n // Validate options parameter\r\n if (typeof options !== 'object' || options === null) {\r\n console.warn('ToastifyPro: Invalid options parameter. Using defaults.');\r\n options = {};\r\n }\r\n\r\n // Merge with default options\r\n this.defaultOptions = {\r\n position: options.position || \"bottom-center\", // top-left, top-right, bottom-left, bottom-right, top-center, bottom-center\r\n timeout: options.timeout || 3000,\r\n allowClose: options.allowClose !== false, // default true\r\n maxLength: options.maxLength || 100,\r\n };\r\n\r\n // Validate position\r\n const validPositions = ['top-left', 'top-right', 'bottom-left', 'bottom-right', 'top-center', 'bottom-center'];\r\n if (!validPositions.includes(this.defaultOptions.position)) {\r\n console.warn(`ToastifyPro: Invalid position \"${this.defaultOptions.position}\". Using \"bottom-center\".`);\r\n this.defaultOptions.position = \"bottom-center\";\r\n }\r\n\r\n // Check if we're in a browser environment\r\n if (typeof document === 'undefined') {\r\n throw new Error('ToastifyPro: This library requires a DOM environment (browser).');\r\n }\r\n\r\n // Create or reuse container for this position\r\n const existing = document.querySelector(\r\n `.toastify-pro-container.${this.defaultOptions.position}`\r\n );\r\n \r\n if (existing) {\r\n this.container = existing;\r\n } else {\r\n try {\r\n this.container = document.createElement(\"div\");\r\n this.container.className = `toastify-pro-container ${this.defaultOptions.position}`;\r\n document.body.appendChild(this.container);\r\n } catch (error) {\r\n throw new Error('ToastifyPro: Failed to create container element. DOM may not be ready.');\r\n }\r\n }\r\n\r\n // Inject styles once\r\n this.injectStyles();\r\n }\r\n\r\n /**\r\n * Returns the SVG icon for a given toast type\r\n * @param {string} type - Toast type (success, error, info, warning, dark, light)\r\n * @returns {string} SVG icon markup\r\n */\r\n getIconSVG(type) {\r\n // Validate type parameter\r\n if (typeof type !== 'string') {\r\n console.warn('ToastifyPro: Invalid icon type. Using default info icon.');\r\n type = 'info';\r\n }\r\n\r\n const icons = {\r\n success: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n error: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n info: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n warning: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n dark: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" fill=\"currentColor\"/>\r\n </svg>`,\r\n light: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M9 11H7v6h2v-6zm4 0h-2v6h2v-6zm4 0h-2v6h2v-6zm2.5-9H19V1h-2v1H7V1H5v1H4.5C3.11 2 2 3.11 2 4.5v14C2 19.89 3.11 21 4.5 21h15c1.39 0 2.5-1.11 2.5-2.5v-14C22 3.11 20.89 2 19.5 2zm0 16h-15v-11h15v11z\" fill=\"currentColor\"/>\r\n </svg>`\r\n };\r\n \r\n return icons[type] || icons.info;\r\n }\r\n\r\n /**\r\n * Injects the CSS styles into the document head\r\n * Styles include glassmorphism design, animations, and responsive layout\r\n */\r\n injectStyles() {\r\n // Prevent duplicate style injection\r\n if (document.getElementById(\"toastify-pro-styles\")) return;\r\n \r\n try {\r\n const style = document.createElement(\"style\");\r\n style.id = \"toastify-pro-styles\";\r\n style.textContent = `\r\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');\r\n \r\n .toastify-pro-container {\r\n position: fixed;\r\n z-index: 9999;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 16px;\r\n pointer-events: none;\r\n }\r\n .toastify-pro-container.top-left { top: 50px; left: 24px; align-items: flex-start; }\r\n .toastify-pro-container.top-right { top: 50px; right: 24px; align-items: flex-end; }\r\n .toastify-pro-container.bottom-left { bottom: 50px; left: 24px; align-items: flex-start; }\r\n .toastify-pro-container.bottom-right { bottom: 50px; right: 24px; align-items: flex-end; }\r\n .toastify-pro-container.top-center { top: 50px; left: 50%; transform: translateX(-50%); }\r\n .toastify-pro-container.bottom-center { bottom: 50px; left: 50%; transform: translateX(-50%); }\r\n\r\n .toastify-pro {\r\n min-width: 280px;\r\n max-width: 400px;\r\n padding: 20px 24px;\r\n border-radius: 16px;\r\n font-size: 15px;\r\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\r\n font-weight: 500;\r\n color: white;\r\n opacity: 0;\r\n transform: scale(0.3);\r\n transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\r\n pointer-events: auto;\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n backdrop-filter: blur(20px);\r\n border: 1px solid rgba(255, 255, 255, 0.1);\r\n box-shadow: \r\n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\r\n 0 10px 10px -5px rgba(0, 0, 0, 0.04),\r\n 0 0 0 1px rgba(255, 255, 255, 0.05);\r\n overflow: hidden;\r\n }\r\n \r\n .toastify-pro::before {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n height: 3px;\r\n background: linear-gradient(90deg, \r\n rgba(255, 255, 255, 0.8) 0%,\r\n rgba(255, 255, 255, 0.4) 50%,\r\n rgba(255, 255, 255, 0.8) 100%);\r\n animation: shimmer 2s infinite;\r\n transition: opacity 0.8s ease;\r\n }\r\n \r\n .toastify-pro::after {\r\n content: '';\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n height: 3px;\r\n background: rgba(255, 255, 255, 0.6);\r\n animation: progress var(--duration, 5s) linear;\r\n border-radius: 0 0 16px 16px;\r\n }\r\n \r\n @keyframes airdropPop {\r\n 0% { \r\n opacity: 0;\r\n transform: scale(0.3) rotateY(-20deg); \r\n }\r\n 30% { \r\n opacity: 0.8;\r\n transform: scale(1.1) rotateY(10deg); \r\n }\r\n 60% { \r\n opacity: 1;\r\n transform: scale(0.98) rotateY(-3deg); \r\n }\r\n 100% { \r\n opacity: 1;\r\n transform: scale(1) rotateY(0deg); \r\n }\r\n }\r\n \r\n @keyframes carSwipeBottom {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(-8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateY(200px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeTop {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateY(-200px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeLeft {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateX(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateX(8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateX(-300px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeRight {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateX(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateX(-8px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.8) translateX(300px); \r\n }\r\n }\r\n \r\n @keyframes carSwipeCenter {\r\n 0% { \r\n opacity: 1;\r\n transform: scale(1) translateY(0); \r\n }\r\n 15% { \r\n opacity: 1;\r\n transform: scale(1.02) translateY(-5px); \r\n }\r\n 100% { \r\n opacity: 0;\r\n transform: scale(0.6) translateY(150px); \r\n }\r\n }\r\n \r\n @keyframes progress {\r\n 0% { width: 100%; }\r\n 100% { width: 0%; }\r\n }\r\n \r\n @keyframes shimmer {\r\n 0% { transform: translateX(-100%); }\r\n 100% { transform: translateX(100%); }\r\n }\r\n \r\n .toastify-pro.show { \r\n opacity: 1; \r\n transform: scale(1);\r\n animation: airdropPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\r\n }\r\n \r\n .toastify-pro.success { \r\n background: linear-gradient(135deg, \r\n rgba(34, 197, 94, 0.9) 0%,\r\n rgba(21, 128, 61, 0.9) 100%);\r\n border-color: rgba(34, 197, 94, 0.3);\r\n }\r\n \r\n .toastify-pro.error { \r\n background: linear-gradient(135deg, \r\n rgba(239, 68, 68, 0.9) 0%,\r\n rgba(185, 28, 28, 0.9) 100%);\r\n border-color: rgba(239, 68, 68, 0.3);\r\n }\r\n \r\n .toastify-pro.info { \r\n background: linear-gradient(135deg, \r\n rgba(59, 130, 246, 0.9) 0%,\r\n rgba(29, 78, 216, 0.9) 100%);\r\n border-color: rgba(59, 130, 246, 0.3);\r\n }\r\n \r\n .toastify-pro.warning { \r\n background: linear-gradient(135deg, \r\n rgba(245, 158, 11, 0.9) 0%,\r\n rgba(217, 119, 6, 0.9) 100%);\r\n border-color: rgba(245, 158, 11, 0.3);\r\n }\r\n \r\n .toastify-pro.dark { \r\n background: linear-gradient(135deg, \r\n rgba(15, 23, 42, 0.95) 0%,\r\n rgba(30, 41, 59, 0.95) 100%);\r\n border-color: rgba(148, 163, 184, 0.2);\r\n }\r\n \r\n .toastify-pro.light { \r\n background: linear-gradient(135deg, \r\n rgba(255, 255, 255, 0.95) 0%,\r\n rgba(248, 250, 252, 0.95) 100%);\r\n color: #1e293b;\r\n border-color: rgba(226, 232, 240, 0.8);\r\n box-shadow: \r\n 0 20px 25px -5px rgba(0, 0, 0, 0.08),\r\n 0 10px 10px -5px rgba(0, 0, 0, 0.03);\r\n }\r\n \r\n .toastify-pro.light::before {\r\n background: linear-gradient(90deg, \r\n rgba(30, 41, 59, 0.8) 0%,\r\n rgba(30, 41, 59, 0.4) 50%,\r\n rgba(30, 41, 59, 0.8) 100%);\r\n }\r\n \r\n .toastify-pro.light::after {\r\n background: rgba(30, 41, 59, 0.6);\r\n }\r\n\r\n .toastify-pro .toast-icon {\r\n flex-shrink: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 28px;\r\n height: 28px;\r\n border-radius: 50%;\r\n background: rgba(255, 255, 255, 0.2);\r\n backdrop-filter: blur(10px);\r\n animation: iconPulse 2s infinite;\r\n }\r\n \r\n @keyframes iconPulse {\r\n 0%, 100% { transform: scale(1); }\r\n 50% { transform: scale(1.05); }\r\n }\r\n \r\n @keyframes iconBounce {\r\n 0% { transform: scale(0.2) rotate(-15deg); }\r\n 40% { transform: scale(1.2) rotate(8deg); }\r\n 70% { transform: scale(0.95) rotate(-3deg); }\r\n 100% { transform: scale(1) rotate(0deg); }\r\n }\r\n \r\n @keyframes iconCarExit {\r\n 0% { \r\n transform: scale(1) rotate(0deg); \r\n opacity: 1;\r\n }\r\n 20% { \r\n transform: scale(1.1) rotate(-10deg); \r\n opacity: 0.9;\r\n }\r\n 100% { \r\n transform: scale(0.3) rotate(180deg); \r\n opacity: 0;\r\n }\r\n }\r\n\r\n .toastify-pro .toast-icon svg {\r\n width: 18px;\r\n height: 18px;\r\n color: inherit;\r\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\r\n }\r\n\r\n .toastify-pro.light .toast-icon {\r\n background: rgba(15, 23, 42, 0.1);\r\n }\r\n\r\n .toastify-pro .toast-content {\r\n flex: 1;\r\n line-height: 1.5;\r\n font-weight: 500;\r\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n .toastify-pro .toast-message {\r\n font-size: 15px;\r\n font-weight: 500;\r\n margin-bottom: 0;\r\n }\r\n\r\n .toastify-pro .toast-description {\r\n font-size: 13px;\r\n font-weight: 400;\r\n opacity: 0.85;\r\n margin-top: 4px;\r\n line-height: 1.4;\r\n }\r\n\r\n .toastify-pro .close-btn {\r\n cursor: pointer;\r\n font-size: 20px;\r\n color: inherit;\r\n opacity: 0.7;\r\n padding: 8px;\r\n border-radius: 50%;\r\n transition: all 0.2s ease;\r\n flex-shrink: 0;\r\n width: 32px;\r\n height: 32px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: rgba(255, 255, 255, 0.1);\r\n backdrop-filter: blur(10px);\r\n font-weight: 300;\r\n line-height: 1;\r\n }\r\n \r\n .toastify-pro .close-btn:hover { \r\n opacity: 1; \r\n background: rgba(255, 255, 255, 0.2);\r\n transform: scale(1.1);\r\n }\r\n \r\n .toastify-pro.light .close-btn {\r\n background: rgba(15, 23, 42, 0.08);\r\n }\r\n \r\n .toastify-pro.light .close-btn:hover { \r\n background: rgba(15, 23, 42, 0.15);\r\n }\r\n \r\n @media (max-width: 640px) {\r\n .toastify-pro {\r\n min-width: 260px;\r\n max-width: calc(100vw - 48px);\r\n margin: 0 8px;\r\n }\r\n \r\n .toastify-pro-container.top-left,\r\n .toastify-pro-container.bottom-left { left: 16px; }\r\n .toastify-pro-container.top-right,\r\n .toastify-pro-container.bottom-right { right: 16px; }\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n } catch (error) {\r\n console.error('ToastifyPro: Failed to inject styles:', error);\r\n }\r\n }\r\n\r\n /**\r\n * Creates and displays a toast notification\r\n * @param {string} message - Main message text\r\n * @param {string} type - Toast type (success, error, info, warning, dark, light)\r\n * @param {Object} opts - Additional options\r\n * @param {string} opts.description - Optional description text\r\n * @param {number} opts.timeout - Override default timeout\r\n * @param {boolean} opts.allowClose - Override close button setting\r\n * @param {number} opts.maxLength - Override max message length\r\n */\r\n show(message, type = \"dark\", opts = {}) {\r\n // Input validation\r\n if (typeof message !== 'string') {\r\n console.warn('ToastifyPro: Message must be a string. Converting to string.');\r\n message = String(message);\r\n }\r\n\r\n if (!message.trim()) {\r\n console.warn('ToastifyPro: Empty message provided.');\r\n return;\r\n }\r\n\r\n // Validate type\r\n const validTypes = ['success', 'error', 'info', 'warning', 'dark', 'light'];\r\n if (!validTypes.includes(type)) {\r\n console.warn(`ToastifyPro: Invalid type \"${type}\". Using \"dark\".`);\r\n type = 'dark';\r\n }\r\n\r\n // Validate and merge options\r\n if (typeof opts !== 'object' || opts === null) {\r\n console.warn('ToastifyPro: Invalid options parameter. Using defaults.');\r\n opts = {};\r\n }\r\n\r\n const options = { ...this.defaultOptions, ...opts };\r\n\r\n try {\r\n // Create toast element\r\n const toast = document.createElement(\"div\");\r\n toast.className = `toastify-pro ${type}`;\r\n \r\n // Set duration for progress bar animation\r\n if (options.timeout > 0) {\r\n toast.style.setProperty('--duration', `${options.timeout}ms`);\r\n }\r\n\r\n // Create icon wrapper\r\n const iconWrapper = document.createElement(\"div\");\r\n iconWrapper.className = \"toast-icon\";\r\n iconWrapper.innerHTML = this.getIconSVG(type);\r\n toast.appendChild(iconWrapper);\r\n\r\n // Create content wrapper for the message and description\r\n const contentWrapper = document.createElement(\"div\");\r\n contentWrapper.className = \"toast-content\";\r\n \r\n // Main message\r\n const messageElement = document.createElement(\"div\");\r\n messageElement.className = \"toast-message\";\r\n messageElement.textContent = message.substring(0, options.maxLength);\r\n contentWrapper.appendChild(messageElement);\r\n \r\n // Optional description (if provided)\r\n if (options.description && typeof options.description === 'string') {\r\n const descriptionElement = document.createElement(\"div\");\r\n descriptionElement.className = \"toast-description\";\r\n descriptionElement.textContent = options.description.substring(0, options.maxLength * 2);\r\n contentWrapper.appendChild(descriptionElement);\r\n }\r\n \r\n toast.appendChild(contentWrapper);\r\n\r\n // Add close button if enabled\r\n if (options.allowClose) {\r\n const closeBtn = document.createElement(\"span\");\r\n closeBtn.className = \"close-btn\";\r\n closeBtn.innerHTML = \"×\";\r\n closeBtn.setAttribute('aria-label', 'Close notification');\r\n closeBtn.onclick = () => this.removeToast(toast);\r\n toast.appendChild(closeBtn);\r\n }\r\n\r\n // Add toast to container\r\n this.container.appendChild(toast);\r\n\r\n // Apple AirDrop-style entrance animation\r\n setTimeout(() => {\r\n toast.classList.add(\"show\");\r\n // Add icon bounce effect with Apple-style timing\r\n const icon = toast.querySelector('.toast-icon');\r\n if (icon) {\r\n icon.style.animation = 'iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)';\r\n }\r\n }, 10);\r\n\r\n // Auto-remove after timeout\r\n if (options.timeout > 0) {\r\n setTimeout(() => this.removeToast(toast), options.timeout);\r\n }\r\n\r\n return toast; // Return element for potential future manipulation\r\n } catch (error) {\r\n console.error('ToastifyPro: Failed to create toast:', error);\r\n }\r\n }\r\n\r\n /**\r\n * Removes a toast with position-aware car swipe animation\r\n * @param {HTMLElement} toast - Toast element to remove\r\n */\r\n removeToast(toast) {\r\n if (!toast || !toast.parentNode) {\r\n console.warn('ToastifyPro: Invalid toast element for removal.');\r\n return;\r\n }\r\n\r\n try {\r\n // Detect position to choose the right swipe direction\r\n const container = toast.parentNode;\r\n const position = container.className.split(' ')[1]; // get position class\r\n \r\n let swipeAnimation = 'carSwipeBottom'; // default fallback\r\n \r\n // Choose animation based on position - car swipes away from screen edge\r\n if (position.includes('bottom')) {\r\n swipeAnimation = 'carSwipeBottom'; // swipe down off screen\r\n } else if (position.includes('top')) {\r\n swipeAnimation = 'carSwipeTop'; // swipe up off screen\r\n } else if (position.includes('left')) {\r\n swipeAnimation = 'carSwipeLeft'; // swipe left off screen\r\n } else if (position.includes('right')) {\r\n swipeAnimation = 'carSwipeRight'; // swipe right off screen\r\n } else if (position.includes('center')) {\r\n swipeAnimation = 'carSwipeCenter'; // swipe down for center\r\n }\r\n \r\n // Apply fast car swipe animation with improved easing\r\n toast.style.animation = `${swipeAnimation} 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards`;\r\n \r\n // Add spinning icon animation for extra polish\r\n const icon = toast.querySelector('.toast-icon');\r\n if (icon) {\r\n icon.style.animation = 'iconCarExit 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards';\r\n }\r\n \r\n // Remove element after animation completes\r\n setTimeout(() => {\r\n if (toast.parentNode) {\r\n toast.remove();\r\n }\r\n }, 400);\r\n } catch (error) {\r\n console.error('ToastifyPro: Error removing toast:', error);\r\n // Fallback: remove immediately if animation fails\r\n if (toast.parentNode) {\r\n toast.remove();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Shows a success toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n success(msg, opts) {\r\n // Handle both (message) and (message, description) formats\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"success\", opts);\r\n }\r\n\r\n /**\r\n * Shows an error toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n error(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"error\", opts);\r\n }\r\n\r\n /**\r\n * Shows an info toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n info(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"info\", opts);\r\n }\r\n\r\n /**\r\n * Shows a warning toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n warning(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"warning\", opts);\r\n }\r\n\r\n /**\r\n * Shows a dark-themed toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n dark(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"dark\", opts);\r\n }\r\n\r\n /**\r\n * Shows a light-themed toast notification\r\n * @param {string} msg - Main message\r\n * @param {string|Object} opts - Description string or options object\r\n */\r\n light(msg, opts) {\r\n if (typeof opts === 'string') {\r\n opts = { description: opts };\r\n }\r\n this.show(msg, \"light\", opts);\r\n }\r\n}\r\n\r\n/**\r\n * Export for different environments\r\n * Supports CommonJS (Node.js), AMD, and browser globals\r\n */\r\n\r\n// CommonJS export (Node.js/npm)\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = ToastifyPro;\r\n}\r\n\r\n// ES6 module export\r\nif (typeof exports !== 'undefined') {\r\n exports.ToastifyPro = ToastifyPro;\r\n exports.default = ToastifyPro;\r\n}\r\n\r\n// AMD export (RequireJS)\r\nif (typeof define === 'function' && define.amd) {\r\n define(function() {\r\n return ToastifyPro;\r\n });\r\n}\r\n\r\n// Browser global\r\nif (typeof window !== 'undefined') {\r\n window.ToastifyPro = ToastifyPro;\r\n}\r\n"],"names":["ToastifyPro","constructor","options","console","warn","this","defaultOptions","position","timeout","allowClose","maxLength","includes","document","Error","existing","querySelector","container","createElement","className","body","appendChild","error","injectStyles","getIconSVG","type","icons","success","info","warning","dark","light","getElementById","style","id","textContent","head","show","message","opts","String","trim","toast","setProperty","iconWrapper","innerHTML","contentWrapper","messageElement","substring","description","descriptionElement","closeBtn","setAttribute","onclick","removeToast","setTimeout","classList","add","icon","animation","parentNode","split","swipeAnimation","remove","msg","module","exports","default","define","amd","window"],"mappings":";;;;;;;;;;;;;;;;;;;KAmBA,MAAMA,EASJ,WAAAC,CAAYC,EAAU,IAEG,iBAAZA,GAAoC,OAAZA,IACjCC,QAAQC,KAAK,2DACbF,EAAU,CAAA,GAIZG,KAAKC,eAAiB,CACpBC,SAAUL,EAAQK,UAAY,gBAC9BC,QAASN,EAAQM,SAAW,IAC5BC,YAAmC,IAAvBP,EAAQO,WACpBC,UAAWR,EAAQQ,WAAa,KAWlC,GAPuB,CAAC,WAAY,YAAa,cAAe,eAAgB,aAAc,iBAC1EC,SAASN,KAAKC,eAAeC,YAC/CJ,QAAQC,KAAK,kCAAkCC,KAAKC,eAAeC,qCACnEF,KAAKC,eAAeC,SAAW,iBAIT,oBAAbK,SACT,MAAM,IAAIC,MAAM,mEAIlB,MAAMC,EAAWF,SAASG,cACxB,2BAA2BV,KAAKC,eAAeC,YAGjD,GAAIO,EACFT,KAAKW,UAAYF,OAEjB,IACET,KAAKW,UAAYJ,SAASK,cAAc,OACxCZ,KAAKW,UAAUE,UAAY,0BAA0Bb,KAAKC,eAAeC,WACzEK,SAASO,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+1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toastify-pro",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A lightweight customizable toast notification library",
|
|
5
5
|
"main": "dist/toastify-pro.umd.js",
|
|
6
6
|
"module": "dist/toastify-pro.esm.js",
|
|
@@ -11,9 +11,49 @@
|
|
|
11
11
|
],
|
|
12
12
|
"keywords": [
|
|
13
13
|
"toast",
|
|
14
|
+
"toaster",
|
|
15
|
+
"toastify",
|
|
16
|
+
"toastify-pro",
|
|
14
17
|
"notification",
|
|
18
|
+
"notifications",
|
|
19
|
+
"popup",
|
|
20
|
+
"alert",
|
|
21
|
+
"snackbar",
|
|
22
|
+
"toast message",
|
|
23
|
+
"message",
|
|
24
|
+
"ui",
|
|
25
|
+
"ux",
|
|
26
|
+
"frontend",
|
|
15
27
|
"javascript",
|
|
16
|
-
"
|
|
28
|
+
"typescript",
|
|
29
|
+
"vanilla js",
|
|
30
|
+
"framework agnostic",
|
|
31
|
+
"web",
|
|
32
|
+
"web app",
|
|
33
|
+
"react",
|
|
34
|
+
"react toast",
|
|
35
|
+
"react notifications",
|
|
36
|
+
"vue",
|
|
37
|
+
"vue toast",
|
|
38
|
+
"angular",
|
|
39
|
+
"angular toast",
|
|
40
|
+
"svelte",
|
|
41
|
+
"svelte toast",
|
|
42
|
+
"jquery",
|
|
43
|
+
"jquery toast",
|
|
44
|
+
"bootstrap toast",
|
|
45
|
+
"tailwind",
|
|
46
|
+
"material ui",
|
|
47
|
+
"sweetalert alternative",
|
|
48
|
+
"toastr alternative",
|
|
49
|
+
"react-toastify alternative",
|
|
50
|
+
"lightweight",
|
|
51
|
+
"minimal",
|
|
52
|
+
"library",
|
|
53
|
+
"esm",
|
|
54
|
+
"umd",
|
|
55
|
+
"cdn",
|
|
56
|
+
"open source"
|
|
17
57
|
],
|
|
18
58
|
"author": "Abhishek Potter",
|
|
19
59
|
"license": "MIT",
|
|
@@ -24,10 +64,11 @@
|
|
|
24
64
|
"bugs": {
|
|
25
65
|
"url": "https://github.com/abhipotter/toastify-pro/issues"
|
|
26
66
|
},
|
|
27
|
-
"homepage": "https://github.
|
|
67
|
+
"homepage": "https://abhipotter.github.io/toastify-pro/",
|
|
68
|
+
"type": "module",
|
|
28
69
|
"devDependencies": {
|
|
29
|
-
"rollup": "^4.
|
|
30
|
-
"rollup
|
|
70
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
71
|
+
"rollup": "^4.50.2"
|
|
31
72
|
},
|
|
32
73
|
"scripts": {
|
|
33
74
|
"build": "rollup -c"
|