openvibers/openvibe.games Commits

Creator world cards follow the reader's theme (#246)

OP OpenVibers committed 12 days ago · baea9ef734 · 3 files, +23 −2

Changes

ddiff --git a/apps/client/worlds.html b/apps/client/worlds.html
iindex dcd22ff..ed62304 100644
---- a/apps/client/worlds.html
++++ b/apps/client/worlds.html
@@@ -163,9 +163,9 @@
gap: 8px;
min-width: 0;
padding: 16px;
-- border: 1px solid var(--border);
++ border: 1px solid var(--border, #1f2d47);
border-radius: 16px;
-- background: var(--bg-raised);
++ background: var(--bg-card, #101828);
}
.card h3 {
margin: 0;
ddiff --git a/apps/server/src/net/worldsPage.test.ts b/apps/server/src/net/worldsPage.test.ts
nnew file mode 100644
iindex 0000000..c0f737a
---- /dev/null
++++ b/apps/server/src/net/worldsPage.test.ts
@@@ -0,0 +1,18 @@
++import { describe, expect, it } from 'vitest'
++import { readFileSync } from 'node:fs'
++import { fileURLToPath } from 'node:url'
++
++const client = fileURLToPath(new URL('../../../client/', import.meta.url))
++const page = readFileSync(`${client}worlds.html`, 'utf8')
++
++/**
++ * The creator worlds list follows the reader's theme: a fixed dark panel under the theme's secondary text read
++ * 2.1:1 on Daylight. The card takes the theme's card and border; the dark look is only the fallback.
++ */
++describe('the creator worlds list on a light theme', () => {
++ it('draws its cards on the theme, not a fixed dark panel', () => {
++ expect(page).toMatch(/\.card \{[^}]*background: var\(--bg-card, #101828\);/)
++ expect(page).toMatch(/\.card \{[^}]*border: 1px solid var\(--border, #1f2d47\);/)
++ expect(page).not.toMatch(/\.card \{[^}]*background: var\(--bg-raised\)/)
++ })
++})
ddiff --git a/test/apps__server__src__net__worldsPage.test.js b/test/apps__server__src__net__worldsPage.test.js
nnew file mode 100644
iindex 0000000..0fb9812
---- /dev/null
++++ b/test/apps__server__src__net__worldsPage.test.js
@@@ -0,0 +1,3 @@
++// file: 'apps/server/src/net/worldsPage.test.ts'
++// covers: 'apps/server/src/net'
++// Generated by node test/run.js --index; do not edit.