Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Blur Effect to Modal Background #10

Closed
lucasferreiralimax opened this issue Oct 15, 2024 · 0 comments · Fixed by #11
Closed

Feature: Add Blur Effect to Modal Background #10

lucasferreiralimax opened this issue Oct 15, 2024 · 0 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request hacktoberfest

Comments

@lucasferreiralimax
Copy link
Member

The request is to implement a blur effect on the modal background overlay in the UpWindowAngularComponent. This will allow the background to be blurred when the modal is open, enhancing the visual aesthetics of the component.

Proposed Solution

  • Add a new @Input() property, blur, which defaults to false. When set to true, the background of the modal overlay will apply a blur effect.
  • Modify the modal's CSS to handle the blur effect when the blur class is applied.
  • Update the getClass() method to include the blur class conditionally based on the blur input.

Code Changes

Component TypeScript Changes

@Input() blur: boolean = false;

getClass() {
  return {
    ...(this.class ? { [this.class]: true } : {}),
    [this.animation]: this.openingAnimation && !this.closingAnimation,
    [`${this.animation}-out`]: this.closingAnimation,
    shake: this.shakeAnimation,
    fullscreen: this.fullScreen,
    blur: this.blur, // Add this to toggle the blur class
  };
}

Component HTML Changes

<div
  #modal
  class="overlay"
  [class.active]="isOpen()"
  [class.blur]="blur"  <!-- Add this to conditionally apply the blur class -->
  role="dialog"
  aria-labelledby="dialog-title"
  aria-describedby="dialog-description"
>
  <!-- Modal content -->
</div>

CSS Changes

.overlay {
  &.blur {
    backdrop-filter: blur(6px);  // Apply blur effect
  }
}

Benefits

  • Enhances the visual quality of the modal by blurring the background when the modal is open.
  • Provides an additional customization option for developers using the component.

Screenshot 2024-10-15 020651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant