|
@@ -20,12 +20,13 @@ window.onload = function () {
|
|
|
window.onmousemove = function (ev) {
|
|
|
const eyeOffset = body.getBoundingClientRect().x + lang.clientWidth + eye.clientWidth / 2;
|
|
|
const r = (ev.clientX - eyeOffset) / (window.innerWidth - eyeOffset) / 2 + .5;
|
|
|
+ const ry = ev.clientY / window.innerHeight;
|
|
|
|
|
|
const iX = istart + ilength * r;
|
|
|
iris.setAttribute('cx', iX);
|
|
|
|
|
|
const pX = iX + pstart + plength * r;
|
|
|
- const pY = oY + 16 * r * (1 - r);
|
|
|
+ const pY = oY + 20 * r * (1 - r) * ry;
|
|
|
// p(r) = y0 + a * r * (1 - r) is a parabola
|
|
|
// p(0) = p(1) = y0
|
|
|
// p(.5) = y0 + a / 4
|