10 years later #1
3 changed files with 20 additions and 18 deletions
|
|
@ -27,6 +27,8 @@
|
|||
"getClosestEdgeToMouse": true,
|
||||
"centerElementUnderCursor": true,
|
||||
"setAttributesAccordingToPosition": true,
|
||||
"randomIntFrom": false,
|
||||
"replaceLineBreaks": false,
|
||||
"HippieTaskBar": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,6 +405,24 @@ function setAttributesAccordingToPosition(element, position, attributes) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt eine Zahl zwischen <min> und <max> aus.
|
||||
* Die Werte <min> und <max> sind dabei mit eingeschlossen.
|
||||
* Mit <pos> kann der Exponent für eine 10er-Teilung angegeben werden.
|
||||
*
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @param {number} pos
|
||||
* @returns {number}
|
||||
*/
|
||||
function randomIntFrom(min, max, pos = 0) {
|
||||
pos = Math.pow(10, pos);
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
|
||||
return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos;
|
||||
}
|
||||
|
||||
// CONCEPTS
|
||||
|
||||
// NOTE: Benutzt private Zuweisungen
|
||||
|
|
|
|||
|
|
@ -272,24 +272,6 @@ function loadCore() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt eine Zahl zwischen <min> und <max> aus.
|
||||
* Die Werte <min> und <max> sind dabei mit eingeschlossen.
|
||||
* Mit <pos> kann der Exponent für eine 10er-Teilung angegeben werden.
|
||||
*
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @param {number} pos
|
||||
* @returns {number}
|
||||
*/
|
||||
function randomIntFrom(min, max, pos = 0) {
|
||||
pos = Math.pow(10, pos);
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
|
||||
return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erstellt Kontext für hint-Objekt und ermöglicht das Entfernen des Ereignis.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue