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.
21 lines
1.0 KiB
21 lines
1.0 KiB
$(async function() {
|
|
//вам смешно,а мне нет
|
|
ChangeBackgoundImageRandom();
|
|
});
|
|
|
|
function ChangeBackgoundImageRandom() {
|
|
var images=new Array(
|
|
'https://sun9-54.userapi.com/impf/L4gabJSytEz1NpTNLMMY4H2I0Ii2G8BZWLF43w/qYSHLfNsb7s.jpg?size=1920x1080&quality=96&proxy=1&sign=dd5b204676b475018a320a3ea4da605d&type=album',
|
|
'https://sun9-47.userapi.com/impf/W24ZlAJv_hRsfSWo52xJuQxiYsLIBACpZrZLZQ/PloSNn9b2mQ.jpg?size=1920x1080&quality=96&proxy=1&sign=1fd9c7ede5a4824442b79bff28bcc928&type=album',
|
|
'https://sun9-56.userapi.com/impf/gumag_-zFNTd9kxmAlDnX12T1kOzx10Nel8NBg/cQlqHiyWdxQ.jpg?size=1920x1080&quality=96&proxy=1&sign=1c348f58c41e5ebc19e49e6bd9535998&type=album');
|
|
ChangeBackgoundImage(images[getRandomInt(images.length-1)]);
|
|
}
|
|
|
|
function getRandomInt(max) {
|
|
return Math.floor(Math.random() * max);
|
|
}
|
|
|
|
function ChangeBackgoundImage(url) {
|
|
let sample = `linear-gradient(to bottom, rgba(46, 13, 3, 0), rgba(34, 10, 3, 0.46)),url('${url}')`
|
|
document.getElementById('main_container').style.backgroundImage = sample;
|
|
}
|