live-wallpaper-ecorp
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,9 +0,7 @@ | ||
//================================================================================================= GLITCH | ||
var NR_OF_GLITCHED_CANVASES = 7; | ||
var DELAY_BETWEEN_FRAMES = 30; | ||
// 0 means progressively longer with a random delay | ||
// any positive value means a fixed delay | ||
var DELAY_BETWEEN_GLITCHES = 0; | ||
var DELAY_BETWEEN_FRAMES = 60; | ||
var DELAY_BETWEEN_GLITCHES_MINIMUM = 5000; | ||
var DELAY_BETWEEN_GLITCHES_MAXIMUM = 15000; | ||
var TEXT_ELEMENT = null; | ||
@@ -22,21 +20,2 @@ var TEXT_NORMAL = null; | ||
function do_glitch() { | ||
TEXT_ELEMENT = document.getElementById("text"); | ||
TEXT_NORMAL = TEXT_ELEMENT.getAttribute("data-text-normal"); | ||
TEXT_GLITCHED = TEXT_ELEMENT.getAttribute("data-text-glitched"); | ||
for (var i = 0; i < NR_OF_GLITCHED_CANVASES; ++i) { | ||
glitch(document.body, { | ||
amount: i, | ||
complete: function(canvas) { | ||
glitched_canvases.push(canvas); | ||
canvas.style.position = "absolute"; | ||
canvas.style.top = 0; | ||
canvas.style.left = 0; | ||
} | ||
}); | ||
} | ||
render_glitches(); | ||
} | ||
function render_glitches() { | ||
@@ -58,15 +37,27 @@ if (curr_canvas != null) { | ||
} | ||
if (DELAY_BETWEEN_GLITCHES > 0) { | ||
setTimeout(render_glitches, DELAY_BETWEEN_GLITCHES); | ||
} else { | ||
setTimeout(render_glitches, times_rendered * getRandomInt(500, 1500)); | ||
curr_canvas = null; | ||
setTimeout(render_glitches, getRandomInt(DELAY_BETWEEN_GLITCHES_MINIMUM, DELAY_BETWEEN_GLITCHES_MAXIMUM)); | ||
curr_canvas = null; | ||
TEXT_ELEMENT.innerHTML = TEXT_NORMAL; | ||
} | ||
TEXT_ELEMENT.innerHTML = TEXT_NORMAL; | ||
} | ||
} | ||
window.onload = do_glitch; | ||
//================================================================================================= END | ||
window.onload = function() { | ||
TEXT_ELEMENT = document.getElementById("text"); | ||
TEXT_NORMAL = TEXT_ELEMENT.getAttribute("data-text-normal"); | ||
TEXT_GLITCHED = TEXT_ELEMENT.getAttribute("data-text-glitched"); | ||
for (var i = 0; i < NR_OF_GLITCHED_CANVASES; ++i) { | ||
glitch(document.body, { | ||
amount: i, | ||
complete: function(canvas) { | ||
glitched_canvases.push(canvas); | ||
canvas.style.position = "absolute"; | ||
canvas.style.top = 0; | ||
canvas.style.left = 0; | ||
} | ||
}); | ||
} | ||
render_glitches(); | ||
}; |
{ | ||
"name": "live-wallpaper-ecorp", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Electron-based live wallpaper showing a glitched E Corp / Evil Corp logo.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
876877
2708