Skip to content

Conversation

@schlawg
Copy link
Contributor

@schlawg schlawg commented May 3, 2023

@schlawg
Copy link
Contributor Author

schlawg commented May 6, 2023

After seeing the reaction to a possible +30KB increase to round.min.js, I wanted to make image gallery lightweight for both the server and client.

A single webp image with all the thumbnails is lazy fetched by the client when Background -> Picture is clicked. Lila does no processing aside from lazy fetching a directory listing from a json file. And that's all.

Everything is static, so:

  • If you want to change the order of images or add/remove some, you set them up in a directory and run lifat/background/make-gallery.js
  • Tweak the sizes, borders, gallery layouts, etc by altering the imagemagick montage params in lifat/background/make-gallery.js
  • You might want to improve hiliting of the current selection, currently it's a green 1 pixel outline but a superimposed green checkmark or other indicators are also fine.

@schlawg
Copy link
Contributor Author

schlawg commented May 11, 2023

If/when this pull request is approved, the commit hash in lila/bin/download-lifat must be changed to e06857a9303d05581e13e2c814b3019c4e5beae2 to actually deploy the images.

ornicar added 4 commits May 11, 2023 12:14
* master: (41 commits)
  more controller code golf
  refactor ratelimiters
  make /setup/hook callable with web:mobile
  rename web:mobile oauth scope
  tweak Tv controller
  tweak download-lifat
  remove redundant .gitignore entries
  asset urls mirror deployment locs
  Remove unused things
  fix broken scala equality
  fix compile error in scala template
  fix cmn-toggle accessibility dissimulation margin
  remove css vendor rules
  cleanup scala usings
  remove duplicated and unused scss
  fix scss syntax
  fix accessibility of .cmn-toggle
  New Crowdin updates (lichess-org#12796)
  regen piece sprite after lichess-org#12815
  recreate source branch for voice merge
  ...
@ornicar ornicar merged commit 55bac9a into lichess-org:master May 11, 2023
@ornicar
Copy link
Collaborator

ornicar commented May 11, 2023

I deployed it on https://lichess.dev/

server {
  server_name assets.lichess.dev;
  [...]
  charset_types text/html application/javascript application/json text/css;
  location /assets/lifat/ {
    add_header Cache-Control public;
    add_header Access-Control-Allow-Origin "*";
    add_header Cross-Origin-Resource-Policy "cross-origin";
    alias /home/lifat/;
  }
}

@schlawg schlawg deleted the bg-img-gallery branch May 21, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants