mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
onclick ripple
This commit is contained in:
@@ -61,8 +61,8 @@ export default async (canvas, config) => {
|
||||
window.ripples = [0,0,0]
|
||||
window.onclick = (e) => { // ripple init
|
||||
console.log(e)
|
||||
window.ripples = [Date.now(), e.clientX, e.clientY]
|
||||
console.log(ripples)
|
||||
window.ripples = [Date.now(), (e.clientX/e.srcElement.clientWidth*2)-1, (e.clientY/e.srcElement.clientHeight*2)-1]
|
||||
// console.log(ripples)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ export default ({ regl, config }, inputs) => {
|
||||
tex: inputs.primary,
|
||||
bloomTex: inputs.bloom,
|
||||
intensity: ()=>{
|
||||
let inten = 8 - (Date.now() - window.ripples[0])/500
|
||||
let inten = 2 - (Date.now() - window.ripples[0])/2000
|
||||
if (inten < 0) inten = 0
|
||||
return inten / 50
|
||||
return inten / 10
|
||||
},
|
||||
height: regl.context("viewportWidth"),
|
||||
width: regl.context("viewportHeight"),
|
||||
|
||||
Reference in New Issue
Block a user