|
@@ -1,9 +1,10 @@
|
|
|
// nilox (c)
|
|
|
|
|
|
window.onload = function () {
|
|
|
- var eye = document.getElementById('logo');
|
|
|
-
|
|
|
- var eyeDoc = eye.contentDocument;
|
|
|
+ const body = document.getElementById('body');
|
|
|
+ const lang = document.getElementById('lang-chooser');
|
|
|
+ const eye = document.getElementById('logo');
|
|
|
+ const eyeDoc = eye.contentDocument;
|
|
|
const logo = eyeDoc.getElementById('alucho-logo');
|
|
|
const iris = eyeDoc.getElementById('iris');
|
|
|
const pupil = eyeDoc.getElementById('pupil');
|
|
@@ -20,7 +21,8 @@ window.onload = function () {
|
|
|
const oY = logo.getAttribute('height') / 2.;
|
|
|
|
|
|
window.onmousemove = function (ev) {
|
|
|
- const r = ev.clientX / window.innerWidth;
|
|
|
+ const eyeOffset = body.getBoundingClientRect().x + lang.clientWidth + eye.clientWidth / 2;
|
|
|
+ const r = (ev.clientX - eyeOffset) / (window.innerWidth - eyeOffset) / 2 + .5;
|
|
|
|
|
|
const iX = istart + ilength * r;
|
|
|
iris.setAttribute('cx', iX);
|