mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 01:17:05 +05:30
feat(scripts): generate dark and light feature graphics
This commit is contained in:
parent
de921bf786
commit
22a2419185
1 changed files with 24 additions and 14 deletions
|
@ -8,20 +8,30 @@ set -euo pipefail
|
|||
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||
SCREENSHOT_DIR="${SCRIPT_DIR}"/../screenshots
|
||||
|
||||
# Run the Maestro flow to generate the screenshots
|
||||
"${SCRIPT_DIR}"/run-maestro-flows.sh feature_graphic.yml
|
||||
function generate_grid() {
|
||||
# Run the Maestro flow to generate the screenshots
|
||||
"${SCRIPT_DIR}"/run-maestro-flows.sh feature_graphic.yml
|
||||
|
||||
# Use imagemagick to stitch the screenshots in a grid
|
||||
montage -tile 2x0 -geometry +0+0 \
|
||||
-border 0 -density 300 \
|
||||
"${SCREENSHOT_DIR}"/HottestPosts.png \
|
||||
"${SCREENSHOT_DIR}"/CommentsPage.png \
|
||||
"${SCREENSHOT_DIR}"/SavedPosts.png \
|
||||
"${SCREENSHOT_DIR}"/SearchPage.png \
|
||||
"${SCRIPT_DIR}"/../.github/readme_feature.png
|
||||
# Use imagemagick to stitch the screenshots in a grid
|
||||
montage -tile 2x0 -geometry +0+0 \
|
||||
-border 0 -density 300 \
|
||||
"${SCREENSHOT_DIR}"/HottestPosts.png \
|
||||
"${SCREENSHOT_DIR}"/CommentsPage.png \
|
||||
"${SCREENSHOT_DIR}"/SavedPosts.png \
|
||||
"${SCREENSHOT_DIR}"/SearchPage.png \
|
||||
"${1:?}.png"
|
||||
|
||||
# Convert the resulting PNG to WebP
|
||||
cwebp .github/readme_feature.png -o .github/readme_feature.webp
|
||||
# Convert the resulting PNG to WebP
|
||||
cwebp "${1:?}.png" -o "${1:?}.webp"
|
||||
|
||||
# Remove the now-useless PNG
|
||||
rm ".github/readme_feature.png"
|
||||
# Remove the now-useless PNG
|
||||
rm "${1:?}.png"
|
||||
}
|
||||
|
||||
adb shell "cmd uimode night no"
|
||||
|
||||
generate_grid "${SCRIPT_DIR}"/../.github/readme_feature_light
|
||||
|
||||
adb shell "cmd uimode night yes"
|
||||
|
||||
generate_grid "${SCRIPT_DIR}"/../.github/readme_feature_dark
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue