Skip to content
Open
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
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,17 @@ <h2 class="text-4xl md:text-5xl font-bold mb-4">Photos</h2>
return data.files || [];
}

function shuffleArray(array) {
let currentIndex = array.length, randomIndex;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability/consistency with the surrounding code (which declares one variable per statement), avoid comma-separated let declarations here and split currentIndex and randomIndex into separate declarations.

Suggested change
let currentIndex = array.length, randomIndex;
let currentIndex = array.length;
let randomIndex;

Copilot uses AI. Check for mistakes.
while (currentIndex != 0) {
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces the only non-strict comparison in the file (!=). To match the rest of the code (which consistently uses !==), please change the loop condition to a strict/clear check (e.g., currentIndex !== 0 or currentIndex > 0).

Suggested change
while (currentIndex != 0) {
while (currentIndex > 0) {

Copilot uses AI. Check for mistakes.
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
return array;
}

async function loadAlbum(albumKey) {
if (albumState[albumKey]?.loaded) return;

Expand All @@ -1497,7 +1508,7 @@ <h2 class="text-4xl md:text-5xl font-bold mb-4">Photos</h2>
}

// Randomize order for that "alive" feel
items.sort(() => Math.random() - 0.5);
shuffleArray(items);

const grid = document.createElement('div');
grid.className = 'album-grid';
Expand Down
3 changes: 3 additions & 0 deletions server.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
127.0.0.1 - - [27/Feb/2026 08:18:50] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Feb/2026 08:19:15] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Feb/2026 08:19:15] "GET /flower.jpg HTTP/1.1" 200 -