trigen/js/test.js

46 lines
1.1 KiB
JavaScript

let obj1 = document.getElementById("CanvasWidth");
let obj2 = document.getElementById("CanvasHeight");
let current1 = null;
let current2 = null;
function countup() {
current1 = parseInt(obj1.value);
current2 = parseInt(obj2.value);
current1 = current1 + 16;
current2 = current2 + 9;
obj1.value = current1;
obj2.value = current2;
selectedColorPattern = generateRandColor()
pattern = generateCanvas(targetCanvas);
}
//let counter = setInterval(countup, 10);
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results==null) {
return null;
}
return decodeURI(results[1]) || 0;
}
let urlParams = new URLSearchParams(window.location.search);
//if (debugmode) {
if (urlParams.has("rick")) {
console.warn("You are getting ricked in randomness ;)");
}
//} else {
// console.warn("You are NOT getting ricked in randomness ;)");
//}
//console.log(urlParams.toString());
console.info("FUCK= " + $.urlParam('fuck'));
console.info("RICK= " + $.urlParam('norick'));