Add intial site layout, basic css, page structure, etc
This commit is contained in:
32
js/custom.js
Normal file
32
js/custom.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// Some quick scripting to select a random background on page load
|
||||
|
||||
const BACKGROUND_IMAGES = [
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-allis.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-boston.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-denver.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-geese.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-hotel.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-lawrencedam.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-letchworth.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-library.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-lighthouse.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-mbta.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-rockyshore.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-rt112.jpg",
|
||||
"https://cdn.enp.one/img/backgrounds/cl-photo-startrek.jpg",
|
||||
];
|
||||
|
||||
|
||||
function selectBackground() {
|
||||
let max = BACKGROUND_IMAGES.length - 1
|
||||
let min = 0;
|
||||
index = Math.round(Math.random() * (max - min) + min);
|
||||
console.log("Loading background #" + index + ": " + BACKGROUND_IMAGES[index]);
|
||||
return BACKGROUND_IMAGES[index];
|
||||
}
|
||||
|
||||
|
||||
function setBackground() {
|
||||
let ref = document.getElementById("background-image");
|
||||
ref.style.backgroundImage = "url(" + selectBackground() + ")";
|
||||
}
|
||||
Reference in New Issue
Block a user