diff --git a/edit.html b/edit.html index f6ef3c1..3fce44a 100644 --- a/edit.html +++ b/edit.html @@ -205,15 +205,8 @@ void main(){\n\ window.onload = function () { loadTag(); - render(); }; - function render() { - billboard.setMouse(mouse) - billboard.render() - window.requestAnimFrame(render); - } - \ No newline at end of file diff --git a/function.html b/function.html index 732e0f2..96c8efe 100644 --- a/function.html +++ b/function.html @@ -156,21 +156,14 @@ void main(){\n\ }; })(); - // Keep track of the mouse - var mouse = {x: 0, y: 0}; - document.addEventListener('mousemove', function(e){ - mouse.x = e.clientX || e.pageX; - mouse.y = e.clientY || e.pageY - }, false); - window.addEventListener("hashchange", function () { loadFunction() }, false); - // window.onresize = function(event) { - // if (typeof window.innerWidth != 'undefined') { - // billboard. = window.innerWidth - // }; + window.onresize = function(event) { + if (typeof window.innerWidth != 'undefined') { + billboard. = window.innerWidth + }; function removeElementsByClass(className){ var elements = document.getElementsByClassName(className); @@ -231,15 +224,8 @@ float function(in float x) {\n\ } } - function render() { - billboard.setMouse(mouse) - billboard.render() - window.requestAnimFrame(render); - } - window.onload = function () { loadFunction(); - render(); }; diff --git a/header.php b/header.php index 343cd25..4e4caec 100644 --- a/header.php +++ b/header.php @@ -42,7 +42,7 @@ echo ' - + '; @@ -56,3 +56,5 @@ echo ' '; ?> + + diff --git a/src/main.js b/src/main.js index 1513ec4..e5d7d8f 100644 --- a/src/main.js +++ b/src/main.js @@ -280,15 +280,6 @@ function loadCanvas() { } } -function renderCanvas() { - var IDs = Object.keys(billboards); - for(var i = 0; i < IDs.length; i++){ - billboards[IDs[i]].setMouse(mouse); - billboards[IDs[i]].render(); - } - window.requestAnimFrame(renderCanvas); -} - function insertAfter(newElement,targetElement) { var parent = targetElement.parentNode; if (parent.lastChild == targetElement) { @@ -403,13 +394,6 @@ function translate() { } -// Keep track of the mouse -var mouse = {x: 0, y: 0}; -document.addEventListener('mousemove', function(e){ - mouse.x = e.clientX || e.pageX; - mouse.y = e.clientY || e.pageY -}, false); - /** * Provides requestAnimationFrame in a cross browser way. */ @@ -441,5 +425,4 @@ window.onload = function(){ captionizeImages(); loadCanvas(); - renderCanvas(); };