Skip to content

Commit e2dd641

Browse files
florianLSPrezib
authored andcommitted
chore: add web UI screenshots
Raw PNG screenshots are saved in assets/screenshots/raw/ folder. The update-branding script is renamed update-assets. Its purpose is extended to generate shadowed versions of screenshots compressed in webp format. Symlinks are added in documentation folder to use these assets.
1 parent 26c3ebc commit e2dd641

36 files changed

+48
-5
lines changed

Diff for: assets/README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# RacksDB assets
22

3-
All assets are generated based on the content of `branding.svg` by running this
4-
command:
3+
All assets are generated based on the content of `branding.svg` and
4+
`screenshots/raw/` by running this command:
55

66
```sh
7-
$ ./update-branding
7+
$ ./update-assets
88
```
99

10-
This automatically generates the SVG files in `scalables/` folder, PNG files (in
11-
various sizes) and favicon in `bitmaps/` folder.
10+
This automatically generates:
11+
12+
- Scalable SVG files of the logo in `scalables/` folder,
13+
- Bitmaps PNG files (in various sizes) of the logo in `bitmaps/` folder,
14+
- Favicon in `bitmaps/` folder,
15+
- Shadowed and Webp compressed versions of raw PNG screenshots.
1216

1317
The script has some requirements:
1418

@@ -22,6 +26,7 @@ The script has some requirements:
2226
* [Inkscape](https://inkscape.org/)
2327
* [RFL build package](https://github.com/rackslab/RFL/tree/main/src/build)
2428
* [Scour Python package](https://github.com/scour-project/scour/tree/master)
29+
* [ImageMagick](https://imagemagick.org/index.php)
2530

2631
All the generated files are commited and pushed in Git repository to allow
2732
direct usage by documentation site, main `README.md` file, etc…

Diff for: assets/bitmaps/logo_full_dark_large.png

-36 Bytes
Loading

Diff for: assets/bitmaps/logo_full_dark_medium.png

4 Bytes
Loading

Diff for: assets/bitmaps/logo_full_dark_small.png

-5 Bytes
Loading

Diff for: assets/bitmaps/logo_full_dark_tiny.png

-16 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_dark_large.png

28 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_dark_medium.png

-51 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_dark_small.png

-30 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_dark_tiny.png

-2 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_white_large.png

-2 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_white_medium.png

13 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_white_small.png

-26 Bytes
Loading

Diff for: assets/bitmaps/logo_full_horizontal_white_tiny.png

11 Bytes
Loading

Diff for: assets/bitmaps/logo_full_white_large.png

-41 Bytes
Loading

Diff for: assets/bitmaps/logo_full_white_medium.png

7 Bytes
Loading

Diff for: assets/bitmaps/logo_full_white_small.png

10 Bytes
Loading

Diff for: assets/bitmaps/logo_full_white_tiny.png

-2 Bytes
Loading

Diff for: assets/racksdb_web_ui.jpg

241 KB
Loading

Diff for: assets/screenshots/build.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# List raw screenshots for which versions with dropped shadow must be generated.
3+
shadowed:
4+
- home.png
5+
- datacenters.png
6+
- rooms.png
7+
- racks.png
8+
- infrastructures.png
9+
- infrastructure.png
10+
- infrastructure_filters.png

Diff for: assets/screenshots/raw/datacenters.png

602 KB
Loading

Diff for: assets/screenshots/raw/home.png

99.2 KB
Loading

Diff for: assets/screenshots/raw/infrastructure.png

111 KB
Loading

Diff for: assets/screenshots/raw/infrastructure_filters.png

137 KB
Loading

Diff for: assets/screenshots/raw/infrastructures.png

68.1 KB
Loading

Diff for: assets/screenshots/raw/racks.png

84.3 KB
Loading

Diff for: assets/screenshots/raw/rooms.png

76.7 KB
Loading

Diff for: assets/screenshots/shadowed/datacenters.webp

58.6 KB
Binary file not shown.

Diff for: assets/screenshots/shadowed/home.webp

23.6 KB
Binary file not shown.

Diff for: assets/screenshots/shadowed/infrastructure.webp

19.3 KB
Binary file not shown.
22.5 KB
Binary file not shown.

Diff for: assets/screenshots/shadowed/infrastructures.webp

12.7 KB
Binary file not shown.

Diff for: assets/screenshots/shadowed/racks.webp

16.3 KB
Binary file not shown.

Diff for: assets/screenshots/shadowed/rooms.webp

14.5 KB
Binary file not shown.

Diff for: assets/update-branding renamed to assets/update-assets

+26
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import glob
1010
import itertools
1111
from pathlib import Path
1212

13+
import yaml
1314
from rfl.build.ninja import NinjaBuilder
1415

1516
# Combination of logo and background colors available in branding reference file
@@ -22,6 +23,9 @@ INKSCAPE_COMMON_OPTS = "--export-overwrite"
2223
FAVICON_DIR = "favicon"
2324
BITMAPS_DIR = "bitmaps"
2425
SCALABLES_DIR = "scalables"
26+
SCREENSHOTS_DIR = "screenshots"
27+
RAW_DIR = "raw"
28+
SHADOWED_DIR = "shadowed"
2529
FAVICON_SIZES = [256, 64, 48, 32, 16]
2630

2731

@@ -78,6 +82,28 @@ def main():
7882

7983
ico = branding.parent / BITMAPS_DIR / "favicon.ico"
8084
builder.build(outputs=[ico], rule="favicon", inputs=[branding])
85+
86+
with open(Path(SCREENSHOTS_DIR)/ "build.yaml") as fh:
87+
rules = yaml.safe_load(fh.read())
88+
89+
builder.rule(
90+
name="shadow",
91+
command=(
92+
"convert $in -gravity 'northwest' -background 'rgba(255,255,255,0)' "
93+
"-splice '10x10' "
94+
"\( +clone -background black -shadow \"30x3-1-1\" \) +swap "
95+
"-background none -mosaic +repage \( +clone "
96+
"-background black -shadow \"30x8+5+5\" \) +swap "
97+
"-background none -mosaic +repage $out"
98+
),
99+
)
100+
101+
raws = rules["shadowed"]
102+
for raw_s in raws:
103+
raw = Path(SCREENSHOTS_DIR) / RAW_DIR / raw_s
104+
shadowed = (Path(SCREENSHOTS_DIR) / SHADOWED_DIR / raw.stem).with_suffix(".webp")
105+
builder.build(outputs=[shadowed], rule="shadow", inputs=[raw])
106+
81107
builder.run()
82108

83109

Diff for: docs/modules/usage/images/raw

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../assets/screenshots/raw

Diff for: docs/modules/usage/images/shadowed

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../assets/screenshots/shadowed

0 commit comments

Comments
 (0)