The fill glow is a radial gradient on ::before. The border glow on ::after uses the mask-composite trick to paint only a 1px ring, so the edge lights up nearest the cursor.
The script only writes --x, --y and a lit class. Using a class instead of :hover matters on phones, where :hover sticks after a tap.