| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 
 | fn = {
 randomBanner() {
 let bannerArr = [
 {img: 'https://pic.rmb.bdstatic.com/bjh/gallery/cd74cebb550a1ec16303523c61ccd23f.jpeg', author: 'TacoSauceNinja', authorUrl: 'https://www.deviantart.com/tacosauceninja'},
 {img: 'https://pic.rmb.bdstatic.com/bjh/74a696ca0dce0b6d4eb3274bb05eb1ad2682.jpeg', author: '', authorUrl: ''},
 {img: 'https://pic.rmb.bdstatic.com/bjh/e0638488ba8aa4ca152d21ba84b208166612.jpeg', author: '', authorUrl: ''},
 {img: 'https://pic.rmb.bdstatic.com/bjh/b4ae33b8ce6759694cbf668e065f2a43746.jpeg', author: '', authorUrl: ''},
 {img: 'https://pic.rmb.bdstatic.com/bjh/7947c2c64a8fb76858979d44ba88f7ae1098.jpeg', author: '', authorUrl: ''},
 ],
 randomNO = Math.floor(Math.random()*bannerArr.length),
 bannerImg = bannerArr[randomNO].img || '',
 bannerAuthor = bannerArr[randomNO].author || '',
 bannerAuthorUrl = bannerArr[randomNO].authorUrl  || '',
 homeBanner = document.querySelector('.home-banner'),
 bannerAuthorSelector = document.querySelector('.banner-author'),
 bannerAuthorName = document.querySelector('.banner-author-name');
 
 if(!homeBanner) {
 return;
 }
 homeBanner.style.backgroundImage = 'url('+bannerImg+')';
 
 
 
 
 if(!bannerAuthor) {
 bannerAuthorSelector.style.display = 'none';
 }
 else {
 bannerAuthorSelector.style.display = 'inline-block';
 bannerAuthorSelector.setAttribute('href', bannerAuthorUrl);
 bannerAuthorName.textContent = bannerAuthor;
 }
 }
 }
 
 | 
微信
支付宝