// Re2o est un logiciel d'administration développé initiallement au rezometz. Il // se veut agnostique au réseau considéré, de manière à être installable en // quelques clics. // // Copyright © 2017 Maël Kervella // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // General options //===================================== // Times the canvas is refreshed a second var FPS = 30; // Determine the length of the trail (0=instant disappear, maximum=window.innerHeight=no disappear) var TRAIL_TIME = 5; // The color of the characters var RAIN_COLOR = "#00F"; // The characters displayed var CHARACTERS = "田由甲申甴电甶男甸甹町画甼甽甾甿畀畁畂畃畄畅畆畇畈畉畊畋界畍畎畏畐畑".split(""); // The font size used to display the characters var FONT_SIZE = 10; // The maximum number of characters displayed by column var MAX_CHAR = 7; var Sapphire = function () { var sapphire = { triggerHandle: undefined, activated: false, runOnce: false, getClass: function(elt, main, name) { elt.obj = main.getElementsByClassName(name); }, getTag: function(elt, main, name) { elt.obj = main.getElementsByTagName(name); }, getProp: function(elt) { for (var i=0 ; i sapphire.canvas.height && Math.random() > 0.975) sapphire.drops[i][j] = 0; sapphire.drops[i][j]++; } } } function drawEverything() { attenuateBackground(); drawMatrixRainDrop(); } sapphire.resize(); window.addEventListener('resize', sapphire.resize); sapphire.triggerHandle = setInterval(drawEverything, 1000/FPS); }, stop: function() { window.removeEventListener('resize', sapphire.resize); clearInterval(sapphire.triggerHandle); sapphire.canvas.parentNode.removeChild(sapphire.canvas); }, alterElts: function() { for (var e in sapphire.elts) { sapphire.elts[e].alter(main); } }, revertElts: function() { for (var e in sapphire.elts) { sapphire.elts[e].revert(main); } }, activate: function() { if (!sapphire.runOnce) { sapphire.runOnce = true; sapphire.init(); } if (!sapphire.activated) { sapphire.activated = true; sapphire.alterElts(); sapphire.run() } else { sapphire.activated = false; sapphire.stop(); sapphire.revertElts(); } } } return sapphire; } var s = Sapphire(); Konami(s.activate);