2020-12-21 18:41:55 +01:00
|
|
|
// Cloud section ===================== old school code divider =================
|
2020-12-11 16:54:09 +01:00
|
|
|
function rn(from, to) {
|
|
|
|
return ~~(Math.random() * (to - from + 1)) + from;
|
|
|
|
}
|
|
|
|
|
|
|
|
function rs() {
|
|
|
|
return arguments[rn(1, arguments.length) - 1];
|
2020-12-21 18:41:55 +01:00
|
|
|
}
|
2020-12-11 16:54:09 +01:00
|
|
|
|
|
|
|
function boxShadows(max) {
|
|
|
|
let ret = [];
|
|
|
|
for (let i = 0; i < max; ++i) {
|
|
|
|
ret.push(`
|
2021-05-03 12:31:08 +02:00
|
|
|
${ rn(1, 110) }vw ${ rn(1, 110) }vh ${ rn(20, 30) }vmin ${ rn(10, 60) }vmin
|
2020-12-11 16:54:09 +01:00
|
|
|
${ rs('#F52D75', '#CCBD4F', '#32497F', '#EB4377') }
|
|
|
|
`)
|
|
|
|
}
|
|
|
|
return ret.join(',');
|
|
|
|
}
|
|
|
|
|
|
|
|
const cloud = document.querySelector('#cloud');
|
2020-12-29 22:56:28 +01:00
|
|
|
|
2020-12-11 16:54:09 +01:00
|
|
|
function update() {
|
2021-05-03 12:31:08 +02:00
|
|
|
if (window.screen.availWidth > 400 && window.screen.availHeight > 400 ) {
|
2021-05-03 16:26:02 +02:00
|
|
|
cloud.style.boxShadow = boxShadows(30);
|
2021-05-03 12:31:08 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.body.style.backgroundImage = "linear-gradient(to bottom right, white, #F52D75)";
|
|
|
|
}
|
2020-12-21 18:41:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('load', update);
|