This Library is part of the NGXUI ecosystem.
View all available components at https://ngxui.com
@omnedia/ngx-halo
is an Angular library that creates a beautiful, animated halo effect. This component provides a circular, gradient-based effect with smooth animations and interactive mouse tracking. It's perfect for enhancing the visual experience of your Angular applications.
- Animated halo circle with a customizable gradient effect.
- Interactive mouse movement support for dynamic effects.
- Control animation, halo size, colors, and shadows through simple inputs.
- Supports flexible positioning and CSS customization.
Install the library using npm:
npm install @omnedia/ngx-halo
Import the NgxHaloComponent
in your Angular module or component:
import { NgxHaloComponent } from '@omnedia/ngx-halo';
@Component({
...
imports: [NgxHaloComponent],
...
})
Use the component in your template:
<om-halo [animate]="true" [interactive]="true" [position]="'center'" [haloSize]="'300px'" [haloColors]="'#ff0000, #00ff00, #0000ff'">
<h1>Your Content Here</h1>
</om-halo>
- Interactive Mouse Movement: The halo responds to mouse movements with smooth, delayed transitions.
- Animation Control: Control whether the halo animates on its own or stops while interacting using the
animate
input. - Customizable Appearance: The halo's size, colors, and shadow can be controlled via dedicated inputs (
haloSize
,haloColors
, andhaloShadow
). - Positioning: Set the initial position of the halo with the
position
input. - Styling: The component allows custom CSS styling via the
styleClass
input.
<om-halo
[animate]="animate"
[interactive]="interactive"
[position]="position"
[haloSize]="haloSize"
[haloColors]="haloColors"
[haloShadowColors]="haloShadowColors"
styleClass="custom-halo-class"
>
<ng-content></ng-content>
</om-halo>
animate
(optional): A boolean to control if the halo is animated by default. Defaults totrue
.interactive
(optional): A boolean to enable or disable mouse interaction. Defaults totrue
.position
(optional): Sets the halo's initial position. Accepts values like'center'
,'top-left'
,'bottom-right'
, etc.haloSize
(optional): A string defining the halo's size (e.g.,'300px'
).haloColors
(optional): A string representing the gradient colors for the halo effect. Default'#5fffda 20%, #46a8ff 50%, #cc32f6 100%'
.haloShadowColors
(optional): An array of strings defining the halo's box shadow. Default['rgba(234, 255, 95, 0.8)', 'rgba(244, 173, 108, 0.5)', 'rgba(225, 71, 181, 0.6)']
.styleClass
(optional): A custom CSS class for additional styling.
<om-halo [animate]="true" [interactive]="true" position="top-right" haloSize="400px" haloColors="'#f00, #0f0, #00f'" [haloShadowColors]="['rgba(234, 255, 95, 0.8)', 'rgba(244, 173, 108, 0.5)', 'rgba(225, 71, 181, 0.6)']" styleClass="custom-halo-style">
<div class="inner-content">
<h2>Welcome to the Halo Effect</h2>
</div>
</om-halo>
.om-halo
The .om-halo
container allows you to apply global or custom styles using the styleClass
input. The component manages the gradient and animation, while you can extend the styling for the container itself.
<om-halo styleClass="custom-halo-background">
<div class="inner-content">
<h2>Custom Halo Styling Example</h2>
</div>
</om-halo>
.custom-halo-background {
background-color: #1e1e1e;
padding: 2rem;
border-radius: 10px;
}
.inner-content {
text-align: center;
color: white;
}
Contributions are welcome! Please submit a pull request or open an issue to discuss new features or bug fixes.
This project is licensed under the MIT License.