add randomized background images
This commit is contained in:
@@ -436,3 +436,19 @@ const app2 = createApp({
|
||||
});
|
||||
app2.mount("#app2");
|
||||
|
||||
// Randomly set the background image for .kbcc-background-image
|
||||
(function () {
|
||||
const images = [
|
||||
"https://libapps.s3.amazonaws.com/accounts/16298/images/library_front_view.jpg",
|
||||
"https://d2jv02qf7xgjwx.cloudfront.net/accounts/16298/images/copy_for_it.jpg",
|
||||
"https://d2jv02qf7xgjwx.cloudfront.net/accounts/16298/images/Library_Website_Background_Images_005.jpg",
|
||||
"https://d2jv02qf7xgjwx.cloudfront.net/accounts/16298/images/Library_Website_Background_Images_002.jpg",
|
||||
];
|
||||
var picked = images[Math.floor(Math.random() * images.length)];
|
||||
var el = document.querySelector(".kbcc-background-image");
|
||||
if (el) {
|
||||
el.style.backgroundImage =
|
||||
"linear-gradient(to bottom, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.6) 100%), url('" + picked + "')";
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user