Alter opacity of layer based on mouse cursor position

Or, the first task, I believe, is to create a function returning the coordinates of the mouse.

I have tried some guides including Tracking Mouse Move with Velo Code | Velo by Wix
But I can’t make them work when importing into my own editor.

Do you know if there is a way to create a plain section with a text only containing the x,y values of the cursor? I have found React to be a useful tool as well.

Many thanks, Johan