Unsplash Example
Unsplash Beispiel:
!(async()=>{
var keywords = \['community','start',
'social', 'party','forum',
'festival', 'coffee', 'gossip'\];
var month = (new Date()).getMonth();
switch(month){
case 4:
case 5:
case 6:
case 7:
keywords.push('summer');
keywords.push('swimming');
keywords.push('sunshine');
keywords.push('beach');
break;
case 8:
case 9:
case 10:
keywords.push('autumn');
break;
case 0:
case 1:
case 11:
keywords.push('winter');
keywords.push('snow');
keywords.push('christmas');
break;
case 2:
case 3:
keywords.push('spring');
break;
default: break;}
var keyword = (function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() \* (i + 1));
x = a\[i\];
a\[i\] = a\[j\];
a\[j\] = x;
}
return a;
})(keywords).shift();
//var size = '3840x2160';
//var size = '800x800';
setTimeout(()=>{
var height = document.body.offsetHeight;
var width = document.body.offsetWidth;
var size = width + 'x' + height;
var url = '[https://source.unsplash.com/featured/](https://source.unsplash.com/featured/)' + size + '?' +keyword;
document.body.style.background='url(' + url +')';
},250);
})();
Melanie Wehowski ·
Melanie Wehowski · · Last updated Jul 8, 2023 - 6:51 PM