Initial commit: WebGPU portfolio — generative-art site with DOM overlay
This commit is contained in:
14
src/ui/input.ts
Normal file
14
src/ui/input.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Window-level pointer position capture. Discrete clicks and hover are
|
||||
// handled by the DOM overlay elements directly; this class only feeds the
|
||||
// continuous pointer position that the background shader consumes.
|
||||
export class Input {
|
||||
x = 0
|
||||
y = 0
|
||||
|
||||
constructor() {
|
||||
window.addEventListener('pointermove', (e) => {
|
||||
this.x = e.clientX
|
||||
this.y = e.clientY
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user