Skip to content
Open
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
76 changes: 46 additions & 30 deletions bun.lock

Large diffs are not rendered by default.

68 changes: 38 additions & 30 deletions e2e/screenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,43 @@ import {
} from '@screenly/edge-apps/test/screenshots'
import path from 'path'

const { screenlyJsContent } = createMockScreenlyForScreenshots(
{},
{
duration: '60',
override_locale: 'en',
override_timezone: 'America/New_York',
display_errors: 'false',
},
)

for (const { width, height } of RESOLUTIONS) {
test(`screenshot ${width}x${height}`, async ({ browser }) => {
const screenshotsDir = getScreenshotsDir()

const context = await browser.newContext({ viewport: { width, height } })
const page = await context.newPage()

// Setup mocks
await setupClockMock(page)
await setupScreenlyJsMock(page, screenlyJsContent)

await page.goto('/')
await page.waitForLoadState('networkidle')

await page.screenshot({
path: path.join(screenshotsDir, `${width}x${height}.png`),
fullPage: false,
})
const VARIANTS = [
{ prefix: '', mode: 'ring' },
{ prefix: 'digits-', mode: 'digits' },
]

for (const { prefix, mode } of VARIANTS) {
const { screenlyJsContent } = createMockScreenlyForScreenshots(
{},
{
display_errors: 'false',
duration: '60',
mode,
override_locale: 'en',
override_timezone: 'America/New_York',
},
)

for (const { width, height } of RESOLUTIONS) {
test(`screenshot ${prefix}${width}x${height}`, async ({ browser }) => {
const screenshotsDir = getScreenshotsDir()

const context = await browser.newContext({ viewport: { width, height } })
const page = await context.newPage()

await context.close()
})
// Setup mocks
await setupClockMock(page)
await setupScreenlyJsMock(page, screenlyJsContent)

await page.goto('/')
await page.waitForLoadState('networkidle')

await page.screenshot({
path: path.join(screenshotsDir, `${prefix}${width}x${height}.png`),
fullPage: false,
})

await context.close()
})
}
}
31 changes: 12 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,19 @@
reference-height="1080"
orientation="auto"
>
<div id="app">
<app-header class="header"></app-header>
<main class="content">
<section class="timer-section">
<div class="date-text" data-date>--</div>
<div class="timer-card">
<div class="progress-ring-container" data-progress-ring></div>
<div class="timer-display">
<div class="timer-digits" data-timer-digits>00:00:00</div>
<div class="timer-total" data-timer-total>--</div>
</div>
</div>
</section>
</main>
</div>
<main class="timer">
<p class="timer-date" data-date></p>
<div class="timer-ring" data-progress-ring>
<div class="timer-display">
<p class="timer-digits" data-timer-digits>
<span data-time-prefix></span
><span class="timer-seconds" data-time-seconds></span>
</p>
<p class="timer-total" data-timer-total></p>
</div>
</div>
</main>
</auto-scaler>
<template id="timer-digits-template">
<span data-time-prefix></span
><span class="accent" data-time-seconds></span>
</template>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"prettier": "./.prettierrc.json",
"devDependencies": {
"@playwright/test": "^1.60.0",
"@screenly/edge-apps": "^1.2.1",
"@screenly/edge-apps": "^1.5.0",
"@types/bun": "^1.3.14",
"@types/jsdom": "^28.0.3",
"bun-types": "^1.3.14",
Expand Down
15 changes: 15 additions & 0 deletions screenly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ settings:
help_text: Timer duration in seconds (e.g., 60 for 1 minute, 300 for 5 minutes, 3600 for 1 hour).
type: number
schema_version: 1
mode:
type: string
default_value: ring
title: Mode
optional: true
help_text:
properties:
help_text: Choose the layout for where the screen is placed.
options:
- label: Ring (date and progress ring)
value: ring
- label: Digits only (maximum readability at a distance)
value: digits
type: select
schema_version: 1
override_locale:
type: string
default_value: en
Expand Down
15 changes: 15 additions & 0 deletions screenly_qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ settings:
help_text: Timer duration in seconds (e.g., 60 for 1 minute, 300 for 5 minutes, 3600 for 1 hour).
type: number
schema_version: 1
mode:
type: string
default_value: ring
title: Mode
optional: true
help_text:
properties:
help_text: Choose the layout for where the screen is placed.
options:
- label: Ring (date and progress ring)
value: ring
- label: Digits only (maximum readability at a distance)
value: digits
type: select
schema_version: 1
override_locale:
type: string
default_value: en
Expand Down
Binary file modified screenshots/1080x1920.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/1280x720.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/1920x1080.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/2160x3840.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/2160x4096.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/3840x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/4096x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/480x800.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/720x1280.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/800x480.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-1080x1920.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-1280x720.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-1920x1080.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-2160x3840.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-2160x4096.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-3840x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-4096x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-480x800.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-720x1280.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/digits-800x480.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading