Skip to content

Commit

Permalink
docs: add light/dark screenshots
Browse files Browse the repository at this point in the history
and automate the process of generating these screenshots
  • Loading branch information
AviVahl committed Jan 6, 2025
1 parent 0a6c780 commit 6e79e51
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Example Electron Application

![Screenshot](/docs/screenshot.png)

An example to showcase a typescript-based electron application.

Uses native esm everywhere possible (`main` and `renderer`), as electron 28 now supports it. `preload` bundle is still commonjs to allow sandbox.
Expand All @@ -24,6 +22,16 @@ Showcases creation of a direct communication channel between the renderer and ma

`npm run typecheck` - checks sources using typescript.

## Screenshots

### Dark Theme

![Screenshot](docs/screenshot-dark.png)

### Light Theme

![Screenshot](docs/screenshot-light.png)

## Prerequisites for `build:full`

On a freshly installed Fedora 39, with all updates:
Expand Down
Binary file added docs/screenshot-dark.png
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 docs/screenshot-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/screenshot.png
Binary file not shown.
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^5.1.0",
"playwright": "^1.49.1",
"prettier": "^3.4.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
12 changes: 12 additions & 0 deletions scripts/generate-screenshots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { fileURLToPath } from "node:url";
import { _electron as electron } from "playwright";

for (const colorScheme of ["light", "dark"]) {
const app = await electron.launch({ args: ["."], colorScheme });
const window = await app.firstWindow();
await window.screenshot({
type: "png",
path: fileURLToPath(new URL(`../docs/screenshot-${colorScheme}.png`, import.meta.url)),
});
await app.close();
}

0 comments on commit 6e79e51

Please sign in to comment.