Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/banner-images/banner_dark_kyra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/banner-images/banner_dark_kyra2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/banner-images/banner_dark_tim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/banner-images/banner_dark_tim2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/banner-images/banner_light_kyra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/banner-images/banner_light_tim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions js/site.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
"use strict";

$(document).ready(function () {
/* Random Banner Image Selection */
const darkBanners = [
'banner_dark.png',
'banner_dark_tim.png',
'banner_dark_kyra.png',
'banner_dark_tim2.png',
'banner_dark_kyra2.png',
];

const lightBanners = [
'banner_light.png',
'banner_light_tim.png',
'banner_light_kyra.png'
];

// Detect if user prefers dark mode
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;

// Select random banner from appropriate array
const banners = prefersDark ? darkBanners : lightBanners;
const randomBanner = banners[Math.floor(Math.random() * banners.length)];

// Apply the random banner image
const bannerElement = document.getElementById('banner');
if (bannerElement) {
bannerElement.style.backgroundImage = `url('images/banner-images/${randomBanner}')`;
bannerElement.style.backgroundRepeat = 'no-repeat';
bannerElement.style.backgroundPosition = 'center top';
bannerElement.style.backgroundSize = 'cover';
}

/* Video Lightbox */
if (!!$.prototype.simpleLightboxVideo) {
$('.video').simpleLightboxVideo();
Expand Down
Loading