Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomayac/dark-mode-screenshot
This Puppeteer script takes a 📷 screenshot of a webpage in 🌞 Light and 🌒 Dark Mode.
https://github.com/tomayac/dark-mode-screenshot
dark-mode dark-theme puppeteer screenshot
Last synced: 2 months ago
JSON representation
This Puppeteer script takes a 📷 screenshot of a webpage in 🌞 Light and 🌒 Dark Mode.
- Host: GitHub
- URL: https://github.com/tomayac/dark-mode-screenshot
- Owner: tomayac
- License: apache-2.0
- Created: 2019-08-16T08:59:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T08:18:40.000Z (almost 2 years ago)
- Last Synced: 2024-10-06T07:51:34.630Z (3 months ago)
- Topics: dark-mode, dark-theme, puppeteer, screenshot
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/dark-mode-screenshot
- Size: 1.39 MB
- Stars: 59
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dark Mode Screenshot 📷🌒
This [Puppeteer](https://github.com/GoogleChrome/puppeteer/) script
takes a screenshot of a webpage in Light and Dark Mode.
Dark Mode
Light Mode
screenshot-dark.png
screenshot-light.png
## 👩💻 Usage
Locally from the command line:
```bash
$ node dark-mode-screenshot.js --url https://googlechromelabs.github.io/dark-mode-toggle/demo/ --output screenshot --fullPage --pause 750
```Without installing remotely from npm:
```bash
$ npx dark-mode-screenshot --url https://googlechromelabs.github.io/dark-mode-toggle/demo/ --output screenshot --fullPage --pause 750
```| Parameter (long) | Parameter (short) | Description |
| --- | --- | --- |
| `--url` | `-u` | The URL of the webpage, defaults to `https://googlechromelabs.github.io/dark-mode-toggle/ demo/index.html`. |
| `--output` | `-o` | The file prefix of the screenshot (there will be a light and a dark file), defaults to `screenshot`. |
| `--fullPage` | `-f` | Whether or not to take a full page screenshot, defaults to `true`. |
| `--pause` | `-p` | Time in milliseconds to pause before taking each screenshot, defaults to `0`. |## Acknowledgements
Thanks to [@mathiasbynens](https://github.com/mathiasbynens) for implementing
[`page.emulateMediaFeatures(features)`](https://github.com/GoogleChrome/puppeteer/blob/v2.0.0/docs/api.md#pageemulatemediatypetype)
in Puppeteer and for making this script a lot lighter.## 📄 License
Apache 2.0