This project is an Angular-based application showcasing customized tooltip examples and a notification system. It utilizes various utility libraries and techniques to enhance user interface interactions.
- Default Tooltips: Position-based tooltips for
top,bottom,left, andright. - Colored Tooltips: Customizable background and text colors using Tailwind CSS.
- Randomized Colors: Dynamic tooltip styles with random text and background color combinations.
- No Arrow Tooltips: Tooltips without arrows for a sleek design.
- Customizable Notifications: Display notifications with dynamic content, styles, and media assets.
- Media Support: Include FontAwesome icons or image assets in the notification modal.
- Auto-Dismiss and Queued Notifications: Notifications can auto-dismiss after a set duration while handling multiple notifications in a queue.
- TooltipExamplesComponent: The core feature demo component showcasing tooltip examples and their customizations.
- MarkdownReaderComponent: Dynamically reads and renders markdown documents, useful for embedding user guides directly.
- TooltipDirective: Handles tooltip display logic when a mouse hovers over an element. Enables customization of tooltips' size, position, and more.
-
NotificationService: A shared service to manage notifications. It provides:
- Functions to display, dismiss, and clear notifications.
- Queue-based notification handling.
-
MediaItem (Helper Class): Facilitates the creation of media elements such as icons and images for notifications.
Ensure you have the following installed on your system:
- Node.js: v14 or higher
- NPM: v6 or higher
- Angular CLI: v19 or higher
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd <project-directory>
- Install dependencies:
npm install
Start the development server:
ng serveOpen your browser and navigate to http://localhost:4200.
This component demonstrates various tooltip designs. You can experiment with:
- Changing tooltip text, size, or position.
- Applying different colors via the utility classes in
Tailwind CSS. - Using the
TooltipDirectivedirectly in your Angular templates.
To trigger a notification from your code, use the NotificationService. Example:
this.notificationService.show({ title: 'New Message', message: 'You have received a new message!', classList: 'bg-green-500 text-white', duration: 5000 });The randomTailwindColorClasses property generates random text and background combinations for tooltips.
Tooltips can be customized with the following options:
- Position:
top,bottom,left, orright. - CSS Classes: Customize styles such as background color or padding.
- Size:
sm,md, orlg.
- Media Content: Add images or icons using the configurable
MediaItemclass. - Persistent or Temporary: Decide whether notifications should auto-dismiss or stay visible until manually removed.
- Angular: Modern web applications built with components and modules.
- Tailwind CSS: Utility-first CSS framework for rapid UI styling.
- FontAwesome Angular Library: For using scalable vector icons.
- RxJS (Reactive Extensions): Reactive programming paradigm.
This project is licensed under the MIT License.
Feel free to contribute to this project by submitting issues or pull requests.