The loader now measures throughput from whole tile batches, not just the two probe tiles, and after a session settles inside its deadline it tops up in the background: the needed level if the budget cut it short, then one level above it on capable devices with a fast connection (drawn downscaled), within time and memory caps and never under Save-Data. The chop in the album end card and the page footer is replaced by the LUCIO loader in smoke from lucioIP, falling back to the SVG loader without WebGL. sync-brand.sh now copies lucio-loaders.js and defaults to ../lucioIP. Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.5 KiB
Bash
41 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
scripts_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
repo_dir="$(dirname "$scripts_dir")"
|
|
brand_dir="${LUCIO_IP_DIR:-$repo_dir/../lucioIP}"
|
|
out_dir="$repo_dir/web/brand"
|
|
|
|
for required in tokens/tokens.css motion/lucio-morph.js motion/lucio-loaders.js logo/favicon.svg logo/lucio-chop-chen.svg; do
|
|
if [ ! -f "$brand_dir/$required" ]; then
|
|
echo "sync-brand: $brand_dir/$required not found (set LUCIO_IP_DIR)" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
mkdir -p "$out_dir"
|
|
|
|
strip_js() {
|
|
perl -0777 -pe 's{(\x22(?:\\.|[^\x22\\\n])*\x22|\x27(?:\\.|[^\x27\\\n])*\x27|\x60(?:\\.|[^\x60\\])*\x60)|/\*.*?\*/|//[^\n]*}{defined $1 ? $1 : ""}gse; s/\r//g; s/[ \t]+$//mg; s/\n{2,}/\n/g; s/\A\n+//'
|
|
}
|
|
|
|
strip_svg() {
|
|
perl -0777 -pe 's/\r//g; s/<!--.*?-->//gs; s/\n{2,}/\n/g'
|
|
}
|
|
|
|
{
|
|
echo ":root {"
|
|
perl -0777 -ne 'if (/:root\s*\{(.*?)\n\}/s) { print $1 }' "$brand_dir/tokens/tokens.css" \
|
|
| perl -0777 -pe 's{/\*.*?\*/}{}gs' \
|
|
| grep -E '^\s*--lucio-(graphite|paper|beam|steel|cinnabar|ash|font|space|radius|shadow-glow|motion|ease)[a-z0-9-]*:' \
|
|
| sed -E 's/^\s+/ /'
|
|
echo "}"
|
|
} > "$out_dir/tokens.css"
|
|
|
|
strip_js < "$brand_dir/motion/lucio-morph.js" > "$out_dir/lucio-morph.js"
|
|
strip_js < "$brand_dir/motion/lucio-loaders.js" > "$out_dir/lucio-loaders.js"
|
|
strip_svg < "$brand_dir/logo/favicon.svg" > "$out_dir/favicon.svg"
|
|
strip_svg < "$brand_dir/logo/lucio-chop-chen.svg" > "$out_dir/lucio-chop-chen.svg"
|
|
|
|
echo "sync-brand: copied tokens.css, lucio-morph.js, lucio-loaders.js, favicon.svg, lucio-chop-chen.svg from $brand_dir into $out_dir"
|