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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ time the changelog page groups these bullets by the master commit that added the
git: each group shows the commit's short hash and date, and its tag if the commit has one.
So a release is simply a tag on master.

- The browser's title bar and toolbar (Safari, and Chrome on Android) now take the color of the selected theme when a page loads instead of staying bright in dark mode; switching the theme on a page already open still needs a reload to update it in Safari
- Switching the theme from the theme button now plays a circular reveal that grows out of the button (in browsers that support view transitions and when reduced motion is not requested)
- Capped the "no data for this time range" illustration on the timeline page at a sensible width and centered it, instead of letting it stretch across a wide desktop window
- Navigating between the top-bar tabs now animates in browsers that support view transitions (Safari 18.2+, Chrome): the blue underline slides to the new tab and the page slides out and in; other browsers navigate as before
Expand Down
15 changes: 15 additions & 0 deletions spybot-web/src/main/resources/static/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@

const themeStorageKey = 'tablerTheme'

// Header (navbar) background per theme. Browsers such as Safari tint their title/tab bar with the
// theme-color meta tag, so keep it in sync with the theme instead of leaving the bar bright in dark mode.
const browserThemeColors = {light: '#ffffff', dark: '#1e293b'}

function setBrowserThemeColor(realTheme) {
let meta = document.querySelector('meta[name="theme-color"]')
if (!meta) {
meta = document.createElement('meta')
meta.name = 'theme-color'
document.head.appendChild(meta)
}
meta.content = browserThemeColors[realTheme]
}

function configureTheme(wantedTheme) {
function readTheme(wantedTheme, urlParams, allowedValues) {
if (allowedValues.has(wantedTheme)) {
Expand Down Expand Up @@ -39,6 +53,7 @@ function configureTheme(wantedTheme) {
}

document.body.setAttribute("data-spybot-theme", theme)
setBrowserThemeColor(realTheme)
}

console.log("configuring theme")
Expand Down
Loading