This is the varia library website work in progress.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
843 B

// Cloud section ===================== old school code divider =================
function rn(from, to) {
return ~~(Math.random() * (to - from + 1)) + from;
}
function rs() {
return arguments[rn(1, arguments.length) - 1];
}
function boxShadows(max) {
let ret = [];
for (let i = 0; i < max; ++i) {
ret.push(`
${ rn(1, 110) }vw ${ rn(1, 110) }vh ${ rn(20, 30) }vmin ${ rn(10, 60) }vmin
${ rs('#F52D75', '#CCBD4F', '#32497F', '#EB4377') }
`)
}
return ret.join(',');
}
const cloud = document.querySelector('#cloud');
function update() {
if (window.screen.availWidth > 400 && window.screen.availHeight > 400 ) {
cloud.style.boxShadow = boxShadows(30);
}
else {
document.body.style.backgroundImage = "linear-gradient(to bottom right, white, #F52D75)";
}
}
window.addEventListener('load', update);