Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
717 B
Text
29 lines
717 B
Text
/**
|
|
* @license
|
|
* Copyright 2016 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
|
|
const SCREENSHOT_TRACE_NAME = 'Screenshot';
|
|
|
|
class Screenshots {
|
|
/**
|
|
* @param {LH.Trace} trace
|
|
* @return {Promise<Array<{timestamp: number, datauri: string}>>}
|
|
*/
|
|
static async compute_(trace) {
|
|
return trace.traceEvents
|
|
.filter(evt => evt.name === SCREENSHOT_TRACE_NAME)
|
|
.map(evt => {
|
|
return {
|
|
timestamp: evt.ts,
|
|
datauri: `data:image/jpeg;base64,${evt.args.snapshot}`,
|
|
};
|
|
});
|
|
}
|
|
}
|
|
|
|
const ScreenshotsComputed = makeComputedArtifact(Screenshots, null);
|
|
export {ScreenshotsComputed as Screenshots};
|