mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
Pin the page clock to an Austin afternoon in the Navara bloom and style checks
The look's sun follows the page clock, so the frame these checks compare was as bright as the hour they ran at: in the acceptance run the half-strength bloom changed the frame by 0.29 against 3.5 earlier, and at dusk the full bloom changes nothing (luma 13).
This commit is contained in:
1 parent
91685c94d9
commit
f87da8523e
3 files changed
+31
No files matched your search
@@ -21,6 +21,7 @@ import {
|
||||
diff,
|
||||
freeze,
|
||||
pickStyle,
|
||||
pinDaytime,
|
||||
saveCapture,
|
||||
stats,
|
||||
visualPageUrl,
|
||||
@@ -58,6 +59,9 @@ await strict.run(
|
||||
const page = await browser.newPage();
|
||||
const errors = [];
|
||||
page.on('pageerror', (error) => errors.push(error.message));
|
||||
// The same sun on every run: the frame's brightness decides what blooms
|
||||
// and what each style's signature reads.
|
||||
await pinDaytime(page);
|
||||
await page.evaluateOnNewDocument(() => {
|
||||
localStorage.setItem('gev:first-run-mission:v1', 'suppressed');
|
||||
});
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
freeze,
|
||||
histogramShift,
|
||||
pickStyle,
|
||||
pinDaytime,
|
||||
saveCapture,
|
||||
stats,
|
||||
visualPageUrl,
|
||||
@@ -50,6 +51,9 @@ await strict.run(
|
||||
const page = await browser.newPage();
|
||||
const errors = [];
|
||||
page.on('pageerror', (error) => errors.push(error.message));
|
||||
// The same sun on every run: the frame's brightness decides what blooms
|
||||
// and what each style's signature reads.
|
||||
await pinDaytime(page);
|
||||
await page.evaluateOnNewDocument(() => {
|
||||
localStorage.setItem('gev:first-run-mission:v1', 'suppressed');
|
||||
});
|
||||
|
||||
@@ -11,6 +11,29 @@ import sharp from 'sharp';
|
||||
export const STILL_VIEW =
|
||||
'v=2&lat=30.2672&lon=-97.7431&alt=20000&heading=0&pitch=-70&map=osm&l=';
|
||||
|
||||
/**
|
||||
* Before the app loads: the page's Date runs from `utc` on, so the look's
|
||||
* sun (and with it the frame's brightness, which the bloom threshold and
|
||||
* the styles' signatures read) does not follow the time of day the
|
||||
* scenario happens to run at. Default: Austin early afternoon.
|
||||
*/
|
||||
export function pinDaytime(page, utc = '2026-11-03T18:30:00Z') {
|
||||
return page.evaluateOnNewDocument((utc) => {
|
||||
const offset = Date.parse(utc) - Date.now();
|
||||
const RealDate = Date;
|
||||
class ShiftedDate extends RealDate {
|
||||
constructor(...args) {
|
||||
if (args.length === 0) super(RealDate.now() + offset);
|
||||
else super(...args);
|
||||
}
|
||||
static now() {
|
||||
return RealDate.now() + offset;
|
||||
}
|
||||
}
|
||||
globalThis.Date = ShiftedDate;
|
||||
}, utc);
|
||||
}
|
||||
|
||||
/** The keyless page on `engine` with the still view (and `extra` hash). */
|
||||
export const visualPageUrl = (origin, engine, extra = '', view = STILL_VIEW) =>
|
||||
`${origin}/?engine=${engine}&welcome=0&look=cinematic#${view}${extra}`;
|
||||
|
||||
Reference in new issue
Block a user