Skip to content

Add support for dynamically created DOM elementsΒ #3

Description

@aymannajim

Hey,

First off, really nice work on this. The GLSL blur idea for FiveM UI is clean and works great for static elements.

I ran into an issue when using it with a dynamic UI (like ox_target menus). Right now, elements with data-hlsl are only collected once on DOMContentLoaded:

const glassElements = document.querySelectorAll('[data-hlsl]');

and passed once into createGameView().

The problem is that anything created later in JS (like menu options) never gets picked up by the renderer, even if it has data-hlsl.
It would be great if the script could support elements added after initialization, Maybe using a code to refresh/register new elements.

Thanks πŸ‘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions