diff --git a/server/tests/api.test.ts b/server/tests/api.test.ts index bc85e9c1..b76ed285 100644 --- a/server/tests/api.test.ts +++ b/server/tests/api.test.ts @@ -97,7 +97,7 @@ test("public information and discovery pages are accessible without an authentic assert.match(soundtrack.body, /href="\/privacy"/); assert.match(soundtrack.body, /https:\/\/apps\.apple\.com\/us\/app\/journeydeck\/id6806502526/); assert.match(soundtrack.body, /aria-current="page">Soundtracks<\/a>/); - assert.match(soundtrack.body, /\/assets\/v2\/soundtrack\.jpg/); + assert.match(soundtrack.body, /\/assets\/v2\/soundtrack\.webp/); assert.match(soundtrack.body, /Identify Song uses ShazamKit/); assert.match(soundtrack.body, /rel="preload" as="image"/); assert.match(soundtrack.body, /grand-touring-home-800\.webp\?v=1/); @@ -260,8 +260,8 @@ test("hosted root serves the Grand Touring launch page while private routes stay ["/login-grand-touring.css?v=grand-tour-1", /text\/css/], ["/beta.js?v=v4-1", /javascript/], ["/campaign.js?v=4", /javascript/], - ["/medallions/medallions.css?v=medallions-1", /text\/css/], - ["/medallions/medallions.js?v=medallions-1", /javascript/], + ["/medallions/medallions.css?v=medallions-2", /text\/css/], + ["/medallions/medallions.js?v=medallions-2", /javascript/], ["/medallions/catalog.js", /javascript/], ["/medallions/viewer.js?v=medallions-1", /javascript/], ["/assets/medallions/soundtrack-100-dark.webp", /image\/webp/], diff --git a/server/tests/public-images.test.ts b/server/tests/public-images.test.ts new file mode 100644 index 00000000..8e23c2e7 --- /dev/null +++ b/server/tests/public-images.test.ts @@ -0,0 +1,60 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import { createApp } from "../src/app.js"; +import { fixtureDatabase, root } from "./helpers.js"; + +test("home page hero and scenic photos use versioned responsive srcset", async () => { + const fixture = fixtureDatabase(); + const runtime = await createApp({ databasePath: fixture.filename, root, allowTestAuth: true, legacyUpstream: "", mode: "web" }); + try { + const home = await runtime.app.inject({ method: "GET", url: "/" }); + assert.equal(home.statusCode, 200, home.body); + assert.match(home.body, /rel="preload" as="image"/); + assert.match(home.body, /01-today-400\.webp\?v=1/); + assert.match(home.body, /01-today\.webp\?v=1 660w/); + assert.match(home.body, /imagesrcset="/); + assert.match(home.body, /imagesizes="/); + assert.match(home.body, /fetchpriority="high"/); + assert.match(home.body, /srcset="\/assets\/v4\/01-today-400\.webp\?v=1 400w/); + assert.doesNotMatch(home.body, /data-feature="Today"[^>]*]*loading="lazy"/); + assert.match(home.body, /grand-touring-home-800\.webp\?v=1 800w/); + assert.match(home.body, /grand-touring-home-1600\.webp\?v=1 1600w/); + assert.match(home.body, /favicon-32\.png\?v=app-logo-1/); + assert.match(home.body, /\/assets\/favicon\.png\?v=app-logo-1/); + + for (const [url, mime] of [ + ["/assets/v4/01-today-400.webp?v=1", /image\/webp/], + ["/assets/v4/01-today.webp?v=1", /image\/webp/], + ["/assets/beta/grand-touring-home-800.webp?v=1", /image\/webp/], + ["/assets/beta/grand-touring-home-1600.webp?v=1", /image\/webp/], + ["/assets/v2/soundtrack.webp?v=1", /image\/webp/], + ["/assets/favicon-32.png?v=app-logo-1", /image\/png/], + ["/favicon.ico", /image\/x-icon|image\/vnd\.microsoft\.icon|image\/png|application\/octet-stream/], + ["/assets/medallions/soundtrack-100-redline-pick.webp", /image\/webp/], + ["/assets/medallions/first-note-dark-pick.webp", /image\/webp/] + ] as const) { + const asset = await runtime.app.inject({ method: "GET", url }); + assert.equal(asset.statusCode, 200, url); + assert.match(String(asset.headers["content-type"]), mime, url); + } + + for (const url of [ + "/assets/v4/01-today-400.webp?v=1", + "/assets/beta/grand-touring-home-800.webp?v=1", + "/assets/beta/grand-touring-home-1600.webp?v=1", + "/assets/v2/soundtrack.webp?v=1", + "/assets/favicon-32.png?v=app-logo-1" + ]) { + const versioned = await runtime.app.inject({ method: "GET", url }); + assert.equal(versioned.headers["cache-control"], "public, max-age=31536000, immutable", url); + } + + const soundtrack = await runtime.app.inject({ method: "GET", url: "/apple-music-soundtrack" }); + assert.equal(soundtrack.statusCode, 200, soundtrack.body); + assert.match(soundtrack.body, /\/assets\/v2\/soundtrack\.webp\?v=1/); + assert.doesNotMatch(soundtrack.body, /\/assets\/v2\/soundtrack\.jpg"/); + } finally { + await runtime.app.close(); + fixture.cleanup(); + } +}); diff --git a/web/404.html b/web/404.html index 755ec3a9..752562b6 100644 --- a/web/404.html +++ b/web/404.html @@ -6,6 +6,7 @@ + diff --git a/web/apple-music-soundtrack.html b/web/apple-music-soundtrack.html index 31347636..a7455eab 100644 --- a/web/apple-music-soundtrack.html +++ b/web/apple-music-soundtrack.html @@ -20,6 +20,7 @@ + @@ -78,7 +79,7 @@

Record drives on iPhone with an optional Apple Music soundtrack

THE SOUNDTRACK / JOURNEYDECK 4.0

The songs beside the road.

See the soundtrack saved with a journey in the released iPhone app. Connect Apple Music for optional matching, or use Identify Song yourself when a track catches your ear.

Identify Song uses ShazamKit when you ask it to listen; JourneyDeck does not keep an audio recording.

-
JourneyDeck 4.0 App Store screenshot of the Soundtracks view with songs saved for a drive
Soundtracks in JourneyDeck 4.0
+
JourneyDeck 4.0 App Store screenshot of the Soundtracks view with songs saved for a drive
Soundtracks in JourneyDeck 4.0
diff --git a/web/assets/favicon-32.png b/web/assets/favicon-32.png new file mode 100644 index 00000000..6ab768c6 Binary files /dev/null and b/web/assets/favicon-32.png differ diff --git a/web/assets/medallions/first-note-dark-pick.webp b/web/assets/medallions/first-note-dark-pick.webp new file mode 100644 index 00000000..63ff704c Binary files /dev/null and b/web/assets/medallions/first-note-dark-pick.webp differ diff --git a/web/assets/medallions/first-note-light-pick.webp b/web/assets/medallions/first-note-light-pick.webp new file mode 100644 index 00000000..8c2b0030 Binary files /dev/null and b/web/assets/medallions/first-note-light-pick.webp differ diff --git a/web/assets/medallions/first-note-redline-pick.webp b/web/assets/medallions/first-note-redline-pick.webp new file mode 100644 index 00000000..682d68cc Binary files /dev/null and b/web/assets/medallions/first-note-redline-pick.webp differ diff --git a/web/assets/medallions/first-note-sakura-pick.webp b/web/assets/medallions/first-note-sakura-pick.webp new file mode 100644 index 00000000..479fa409 Binary files /dev/null and b/web/assets/medallions/first-note-sakura-pick.webp differ diff --git a/web/assets/medallions/first-track-dark-pick.webp b/web/assets/medallions/first-track-dark-pick.webp new file mode 100644 index 00000000..4e8dd449 Binary files /dev/null and b/web/assets/medallions/first-track-dark-pick.webp differ diff --git a/web/assets/medallions/first-track-light-pick.webp b/web/assets/medallions/first-track-light-pick.webp new file mode 100644 index 00000000..ab0af7c0 Binary files /dev/null and b/web/assets/medallions/first-track-light-pick.webp differ diff --git a/web/assets/medallions/first-track-redline-pick.webp b/web/assets/medallions/first-track-redline-pick.webp new file mode 100644 index 00000000..64910f4b Binary files /dev/null and b/web/assets/medallions/first-track-redline-pick.webp differ diff --git a/web/assets/medallions/first-track-sakura-pick.webp b/web/assets/medallions/first-track-sakura-pick.webp new file mode 100644 index 00000000..85bacc4e Binary files /dev/null and b/web/assets/medallions/first-track-sakura-pick.webp differ diff --git a/web/assets/medallions/grand-tourer-dark-pick.webp b/web/assets/medallions/grand-tourer-dark-pick.webp new file mode 100644 index 00000000..3948afa3 Binary files /dev/null and b/web/assets/medallions/grand-tourer-dark-pick.webp differ diff --git a/web/assets/medallions/grand-tourer-light-pick.webp b/web/assets/medallions/grand-tourer-light-pick.webp new file mode 100644 index 00000000..fa5ecb6d Binary files /dev/null and b/web/assets/medallions/grand-tourer-light-pick.webp differ diff --git a/web/assets/medallions/grand-tourer-redline-pick.webp b/web/assets/medallions/grand-tourer-redline-pick.webp new file mode 100644 index 00000000..b35186ac Binary files /dev/null and b/web/assets/medallions/grand-tourer-redline-pick.webp differ diff --git a/web/assets/medallions/grand-tourer-sakura-pick.webp b/web/assets/medallions/grand-tourer-sakura-pick.webp new file mode 100644 index 00000000..194e6e04 Binary files /dev/null and b/web/assets/medallions/grand-tourer-sakura-pick.webp differ diff --git a/web/assets/medallions/long-play-dark-pick.webp b/web/assets/medallions/long-play-dark-pick.webp new file mode 100644 index 00000000..2b6ca315 Binary files /dev/null and b/web/assets/medallions/long-play-dark-pick.webp differ diff --git a/web/assets/medallions/long-play-light-pick.webp b/web/assets/medallions/long-play-light-pick.webp new file mode 100644 index 00000000..6873532d Binary files /dev/null and b/web/assets/medallions/long-play-light-pick.webp differ diff --git a/web/assets/medallions/long-play-redline-pick.webp b/web/assets/medallions/long-play-redline-pick.webp new file mode 100644 index 00000000..6fa43a03 Binary files /dev/null and b/web/assets/medallions/long-play-redline-pick.webp differ diff --git a/web/assets/medallions/long-play-sakura-pick.webp b/web/assets/medallions/long-play-sakura-pick.webp new file mode 100644 index 00000000..b1b926d3 Binary files /dev/null and b/web/assets/medallions/long-play-sakura-pick.webp differ diff --git a/web/assets/medallions/long-way-home-dark-pick.webp b/web/assets/medallions/long-way-home-dark-pick.webp new file mode 100644 index 00000000..e5ef8431 Binary files /dev/null and b/web/assets/medallions/long-way-home-dark-pick.webp differ diff --git a/web/assets/medallions/long-way-home-light-pick.webp b/web/assets/medallions/long-way-home-light-pick.webp new file mode 100644 index 00000000..ce0aab76 Binary files /dev/null and b/web/assets/medallions/long-way-home-light-pick.webp differ diff --git a/web/assets/medallions/long-way-home-redline-pick.webp b/web/assets/medallions/long-way-home-redline-pick.webp new file mode 100644 index 00000000..bcd966a3 Binary files /dev/null and b/web/assets/medallions/long-way-home-redline-pick.webp differ diff --git a/web/assets/medallions/long-way-home-sakura-pick.webp b/web/assets/medallions/long-way-home-sakura-pick.webp new file mode 100644 index 00000000..94ba1a75 Binary files /dev/null and b/web/assets/medallions/long-way-home-sakura-pick.webp differ diff --git a/web/assets/medallions/memory-maker-dark-pick.webp b/web/assets/medallions/memory-maker-dark-pick.webp new file mode 100644 index 00000000..4164cdc6 Binary files /dev/null and b/web/assets/medallions/memory-maker-dark-pick.webp differ diff --git a/web/assets/medallions/memory-maker-light-pick.webp b/web/assets/medallions/memory-maker-light-pick.webp new file mode 100644 index 00000000..a5b80891 Binary files /dev/null and b/web/assets/medallions/memory-maker-light-pick.webp differ diff --git a/web/assets/medallions/memory-maker-redline-pick.webp b/web/assets/medallions/memory-maker-redline-pick.webp new file mode 100644 index 00000000..7da19dc4 Binary files /dev/null and b/web/assets/medallions/memory-maker-redline-pick.webp differ diff --git a/web/assets/medallions/memory-maker-sakura-pick.webp b/web/assets/medallions/memory-maker-sakura-pick.webp new file mode 100644 index 00000000..56039710 Binary files /dev/null and b/web/assets/medallions/memory-maker-sakura-pick.webp differ diff --git a/web/assets/medallions/picture-this-dark-pick.webp b/web/assets/medallions/picture-this-dark-pick.webp new file mode 100644 index 00000000..84989b97 Binary files /dev/null and b/web/assets/medallions/picture-this-dark-pick.webp differ diff --git a/web/assets/medallions/picture-this-light-pick.webp b/web/assets/medallions/picture-this-light-pick.webp new file mode 100644 index 00000000..e9dd9ba9 Binary files /dev/null and b/web/assets/medallions/picture-this-light-pick.webp differ diff --git a/web/assets/medallions/picture-this-redline-pick.webp b/web/assets/medallions/picture-this-redline-pick.webp new file mode 100644 index 00000000..58e70da8 Binary files /dev/null and b/web/assets/medallions/picture-this-redline-pick.webp differ diff --git a/web/assets/medallions/picture-this-sakura-pick.webp b/web/assets/medallions/picture-this-sakura-pick.webp new file mode 100644 index 00000000..2d66a532 Binary files /dev/null and b/web/assets/medallions/picture-this-sakura-pick.webp differ diff --git a/web/assets/medallions/soundtrack-100-dark-pick.webp b/web/assets/medallions/soundtrack-100-dark-pick.webp new file mode 100644 index 00000000..f8bb0441 Binary files /dev/null and b/web/assets/medallions/soundtrack-100-dark-pick.webp differ diff --git a/web/assets/medallions/soundtrack-100-light-pick.webp b/web/assets/medallions/soundtrack-100-light-pick.webp new file mode 100644 index 00000000..4bbcb0a4 Binary files /dev/null and b/web/assets/medallions/soundtrack-100-light-pick.webp differ diff --git a/web/assets/medallions/soundtrack-100-redline-pick.webp b/web/assets/medallions/soundtrack-100-redline-pick.webp new file mode 100644 index 00000000..3ece1e63 Binary files /dev/null and b/web/assets/medallions/soundtrack-100-redline-pick.webp differ diff --git a/web/assets/medallions/soundtrack-100-sakura-pick.webp b/web/assets/medallions/soundtrack-100-sakura-pick.webp new file mode 100644 index 00000000..098a0066 Binary files /dev/null and b/web/assets/medallions/soundtrack-100-sakura-pick.webp differ diff --git a/web/assets/medallions/story-collector-dark-pick.webp b/web/assets/medallions/story-collector-dark-pick.webp new file mode 100644 index 00000000..7d52d33d Binary files /dev/null and b/web/assets/medallions/story-collector-dark-pick.webp differ diff --git a/web/assets/medallions/story-collector-light-pick.webp b/web/assets/medallions/story-collector-light-pick.webp new file mode 100644 index 00000000..d50b7b99 Binary files /dev/null and b/web/assets/medallions/story-collector-light-pick.webp differ diff --git a/web/assets/medallions/story-collector-redline-pick.webp b/web/assets/medallions/story-collector-redline-pick.webp new file mode 100644 index 00000000..62419165 Binary files /dev/null and b/web/assets/medallions/story-collector-redline-pick.webp differ diff --git a/web/assets/medallions/story-collector-sakura-pick.webp b/web/assets/medallions/story-collector-sakura-pick.webp new file mode 100644 index 00000000..1a135a61 Binary files /dev/null and b/web/assets/medallions/story-collector-sakura-pick.webp differ diff --git a/web/assets/medallions/thousand-mile-dark-pick.webp b/web/assets/medallions/thousand-mile-dark-pick.webp new file mode 100644 index 00000000..602250d4 Binary files /dev/null and b/web/assets/medallions/thousand-mile-dark-pick.webp differ diff --git a/web/assets/medallions/thousand-mile-light-pick.webp b/web/assets/medallions/thousand-mile-light-pick.webp new file mode 100644 index 00000000..f447813b Binary files /dev/null and b/web/assets/medallions/thousand-mile-light-pick.webp differ diff --git a/web/assets/medallions/thousand-mile-redline-pick.webp b/web/assets/medallions/thousand-mile-redline-pick.webp new file mode 100644 index 00000000..33ae151b Binary files /dev/null and b/web/assets/medallions/thousand-mile-redline-pick.webp differ diff --git a/web/assets/medallions/thousand-mile-sakura-pick.webp b/web/assets/medallions/thousand-mile-sakura-pick.webp new file mode 100644 index 00000000..239aeacd Binary files /dev/null and b/web/assets/medallions/thousand-mile-sakura-pick.webp differ diff --git a/web/assets/v2/soundtrack.webp b/web/assets/v2/soundtrack.webp new file mode 100644 index 00000000..b5da1ed3 Binary files /dev/null and b/web/assets/v2/soundtrack.webp differ diff --git a/web/assets/v4/01-today-400.webp b/web/assets/v4/01-today-400.webp new file mode 100644 index 00000000..13c97d8f Binary files /dev/null and b/web/assets/v4/01-today-400.webp differ diff --git a/web/beta.html b/web/beta.html index 56a18be7..e1465151 100644 --- a/web/beta.html +++ b/web/beta.html @@ -21,16 +21,18 @@ - + + - + + - + JourneyDeck: Take the road. Keep the story.