Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Checks

on:
push:
branches:
- development
- main
- master
pull_request:
branches:
- development
- main
- master

permissions:
contents: read

jobs:
checks:
uses: Screenly/edge-apps-actions/.github/workflows/checks.yml@v26.10.2
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
*.log
.DS_Store
static/js/*.js
static/js/*.js.map
screenshots/*.png
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
92 changes: 45 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,77 @@

# Screenly Countdown Timer App

![Countdown Timer Screen](./static/img/TimerPreview.png)
![Countdown Timer App Preview](./screenshots/1920x1080.webp)

## Installation
Counts down the days, hours, minutes and seconds to a target date, with a progress bar from the start date to the target. When the countdown reaches zero, the end message replaces the digits.

## Getting Started

```bash
$ cd edge-apps/countdown-timer
$ screenly edge-app create \
--name countdown-timer \
--in-place
$ screenly edge-app deploy
[...] # You can tweak settings here.
# To install an app, you need to create an instance.
$ screenly edge-app instance create

# Alternatively, you can use --latest in place of --revision.
bun install
```

## Tweaking the settings

### `target_timestamp`
## Deployment

To set the countdown timer, we can use the `target_timestamp` settings.
Create and deploy the Edge App:

```bash
$ Screenly edge-app setting set target_timestamp=2024-03-14T00:00:00
# A relatively long console output...
Edge app setting successfully set.
screenly edge-app create --name my-countdown-timer --in-place
bun run deploy
screenly edge-app instance create
```

where `2024-03-14T00:00:00` your countdown timer limit with `YYYY-MM-DDTHH:MM:SS` format.

### `countdown_headline`
### Releasing

To set the countdown timer headline, we can use the `countdown_headline` settings.
Pushes to `main` start a stage deploy, which waits for approval. To release to production, tag a commit on `main` and push the tag (the workflow refuses tags not on `main`); the production deploy also waits for approval:

```bash
$ Screenly edge-app setting set countdown_headline='New Year Countdown'
# A relatively long console output...
Edge app setting successfully set.
git checkout main && git pull
git tag v26.10.0
git push origin v26.10.0
```

### `override_timezone`

For instance, if you want to set the countdown timer as per the current date and time in London,
run the following command after setting the timer:
Then publish a GitHub Release whose notes list the pull requests merged since the previous release. Add `--draft` to review the notes before publishing:

```bash
$ screenly edge-app setting set override_timezone='Europe/Paris'
# A relatively long console output...
Edge app setting successfully set.

$ screenly edge-app setting set override_locale='fr'
# A relatively long console output...
Edge app setting successfully set.
gh release create v26.10.0 --verify-tag --generate-notes --title v26.10.0
```

See [this page](https://momentjs.com/) for the list of all possible values for the time zone.
Alternatively, you can call `moment.locales()`, which returns all the supported locale values.
## Configuration

Setting invalid values for the timezone won't crash the app itself, it'll just fall back to the default time.
The app accepts the following settings via `screenly.yml`:

## Releasing
| Setting | Description | Type | Default |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | --------------------- |
| `countdown_headline` | Headline displayed above the countdown | required | `New Year Countdown` |
| `target_timestamp` | When the countdown ends (`YYYY-MM-DDTHH:MM:SS`), read as local time in the screen's timezone. Add an offset (e.g. `Z` or `+02:00`) to pin it explicitly | required | `2028-01-01T00:00:00` |
| `starting_timestamp` | When the countdown begins (`YYYY-MM-DDTHH:MM:SS`), used for the progress bar. The bar is hidden if this is not before the target | required | `2025-01-01T00:00:00` |
| `countdown_end_text` | Message displayed when the countdown reaches zero | required | `Countdown Finished!` |
| `override_locale` | Override the locale used for unit labels and dates (e.g. `en`, `fr`, `de`) | optional, advanced | `en` |
| `override_timezone` | Override the timezone (e.g. `Europe/London`, `America/New_York`). Defaults to the screen's timezone if left blank | optional, advanced | - |
| `display_errors` | Display detailed error messages on screen for debugging purposes | optional, advanced | `false` |

Pushes to `main` start a stage deploy, which waits for approval. To release to production, tag a commit on `main` and push the tag (the workflow refuses tags not on `main`); the production deploy also waits for approval:
The accent color follows the screen's brand settings.

## Development

```bash
git checkout main && git pull
git tag v26.10.0
git push origin v26.10.0
bun install # Install dependencies
bun run dev # Start development server
```

Then publish a GitHub Release whose notes list the pull requests merged since the previous release. Add `--draft` to review the notes before publishing:
## Testing

```bash
gh release create v26.10.0 --verify-tag --generate-notes --title v26.10.0
bun test
```

## Screenshots

Generate screenshots at all supported resolutions:

```bash
bun run screenshots
```

Screenshots are saved to the `screenshots/` directory.
Loading