Author SHA1 Message Date
Panfilov Konstantin 1a20ce17d5 Согласовать каркас Preland с Tour (api#298)
deploy-preland / deploy zoomstage.online (push) Successful in 36s
2026-10-20 18:16:35 +03:00
Panfilov Konstantin f2e6877013 fix(ui): загрузка и общий контракт сравнения (refs #8 #7)
deploy-preland / deploy zoomstage.online (push) Successful in 32s
2026-10-20 01:41:30 +03:00
Panfilov Konstantin 7eaf1c12b0 feat(ui): равные desktop плашки сравнения как в Index (refs #6)
deploy-preland / deploy zoomstage.online (push) Successful in 30s
2026-10-20 00:18:11 +03:00
Panfilov Konstantin c30e3239a0 feat(ui): общий бренд и компактная мобильная обработка (refs #5)
deploy-preland / deploy zoomstage.online (push) Successful in 30s
2026-10-19 22:41:49 +03:00
Panfilov Konstantin d2637e8f61 chore(ci): только stage, Барбариска выведена (refs #4)
deploy-preland / deploy zoomstage.online (push) Successful in 35s
2026-10-19 14:57:39 +03:00
Panfilov Konstantin 0f06a18622 feat: компактный Index и крупные миниатюры (refs anton/api#283) 2026-10-19 14:53:57 +03:00
Panfilov Konstantin 0274d5d921 fix: стабильные размеры Index при скрытии тулбаров 2026-10-19 14:53:57 +03:00
Panfilov Konstantin dcb914a429 fix(upload): кликабельная мобильная кнопка 2026-10-19 14:53:57 +03:00
Panfilov Konstantin ab84dc1629 feat(upload): фото и файлы отдельными путями на Android 2026-10-19 14:53:57 +03:00
Panfilov Konstantin b4dedcfea5 fix: preserve stage example sets during deploy
deploy-preland / deploy barbariskatest (push) Skipped
deploy-preland / deploy zoomstage.online (push) Successful in 33s
deploy-preland / deploy zoompixel.online (push) Skipped
deploy-preland / deploy zoompixel.ru (push) Skipped
2026-10-18 04:28:06 +03:00
Panfilov Konstantin 2180d9e37b chore(config): snapshot stage focus defaults
deploy-preland / deploy zoompixel.ru (push) Skipped
deploy-preland / deploy barbariskatest (push) Skipped
deploy-preland / deploy zoomstage.online (push) Successful in 33s
deploy-preland / deploy zoompixel.online (push) Skipped
2026-10-17 20:40:46 +03:00
79 changed files with 573 additions and 317 deletions

No files matched your search

+6 -202
View File
@@ -1,118 +1,13 @@
name: deploy-preland
# После коммита в main сохраняется legacy-выпуск на Beget. Новые домены ZoomPixel
# доставляются отдельными SFTP job: staging — только на stage, main — только на production.
# Цель — домен со своим хостингом (список — matrix ниже): реквизиты — секреты репозитория <prefix>_FTP_HOST,
# <prefix>_FTP_USER, <prefix>_FTP_PASS (порт 21). Цели независимы: сбой одного хостинга остальные не останавливает.
# Заливаются файлы репозитория (git ls-files), кроме служебных (.gitea/, README.md, AGENTS.md, CLAUDE.md, .gitignore) и тех, что живут
# только на хостинге: requisites.html (реквизиты заполняют на месте — пустой файл из git их бы затёр).
# Рабочий config.json настраивается владельцем на каждом хостинге. Деплой не
# перезаписывает его: он добавляет только отсутствующие обязательные UTM-ключи.
# Единственное контролируемое удаление — завершённая миграция legacy images/demo* после
# smoke новых корневых наборов /1, /2. Прочие файлы на хостинге не удаляются.
# Решение владельца 19.10.2026, preland#4: только stage.
# Production выкаты временно отключены; Барбариска больше не используется.
on:
push:
branches:
- main
- staging
jobs:
deploy:
name: deploy ${{ matrix.name }}
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# name — имя цели, url — адрес преленда (для проверки), prefix — префикс секретов <prefix>_FTP_*,
# dir — каталог сайта на FTP ("" — корень FTP, как на beget). Новый домен — новая запись и три секрета;
# requisites.html создают на хостинге цели. Рабочий config.json приходит из Git.
- name: barbariskatest
url: https://preland.anton.barbariskatest.ru
prefix: PRELAND
dir: ""
defaults:
run:
shell: sh
env:
PRELAND_URL: ${{ matrix.url }}
REMOTE_DIR: ${{ matrix.dir }}
steps:
- name: Install tools (Alpine)
run: apk add --no-cache git curl php83-cli
- name: Checkout repository
uses: actions/checkout@v4
- name: Preserve host config and add focus if absent
env:
FTP_HOST: ${{ secrets[format('{0}_FTP_HOST', matrix.prefix)] }}
FTP_USER: ${{ secrets[format('{0}_FTP_USER', matrix.prefix)] }}
FTP_PASS: ${{ secrets[format('{0}_FTP_PASS', matrix.prefix)] }}
run: |
set -eu
[ -n "$FTP_HOST" ] && [ -n "$FTP_USER" ] && [ -n "$FTP_PASS" ] || { echo "нет секретов ${{ matrix.prefix }}_FTP_*"; exit 1; }
dir=$(printf '%s' "$REMOTE_DIR" | sed 's#^/*##; s#/*$##')
umask 077
netrc=$(mktemp); config=$(mktemp)
trap 'rm -f "$netrc" "$config"' EXIT
printf 'machine %s login %s password %s\n' "$FTP_HOST" "$FTP_USER" "$FTP_PASS" > "$netrc"
curl -sS --ssl-reqd --netrc-file "$netrc" --fail --retry 3 \
"ftp://$FTP_HOST/${dir:+$dir/}config.json" -o "$config"
changed=0
php bin/ensure-focus-config.php "$config" || changed=$?
case "$changed" in
0) ;;
10) curl -sS --ssl-reqd --netrc-file "$netrc" --ftp-create-dirs --retry 3 --fail \
-T "$config" "ftp://$FTP_HOST/${dir:+$dir/}config.json" ;;
*) exit "$changed" ;;
esac
- name: Upload over FTP (TLS)
env:
FTP_HOST: ${{ secrets[format('{0}_FTP_HOST', matrix.prefix)] }}
FTP_USER: ${{ secrets[format('{0}_FTP_USER', matrix.prefix)] }}
FTP_PASS: ${{ secrets[format('{0}_FTP_PASS', matrix.prefix)] }}
run: |
set -eu
[ -n "$FTP_HOST" ] && [ -n "$FTP_USER" ] && [ -n "$FTP_PASS" ] || { echo "нет секретов ${{ matrix.prefix }}_FTP_*"; exit 1; }
dir=$(printf '%s' "$REMOTE_DIR" | sed 's#^/*##; s#/*$##')
case "$dir" in *[!A-Za-z0-9._/-]*) echo "недопустимый dir: $dir"; exit 1 ;; esac
umask 077
netrc=$(mktemp); list=$(mktemp)
trap 'rm -f "$netrc" "$list"' EXIT
printf 'machine %s login %s password %s\n' "$FTP_HOST" "$FTP_USER" "$FTP_PASS" > "$netrc"
git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$)' > files.txt
# имя уходит в адрес ftp:// как есть — пробелы и прочее экранирование не поддерживаем
if grep -q '[^A-Za-z0-9._/-]' files.txt; then echo "имена с недопустимыми символами:"; grep '[^A-Za-z0-9._/-]' files.txt; exit 1; fi
# один curl на все файлы — одно соединение FTP+TLS вместо соединения на файл
while read -r f; do printf 'upload-file = "%s"\nurl = "ftp://%s/%s%s"\n' "$f" "$FTP_HOST" "${dir:+$dir/}" "$f"; done < files.txt > "$list"
curl -sS --ssl-reqd --netrc-file "$netrc" --ftp-create-dirs --retry 3 --fail-early -K "$list"
echo "залито файлов: $(wc -l < files.txt)"
- name: Check the page
run: |
set -eu
page=$(curl -fsS --max-time 30 "$PRELAND_URL/?nc=$(date +%s)")
api=$(printf '%s' "$page" | grep -o 'const createApiUrl = "[^"]*"' || true)
echo "$api"
case "$api" in
*'\/api\/images\/public\/create'*) ;;
*) echo "на странице нет адреса загрузки"; exit 1 ;;
esac
own=$(printf '%s' "$PRELAND_URL" | sed -E 's#^https?://([^/]+).*#\1#')
case "$api" in
*"$own"*) echo "загрузка уходит на сам преленд: на хостинге нет config.json с host"; exit 1 ;;
esac
printf '%s' "$page" | grep -q 'claim?key=' || { echo "переход не на claim — залит старый код?"; exit 1; }
echo "страница в порядке"
deploy-zoomstage:
name: deploy zoomstage.online
if: github.ref == 'refs/heads/staging'
@@ -170,7 +65,10 @@ jobs:
dirs=$(mktemp)
trap 'rm -f "$known_hosts" "$batch" "$files" "$dirs"' EXIT
printf '%s\n' "$SFTP_KNOWN_HOSTS" > "$known_hosts"
git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$)' > "$files"
# Наборы `/N/` на stage — редактируемый контент. Кодовая доставка их
# намеренно не перезаписывает: актуальное содержимое stage фиксируют в Git
# отдельной синхронизацией по задаче.
git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$|[0-9]+/)' > "$files"
if grep -q '[^A-Za-z0-9._/-]' "$files"; then echo "имена с недопустимыми символами:"; grep '[^A-Za-z0-9._/-]' "$files"; exit 1; fi
printf '%s\n' "-mkdir $REMOTE_DIR" > "$batch"
while read -r file; do
@@ -224,97 +122,3 @@ jobs:
printf '%s\n' "-rmdir $REMOTE_DIR/images/$set" >> "$batch"
done
SSHPASS="$SFTP_PASS" sshpass -e sftp -oBatchMode=no -oStrictHostKeyChecking=yes -oUserKnownHostsFile="$known_hosts" "$SFTP_USER@$SFTP_HOST" < "$batch"
deploy-zoompixel-production:
name: deploy ${{ matrix.name }}
if: github.ref == 'refs/heads/main'
runs-on: zoomzilla-production
strategy:
fail-fast: false
matrix:
include:
- name: zoompixel.ru
url: https://zoompixel.ru
dir: domains/zoompixel.ru
- name: zoompixel.online
url: https://zoompixel.online
dir: domains/zoompixel.online
defaults:
run:
shell: sh
env:
PRELAND_URL: ${{ matrix.url }}
REMOTE_DIR: ${{ matrix.dir }}
steps:
- name: Install tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates git curl openssh-client sshpass php-cli
- name: Checkout production branch
run: git clone --depth 1 --branch main http://git.dira89kv.beget.tech:3000/anton/preland.git .
- name: Preserve host config and add focus if absent
env:
SFTP_HOST: ${{ secrets.ZOOMPIXEL_SFTP_HOST }}
SFTP_USER: ${{ secrets.ZOOMPIXEL_SFTP_USER }}
SFTP_PASS: ${{ secrets.ZOOMPIXEL_SFTP_PASS }}
SFTP_KNOWN_HOSTS: ${{ secrets.ZOOMPIXEL_SFTP_KNOWN_HOSTS }}
run: |
set -eu
[ -n "$SFTP_HOST" ] && [ -n "$SFTP_USER" ] && [ -n "$SFTP_PASS" ] && [ -n "$SFTP_KNOWN_HOSTS" ] || { echo "не заданы секреты ZOOMPIXEL_SFTP_*"; exit 1; }
umask 077
known_hosts=$(mktemp); batch=$(mktemp); config=$(mktemp)
trap 'rm -f "$known_hosts" "$batch" "$config"' EXIT
printf '%s\n' "$SFTP_KNOWN_HOSTS" > "$known_hosts"
printf '%s\n' "get -p $REMOTE_DIR/config.json $config" > "$batch"
SSHPASS="$SFTP_PASS" sshpass -e sftp -oBatchMode=no -oStrictHostKeyChecking=yes -oUserKnownHostsFile="$known_hosts" "$SFTP_USER@$SFTP_HOST" < "$batch"
changed=0
php bin/ensure-focus-config.php "$config" || changed=$?
case "$changed" in
0) ;;
10) printf '%s\n' "put -p $config $REMOTE_DIR/config.json" > "$batch"
SSHPASS="$SFTP_PASS" sshpass -e sftp -oBatchMode=no -oStrictHostKeyChecking=yes -oUserKnownHostsFile="$known_hosts" "$SFTP_USER@$SFTP_HOST" < "$batch" ;;
*) exit "$changed" ;;
esac
- name: Upload over SFTP
env:
SFTP_HOST: ${{ secrets.ZOOMPIXEL_SFTP_HOST }}
SFTP_USER: ${{ secrets.ZOOMPIXEL_SFTP_USER }}
SFTP_PASS: ${{ secrets.ZOOMPIXEL_SFTP_PASS }}
SFTP_KNOWN_HOSTS: ${{ secrets.ZOOMPIXEL_SFTP_KNOWN_HOSTS }}
run: |
set -eu
[ -n "$SFTP_HOST" ] && [ -n "$SFTP_USER" ] && [ -n "$SFTP_PASS" ] && [ -n "$SFTP_KNOWN_HOSTS" ] || { echo "не заданы секреты ZOOMPIXEL_SFTP_*"; exit 1; }
umask 077
known_hosts=$(mktemp)
batch=$(mktemp)
files=$(mktemp)
dirs=$(mktemp)
trap 'rm -f "$known_hosts" "$batch" "$files" "$dirs"' EXIT
printf '%s\n' "$SFTP_KNOWN_HOSTS" > "$known_hosts"
git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$)' > "$files"
if grep -q '[^A-Za-z0-9._/-]' "$files"; then echo "имена с недопустимыми символами:"; grep '[^A-Za-z0-9._/-]' "$files"; exit 1; fi
printf '%s\n' "-mkdir $REMOTE_DIR" > "$batch"
while read -r file; do
case "$file" in
*/*) dir=${file%/*} ;;
*) continue ;;
esac
while [ -n "$dir" ]; do
printf '%s\n' "$dir" >> "$dirs"
case "$dir" in */*) dir=${dir%/*} ;; *) break ;; esac
done
done < "$files"
sort -u "$dirs" | while read -r dir; do printf '%s\n' "-mkdir $REMOTE_DIR/$dir" >> "$batch"; done
while read -r file; do printf '%s\n' "put -p $file $REMOTE_DIR/$file" >> "$batch"; done < "$files"
SSHPASS="$SFTP_PASS" sshpass -e sftp -oBatchMode=no -oStrictHostKeyChecking=yes -oUserKnownHostsFile="$known_hosts" "$SFTP_USER@$SFTP_HOST" < "$batch"
echo "залито файлов: $(wc -l < "$files")"
- name: Check the page
run: |
set -eu
page=$(curl -fsS --max-time 30 "$PRELAND_URL/?nc=$(date +%s)")
api=$(printf '%s' "$page" | grep -o 'const createApiUrl = "[^"]*"' || true)
echo "$api"
case "$api" in *'zoomzilla.ru\/api\/images\/public\/create'*) ;; *) echo "на странице нет адреса загрузки Zoomzilla"; exit 1 ;; esac
printf '%s' "$page" | grep -q 'claim?key=' || { echo "переход не на claim"; exit 1; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 KiB

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 KiB

After

Width:  |  Height:  |  Size: 716 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+8 -1
View File
@@ -30,7 +30,11 @@
такого выпуска фактический stage-config следует забрать и зафиксировать в Git.
`requisites.html` также живёт только на хостинге и не перезаписывается. Не
создавать target-specific конфиги или `config.json.example`.
- Коммит в `main` запускает FTP-автодеплой на все цели workflow; откат через `git revert`
- Корневые числовые наборы примеров `/N/` на `zoomstage.online` — редактируемый
контент stage. Обычный push в `staging` должен исключать `[0-9]+/` из SFTP-заливки:
актуальные примеры нельзя перезаписывать Git-версией. Снимок stage фиксируется в
Git отдельной синхронизацией по задаче.
- Коммит в `staging` запускает SFTP-автодеплой только на zoomstage.online; откат через `git revert`
также запускает выкат. Коммит, push и изменения хостинга — только по прямому поручению.
- Проверки кода и браузера проводить в Docker без установки ПО на хост.
Проверка загрузки по боевому адресу вызывает реальную обработку; выполнять её только
@@ -38,3 +42,6 @@
План, журнал и база знаний ведутся в корне рабочей области по общим правилам. Ссылки на
политику и документацию не подключают MCP и не дают разрешения на публикацию или выкат.
## Актуальная маршрутизация (19.10.2026, preland#4)
До отдельного поручения владельца выкатывать только staging → zoomstage.online. Production zoompixel.ru/.online не обновлять. preland.anton.barbariskatest.ru больше не используется, не является целью и не должен упоминаться как требующий выпуска. CI запускает только stage. Сохранение runtime config и stage-наборов /N/ обязательно. Работа и решения — через Gitea.
+14 -5
View File
@@ -3,7 +3,7 @@
Область действия — репозиторий `preland/`. Общие правила рабочей области находятся в
[AGENTS.md](../AGENTS.md) и [CLAUDE.md](../CLAUDE.md); канонический процесс и каталог ролей —
[в общей политике](../.known-base/Соглашения/Процесс%20командной%20разработки%20и%20каталог%20ролей.md).
Этот файл и [AGENTS.md](AGENTS.md) содержат одинаковые локальные правила; обновлять их вместе.
Этот файл и [CLAUDE.md](CLAUDE.md) содержат одинаковые локальные правила; обновлять их вместе.
## Перед работой
@@ -21,10 +21,19 @@
переход напрямую на `/public/upscale` не заменяет передачу владельца через claim.
- `host` задаёт сайт назначения; HTTPS необходим для `crypto.randomUUID()`.
Не обходить серверные правила доступа к загрузке и результату обработки.
- Рабочий `config.json` единственный для всех прилендов: это точная проверенная
конфигурация `zoomstage.online`, и каждый FTP/SFTP-deploy обязан доставлять её на
stage и production. `requisites.html` по-прежнему живёт только на хостинге и не
перезаписывается. Не создавать target-specific конфиги или `config.json.example`.
- Рабочий `config.json` на каждом хостинге настраивает владелец. Деплой не имеет
права перезаписывать его значений. При появлении новой обязательной UTM workflow
получает текущий хостовый конфиг и меняет только ключи, которые прямо
согласованы в задаче. Иные значения, включая уже настроенные UTM, остаются
байт-в-байт прежними. Для #274 `bin/ensure-focus-config.php` — явное
исключение: он задаёт только новый `focus=face` (default и rnd). После каждого
такого выпуска фактический stage-config следует забрать и зафиксировать в Git.
`requisites.html` также живёт только на хостинге и не перезаписывается. Не
создавать target-specific конфиги или `config.json.example`.
- Корневые числовые наборы примеров `/N/` на `zoomstage.online` — редактируемый
контент stage. Обычный push в `staging` должен исключать `[0-9]+/` из SFTP-заливки:
актуальные примеры нельзя перезаписывать Git-версией. Снимок stage фиксируется в
Git отдельной синхронизацией по задаче.
- Коммит в `main` запускает FTP-автодеплой на все цели workflow; откат через `git revert`
также запускает выкат. Коммит, push и изменения хостинга — только по прямому поручению.
- Проверки кода и браузера проводить в Docker без установки ПО на хост.
+27 -36
View File
@@ -5,8 +5,8 @@
Варианты страницы и сайта (A/B) задаются метками в адресе. Код — обычный PHP без фреймворка и сборки; переводы —
маленькая заглушка `Yii::t` в `i18n.php`.
Боевой экземпляр: `https://preland.anton.barbariskatest.ru` (хостинг beget). Пример ссылки входа:
`https://preland.anton.barbariskatest.ru/?indpic=1&theme=dark&degr=2&registration=after&bchoice=a&tp=1&utm_source=test&subid=CLICK1`.
Активные production: `https://zoompixel.ru`, `https://zoompixel.online`; текущая цель выката — только `https://zoomstage.online`. Пример ссылки входа:
`https://zoomstage.online/?indpic=1&theme=dark&degr=2&registration=after&bchoice=a&tp=1&utm_source=test&subid=CLICK1`.
## Как работает
@@ -21,7 +21,7 @@
Ненастроенные параметры (`utm_source`, `keyword`, `subid` и любые другие) проходят как есть. Перед переходом
Preland всегда формирует полный resolved-набор своих восьми меток: явное допустимое значение остаётся, `rnd`
разрешается по весам, отсутствующее получает `default`. Вместе с внешними рекламными параметрами этот набор
уходит в `claim`, а затем сайт переносит его в `upscale`; ни один из семи параметров не должен пропадать только
уходит в `claim`, а затем сайт переносит его в `upscale`; ни один из восьми параметров не должен пропадать только
потому, что был назначен default.
| Метка | Что задаёт | Где |
@@ -103,6 +103,12 @@ N/05_...
домена целиком: без переименования, вложения в `images/` и промежуточных
каталогов. Устаревшие `images/demo*` не являются частью поставки.
Для `zoomstage.online` обычный deploy ветки `staging` намеренно **не загружает**
корневые числовые каталоги `/N/`: это редактируемый контент stage, а не артефакт
кодовой доставки. Workflow продолжает проверять их доступность HTTP-smoke. Чтобы
зафиксировать обновлённый набор, сначала синхронизируйте его со stage в Git по
отдельной задаче; следующая заливка не перетрёт его старой ревизией.
## Деплой на произвольный домен
**Требования.** PHP 8.0+ (боевой хостинг — 8.2), веб-сервер с `index.php` в роли индексного файла и **HTTPS**:
@@ -114,10 +120,7 @@ N/05_...
git clone http://git.dira89kv.beget.tech:3000/anton/preland.git && cd preland
# дальше — загрузка на хостинг: rsync/scp по SSH или FTP-клиент
```
3. **Конфиг и реквизиты.** Рабочий `config.json` уже лежит в репозитории и обязателен к доставке на каждый
приленд. Его не заменяют локальным вариантом и не исключают из синхронизации. Реквизиты задаются ключом
`requisites` в нём либо runtime-файлом `requisites.html`. 2026-10-05 конфиг пропал после заливки,
и преленд слал загрузку на собственный домен; это больше не допускается.
3. **Конфиг и реквизиты.** Рабочий `config.json` на хостинге — источник истины. При первичном создании домена его настраивают отдельно; обычный deploy не заменяет его репозиторным снимком и не перезаписывает `requisites.html`. Менять можно только явно согласованные ключи после чтения текущего файла.
4. **nginx без Apache** (если хостинг не обрабатывает `.htaccess`):
```nginx
server {
@@ -148,37 +151,25 @@ N/05_...
## Автодеплой (Gitea Actions)
`.gitea/workflows/deploy.yml`: после каждого коммита в `main` раннер заливает файлы репозитория на хостинги **всех
целей** по FTP с TLS и проверяет страницу каждой. Цель — домен со своим хостингом; список целей — `matrix` в workflow:
Решение владельца от 19.10.2026, задача preland#4: сейчас выкатываем **только stage**.
```yaml
- name: barbariskatest # имя цели (видно в списке прогонов: deploy barbariskatest)
url: https://preland.anton.barbariskatest.ru # адрес преленда — для проверки после заливки
prefix: PRELAND # секреты PRELAND_FTP_HOST, PRELAND_FTP_USER, PRELAND_FTP_PASS
dir: "" # каталог сайта на FTP: "" — корень FTP (beget), иначе, например, public_html
```
| Экземпляр | Назначение | Выкат |
|---|---|---|
| https://zoomstage.online | Тестовый стенд | Push в staging, SFTP |
| https://zoompixel.ru | Production | Отключён до отдельного поручения |
| https://zoompixel.online | Production | Отключён до отдельного поручения |
Цели выкатываются независимо (`fail-fast: false`): сбой одного хостинга не останавливает остальные.
Прежний preland.anton.barbariskatest.ru выведен из использования и исключён из workflow.
Публикация изменений самого workflow в main не запускает доставку: триггер оставлен только для staging.
**Новый домен на своём хостинге:**
1. Домен и HTTPS — как в «Деплой на произвольный домен», шаг 1.
2. Секреты `<ПРЕФИКС>_FTP_HOST`, `<ПРЕФИКС>_FTP_USER`, `<ПРЕФИКС>_FTP_PASS` (Gitea → настройки репозитория →
Actions → секреты; порт 21, FTP с TLS). В коде реквизитов нет.
3. Никаких ручных конфигов не создавать: единственный `config.json` приезжает вместе с кодом.
4. Запись в `matrix` — коммит в `main`, автодеплой выкатит все цели вместе с конфигом.
Workflow `.gitea/workflows/deploy.yml` содержит единственную job deploy-zoomstage на
выделенном runner zoomzilla-production. Production возвращается только отдельной задачей
и прямым поручением владельца. Ошибки старого FTP больше не являются блокером выпуска.
**Что заливается.** Каждый deploy получает файлы репозитория (`git ls-files`), кроме служебных
(`.gitea/`, `README.md`, `.gitignore`) и живущего на хостинге `requisites.html`. Единственный
версионируемый `config.json` всегда доставляется вместе с кодом.
На хостинге ничего не удаляется: файлы, убранные из репозитория, удалять вручную.
Рабочие config.json/requisites.html на хостинге не перезаписываются. Корневые наборы
/N/ принадлежат stage и исключены из кодовой доставки. Родительские каталоги создаются
штатным SFTP-генератором; smoke проверяет страницу и assets наборов1/2.
Откат — отдельный согласованный revert в staging, который обновляет только stage.
**Проверка после заливки.** На странице цели должен быть адрес загрузки на сайте, а не на самом преленде (иначе нет
`config.json` с `host`), и переход на `claim`. Иначе прогон этой цели падает.
**Откат** — `git revert` проблемного коммита в `main`: автодеплой зальёт прежнюю версию на все цели.
**SFTP.** Сейчас только FTP с TLS. Хостинг без FTP — поле `protocol` в цели и `lftp` вместо curl в шаге заливки.
**Откат вручную.** Перед заменой файлов — копия изменяемых файлов (`index.php`, `components/*`) с хостинга; вернуть их той же
загрузкой. Новый преленд требует на сайте `/api/images/public/claim` (api с 2026-10-05): со старым api переход
по ключу отдаст 404.
## Android: фото и файлы (2026-10-19)
Основная кнопка выбирает image/*; отдельная ссылка «Выбрать файлы (PDF и др.)» открывает общий picker без ограничения image/*. PDF в подписи скрывается по runtime API-policy. iOS/iPad/Desktop сохраняют прежний общий выбор. +много сохраняется в одной компактной mobile-строке. components/browser-upload.php и CSS upload-picker-links.php — лёгкие inline-копии соответствующих компонентов API: отдельный PHP-хост не использует Yii AssetManager, новый внешний запрос не добавляется. При изменении общего контракта синхронизировать обе копии; API mobile-picker.cjs покрывает обе реальные страницы. Android byte-copy FileProvider сохраняет исходные байты/имя/MIME и ограничен max_file_size_bytes; до ответа policy используется консервативный15MB предел копирования. UTM/client_key/claim/config.json не меняются.
+98
View File
@@ -0,0 +1,98 @@
<?php /* Лёгкая inline-копия API browser-upload: единый контракт, без внешнего запроса. */ ?>
<script>
(() => {
if (window.ZoomzillaUpload) return;
const android = /Android/i.test(navigator.userAgent);
let uploadQueue = Promise.resolve();
window.ZoomzillaUpload = {
// Резерв из пяти точек задаётся CSS: слово и соседняя иконка не двигаются.
renderLoadingLabel(label, dots, text) {
if (!label) return;
let output = label.querySelector('[data-upload-dots]');
if (!output) {
label.textContent = text + ' ';
const slot = document.createElement('span');
slot.className = 'upload-loading-dots';
slot.setAttribute('aria-hidden', 'true');
output = document.createElement('span');
output.dataset.uploadDots = '';
slot.append(output);
label.append(slot);
}
output.textContent = '.'.repeat(dots);
},
bindPicker(form, mainInput, fullAccept, onFiles) {
const mobile = android || /iPhone|iPad|iPod/i.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
if (mobile) form.dataset.mobileUpload = '1';
const sync = () => {
const input = typeof mainInput === 'function' ? mainInput() : mainInput;
if (input) input.accept = android ? 'image/*' : (typeof fullAccept === 'function' ? fullAccept() : fullAccept);
};
sync();
// Dropzone пересоздаёт input после каждого выбора: обновляем до native click.
form.addEventListener('click', sync, true);
if (!android) return;
const link = form.querySelector('[data-files-picker]');
const other = form.querySelector('[data-other-files]');
if (!link || !other) return;
form.querySelector('[data-picker-or]').hidden = false;
link.hidden = false;
const label = form.querySelector('[data-upload-label]');
if (label) {
label.textContent = form.dataset.photoLabel;
label.dataset.pickerLabel = form.dataset.photoLabel;
}
other.addEventListener('click', event => event.stopPropagation());
link.addEventListener('click', event => {
event.preventDefault();
event.stopPropagation();
if (form.querySelector('.dropzone-form-button')?.disabled) return;
other.value = '';
other.click();
});
other.addEventListener('change', event => {
event.stopPropagation();
const files = Array.from(other.files || []);
other.value = '';
if (files.length) onFiles(files);
});
},
run(file, maxBytes, send) {
const upload = () => this.prepare(file, maxBytes).then(send);
if (!android) return upload();
// В кабинете до10 файлов: удерживаем в памяти только одну копию.
const pending = uploadQueue.then(upload);
uploadQueue = pending.catch(() => {});
return pending;
},
prepare(file, maxBytes) {
// FileProvider может отдавать несовпадающие lastModified для сетевого
// процесса Chromium. Blob из прочитанных байтов от него не зависит.
if (!android || !file.size || file.size > maxBytes) return Promise.resolve(file);
return new Promise((resolve, reject) => {
const reader = new FileReader();
const timer = window.setTimeout(() => reader.abort(), 30000);
const failed = error => {
window.clearTimeout(timer);
window.UploadDiagnostics?.record('buffer_error', { error_name: error.name, message: error.message });
reject(error);
};
window.UploadDiagnostics?.record('buffer_start', { size: file.size });
reader.onload = () => {
window.clearTimeout(timer);
if (reader.result.byteLength !== file.size) {
failed(new Error('Размер файла изменился при чтении.'));
return;
}
const blob = new Blob([reader.result], { type: file.type });
window.UploadDiagnostics?.record('buffer_ok', { size: blob.size, mime: blob.type });
resolve(blob);
};
reader.onerror = () => failed(reader.error || new Error('Не удалось прочитать файл.'));
reader.onabort = () => failed(new Error('Чтение файла прервано.'));
try { reader.readAsArrayBuffer(file.slice(0, file.size, file.type)); } catch (error) { failed(error); }
});
}
};
})();
</script>
+17 -7
View File
@@ -1,4 +1,5 @@
<?php
require __DIR__ . '/browser-upload.php';
$errorMessage = Yii::t('app', 'Возникла ошибка');
$utmJson = json_encode($UTM ?? [], JSON_UNESCAPED_UNICODE);
@@ -11,7 +12,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
?>
<form action="<?= htmlspecialchars($createApiUrl, ENT_QUOTES, 'UTF-8') ?>" class="dropzone-form gradient-dashed-border" id="dropzone-form" method="POST" style="background: transparent; border: unset; display: <?= ($show ?? true) ? '' : 'none'; ?>; cursor: pointer;">
<form action="<?= htmlspecialchars($createApiUrl, ENT_QUOTES, 'UTF-8') ?>" class="dropzone-form gradient-dashed-border" id="dropzone-form" data-photo-label="<?= htmlspecialchars(Yii::t('app', 'Выбрать фото'), ENT_QUOTES, 'UTF-8') ?>" method="POST" style="background: transparent; border: unset; display: <?= ($show ?? true) ? '' : 'none'; ?>; cursor: pointer;">
<div class="dropzone-form-inner">
<div class="dropzone-form-icon">
@@ -26,7 +27,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
<div class="dropzone-form-format-item">HEIC</div>
<div class="dropzone-form-format-item">WebP</div>
<div class="dropzone-form-format-item">GIF</div>
<div class="dropzone-form-format-item">PDF</div>
<div class="dropzone-form-format-item" data-format-optional>PDF</div>
<div class="dropzone-form-format-item">+много</div>
</div>
</div>
@@ -37,6 +38,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
<path d="M13.3333 14.6667C15.6345 14.6667 17.5 12.8012 17.5 10.5C17.5 8.43079 15.9917 6.71387 14.0145 6.38874C14.0113 6.38821 14.0086 6.38583 14.0078 6.38267C13.4802 4.43373 11.6992 3 9.58333 3C7.05203 3 5 5.05203 5 7.58333C5 7.75477 5.00941 7.924 5.02775 8.09055C5.0282 8.0947 5.0255 8.09856 5.02145 8.09957C3.57289 8.4621 2.5 9.77242 2.5 11.3333C2.5 13.1743 3.99238 14.6667 5.83333 14.6667H6.66667M10 8.83726V18M10 8.83726L7.5 11.3333M10 8.83726L12.5 11.3333" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<?php require __DIR__ . '/upload-picker-links.php'; ?>
</div>
</div>
@@ -78,14 +80,16 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
// отправляется в content-based Tour gate, где и показывается controlled error.
let pickerAccept = <?= json_encode($basePickerAccept, JSON_UNESCAPED_UNICODE) ?>;
let maxUploadBytes = 0;
window.ZoomzillaUpload.bindPicker(formEl, fileInput, () => pickerAccept, files => handleSelectedFile(files[0]));
if (uploadPolicyApiUrl && window.fetch) {
fetch(uploadPolicyApiUrl, { credentials: 'omit', cache: 'no-store' })
.then(response => response.ok ? response.json() : null)
.then(policy => {
if (typeof policy?.picker_accept === 'string' && policy.picker_accept !== '') {
pickerAccept = policy.picker_accept;
fileInput.accept = pickerAccept;
fileInput.accept = /Android/i.test(navigator.userAgent) ? 'image/*' : pickerAccept;
}
if (policy?.pdf_observation_enabled === false) formEl.querySelector('[data-files-picker]').textContent = <?= json_encode(Yii::t('app', 'Выбрать файлы (другие форматы)'), JSON_UNESCAPED_UNICODE) ?>;
if (Number.isSafeInteger(policy?.max_file_size_bytes) && policy.max_file_size_bytes > 0) {
maxUploadBytes = policy.max_file_size_bytes;
}
@@ -101,7 +105,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
const uploadButtonDefaultLabel = uploadButtonLabel?.textContent || '';
function renderUploadButton() {
if (uploadButtonLabel) uploadButtonLabel.textContent = 'Загрузка' + '.'.repeat(uploadDots);
window.ZoomzillaUpload.renderLoadingLabel(uploadButtonLabel, uploadDots, <?= json_encode(Yii::t('app', 'Загрузка'), JSON_UNESCAPED_UNICODE) ?>);
}
function beginUploadPending() {
@@ -114,7 +118,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
uploadButton.setAttribute('aria-busy', 'true');
}
uploadDotsTimer = window.setInterval(() => {
uploadDots = uploadDots === 5 ? 1 : uploadDots + 1;
uploadDots = (uploadDots + 1) % 6;
renderUploadButton();
}, 500);
return true;
@@ -124,7 +128,7 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
uploadPending = false;
if (uploadDotsTimer !== null) window.clearInterval(uploadDotsTimer);
uploadDotsTimer = null;
if (uploadButtonLabel) uploadButtonLabel.textContent = uploadButtonDefaultLabel;
if (uploadButtonLabel) uploadButtonLabel.textContent = uploadButtonLabel.dataset.pickerLabel || uploadButtonDefaultLabel;
if (uploadButton) {
uploadButton.disabled = false;
uploadButton.removeAttribute('aria-busy');
@@ -217,12 +221,18 @@ $basePickerAccept = 'image/jpeg,image/png,image/gif,image/webp,image/bmp,image/a
}
function uploadFile(file) {
// Тот же обход нестабильного Android FileProvider, что на основном сайте.
window.ZoomzillaUpload.prepare(file, maxUploadBytes || 15 * 1024 * 1024)
.then(bytes => uploadPreparedFile(file, bytes))
.catch(() => showUploadError(genericErrorMsg));
}
function uploadPreparedFile(file, bytes) {
const xhr = new XMLHttpRequest();
const formData = new FormData();
// Ключ загрузки: по нему сайт передаёт её в сессию посетителя (/api/images/public/claim, годен 30 мин).
// randomUUID есть в HTTPS-контексте; где его нет (старый Safari), есть getRandomValues.
const clientKey = createClientKey();
formData.append('file', file);
formData.append('file', bytes, file.name || 'upload');
formData.append('client_key', clientKey);
const actionUrl = createApiUrl || formEl.getAttribute('action') || '/api/images/public/create';
+1 -1
View File
@@ -41,7 +41,7 @@
}
@media (max-width: 768px) {
.image-loading-progress {
height: 35dvh !important;
height: 35svh !important;
}
.image-loading-progress #source {
position: static;
+3 -3
View File
@@ -22,7 +22,7 @@ $labelsJson = json_encode($labels, JSON_UNESCAPED_UNICODE);
</svg>
</div>
<div class="dropzone-form-loading-info-text">
<span id="origin_width"><?= htmlspecialchars($origin_width ?? '', ENT_QUOTES, 'UTF-8') ?></span> x <span id="origin_height"><?= htmlspecialchars($origin_height ?? '', ENT_QUOTES, 'UTF-8') ?></span>&nbsp;<span>px</span></div>
<span id="origin_width"><?= htmlspecialchars($origin_width ?? '', ENT_QUOTES, 'UTF-8') ?></span>×<span id="origin_height"><?= htmlspecialchars($origin_height ?? '', ENT_QUOTES, 'UTF-8') ?></span>&nbsp;<span class="process-dimensions-unit">px</span></div>
</div>
<div class="dropzone-form-loading-info-item">
<div class="dropzone-form-loading-info-icon">
@@ -48,7 +48,7 @@ $labelsJson = json_encode($labels, JSON_UNESCAPED_UNICODE);
</svg>
</div>
<div class="dropzone-form-loading-info-text">
<span id="upscale_width"><?= htmlspecialchars($upscale_width ?? '', ENT_QUOTES, 'UTF-8') ?></span> x <span id="upscale_height"><?= htmlspecialchars($upscale_height ?? '', ENT_QUOTES, 'UTF-8') ?></span>&nbsp;<span>px</span></div>
<span id="upscale_width"><?= htmlspecialchars($upscale_width ?? '', ENT_QUOTES, 'UTF-8') ?></span>×<span id="upscale_height"><?= htmlspecialchars($upscale_height ?? '', ENT_QUOTES, 'UTF-8') ?></span>&nbsp;<span class="process-dimensions-unit">px</span></div>
</div>
<div class="dropzone-form-loading-info-item">
<div class="dropzone-form-loading-info-icon">
@@ -133,7 +133,7 @@ $labelsJson = json_encode($labels, JSON_UNESCAPED_UNICODE);
if (bytes === 0 || isNaN(bytes)) return '0 B';
const units = ['B', 'Kb', 'Mb', 'Gb', 'Tb'];
const i = Math.floor(Math.log(bytes) / Math.log(1024));
const formattedValue = (bytes / Math.pow(1024, i)).toFixed(2);
const formattedValue = (bytes / Math.pow(1024, i)).toFixed(i === 1 ? 0 : 2);
return parseFloat(formattedValue) + ' ' + units[i];
}
};
+22
View File
@@ -0,0 +1,22 @@
<?php /* CSS синхронна API upload-picker-links; отдельный хост без Yii assets. */ ?>
<style>
[data-picker-or][hidden], [data-files-picker][hidden] { display: none !important; }
#dropzone-form[data-mobile-upload] { padding: 16px; }
#dropzone-form[data-mobile-upload] .dropzone-form-icon img { width: 44px; height: 44px; }
#dropzone-form[data-mobile-upload] .dropzone-form-text { margin-top: 8px; font-size: 16px; line-height: 24px; }
#dropzone-form[data-mobile-upload] .dropzone-form-format { margin-top: 10px; flex-direction: column; gap: 6px; }
#dropzone-form[data-mobile-upload] .dropzone-form-format-label { font-size: 11px; line-height: 16px; }
#dropzone-form[data-mobile-upload] .dropzone-form-format-list { flex-wrap: nowrap; gap: 4px; justify-content: center; }
#dropzone-form[data-mobile-upload] .dropzone-form-format-item { padding: 3px 5px; border-radius: 6px; font-size: 11px; line-height: 15px; white-space: nowrap; }
#dropzone-form[data-mobile-upload] .dropzone-form-action { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#dropzone-form[data-mobile-upload] .dropzone-form-button { width: 100%; pointer-events: auto; }
#dropzone-form[data-mobile-upload] [data-picker-or] { display: block; margin: 0; font-size: 10px; line-height: 14px; color: #979aa0; }
#dropzone-form[data-mobile-upload] [data-files-picker] { display: block; position: relative; margin: -2px 0 0; font-size: 12px; line-height: 18px; text-decoration: underline; text-underline-offset: 3px; pointer-events: auto; }
#dropzone-form.theme-dark [data-files-picker], .theme-dark #dropzone-form [data-files-picker] { color: #b6caff; }
/* Расширяем область нажатия вниз, не меняя утверждённый видимый зазор4px. */
#dropzone-form [data-files-picker]::after { content: ''; position: absolute; inset: 0 -8px -14px; }
#dropzone-form[data-mobile-upload] .dropzone-form-format-item[data-format-optional] { display: none; }
</style>
<span data-picker-or hidden><?= Yii::t('app', 'или') ?></span>
<a href="#" data-files-picker hidden><?= Yii::t('app', 'Выбрать файлы (PDF и др.)') ?></a>
<input type="file" data-other-files style="display:none">
+1 -1
View File
@@ -56,7 +56,7 @@
"1": 0,
"2": 1
},
"default": "1"
"default": "2"
},
"focus": {
"weights": {
+4
View File
@@ -137,6 +137,10 @@ return [
'Загрузите изображение' => 'Upload an image',
'Загрузить' => 'Upload',
'Загрузить изображение' => 'Upload Image',
'Выбрать фото' => 'Choose photo',
'или' => 'or',
'Выбрать файлы (PDF и др.)' => 'Choose files (PDF, etc.)',
'Выбрать файлы (другие форматы)' => 'Choose files (other formats)',
'Загрузка тарифов...' => 'Loading plans...',
'Загрузка...' => 'Loading...',
'Запись в историю добавлена!' => 'History entry added',
+151 -8
View File
@@ -157,6 +157,27 @@ body {
box-sizing: border-box;
}
/* Общий desktop-контракт плашек Index; мобильный вариант сохраняет свои размеры. */
@media (min-width: 768px) {
.image-compare .icv__label {
top: 10px;
width: 92px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
padding: 4px 10px;
font: 400 16px/26px Inter, sans-serif;
color: #fff;
backdrop-filter: none;
-webkit-backdrop-filter: none;
background: rgb(0 0 0 / 25%);
border: 1px solid rgb(255 255 255 / 80%);
box-shadow: none;
text-shadow: none;
}
}
.preview-full .icv__label {
position: absolute;
bottom: auto;
@@ -600,11 +621,13 @@ body {
}
.navbar-toggler .navbar-toggler-icon {
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
background-position: center;
background-repeat: no-repeat;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-toggler:not(.collapsed) .navbar-toggler-icon {
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-width='2' d='M6 6L24 23.9999M6 24L24 6.00015'/%3e%3c/svg%3e");
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-width='2' d='M6 6L24 23.9999M6 24L24 6.00015'/%3e%3c/svg%3e");
}
.theme-dark .link-icon {
@@ -1540,6 +1563,11 @@ body {
margin-top: 24px;
}
/* Пять мест сохраняются и в нулевом кадре анимации загрузки. */
.upload-loading-dots { display: inline-grid; text-align: left; }
.upload-loading-dots::before { content: '.....'; visibility: hidden; grid-area: 1 / 1; }
.upload-loading-dots > span { grid-area: 1 / 1; }
.dropzone-form-button {
display: inline-flex;
padding: 0 24px;
@@ -2745,29 +2773,144 @@ body:not(.theme-dark) .theme-light-hidden {
}
}
/* Высота с раскрытыми панелями браузера: сохраняем компактность без скачков при скролле. */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
.image-examples {
max-width: calc(100dvh / 3);
max-width: calc(100svh / 3);
margin: 0 auto;
}
#dropzone-form {
padding: 2dvh 2.75dvh;
padding: 2svh 2.75svh;
}
.dropzone-form-icon {
max-height: 8dvh;
max-height: 8svh;
}
.dropzone-form-text, .image-examples-label {
font-size: 2.45dvh;
font-size: 2.45svh;
}
.dropzone-form-format-label, .dropzone-form-format-item {
font-size: 1.8dvh;
font-size: 1.8svh;
}
.main-section {
padding-top: 2dvh !important;
padding-top: 2svh !important;
}
}
/* api#283: утверждённый первый экран с раскрытыми панелями Яндекса. */
@media (max-width: 767.98px) {
.index-mobile-fit { padding-top: 8px !important; }
.index-mobile-fit #image-compare { width: 100%; container-type: inline-size; aspect-ratio: 1696 / 920; max-height: clamp(120px, calc(100svh - 440px), 240px); }
/* Обе стороны одного масштаба и кадрирования при ограниченной высоте. */
.index-mobile-fit #image-compare .icv__img { position: absolute; top: 0; bottom: 0; left: 0; width: 100cqw; height: 100%; object-fit: cover; object-position: center; }
.index-mobile-fit #image-compare .icv__img-b { left: auto; right: 0; }
.index-mobile-fit #image-compare.native-icv img { width: 100cqw !important; }
.index-mobile-fit #dropzone-form[data-mobile-upload] { padding: 12px; margin-top: 12px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-icon img { width: 36px; height: 36px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-text { margin-top: 6px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-format { margin-top: 8px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-action { margin-top: 10px; }
.index-mobile-fit .image-examples { max-width: min(100%, 50svh); margin: 12px auto 0; }
.index-mobile-fit .image-examples-label { display: none; }
.index-mobile-fit .image-examples-list { gap: 8px; }
.index-mobile-fit .image-examples-item { flex-basis: calc((100% - 32px) / 5); min-width: 0; }
.index-mobile-fit #image-compare .icv__label { top: 4px; bottom: auto; margin: 0; width: 48px; height: 20px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font: 600 9px/1.3 Inter, sans-serif; padding: 2px 5px; border: 1px solid rgb(255 255 255 / 65%); border-radius: 5px; background: rgb(67 72 82 / 72%); color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); text-shadow: 0 1px 1px rgb(0 0 0 / 35%); white-space: nowrap; }
.index-mobile-fit #image-compare .icv__label-before { left: 24px; }
.index-mobile-fit #image-compare .icv__label-after { right: 24px; }
}
/* api#284: общий контракт утверждённых шапки/подвала и мобильной обработки. */
.header .navbar{height:90px;padding-top:0!important;padding-bottom:0!important;}
.header .navbar>.container{height:100%;align-items:center;flex-wrap:nowrap;}
.header .navbar-brand{padding:0;margin-right:12px;min-width:0;flex:1 1 0;display:flex;align-items:center;}
.header .navbar-brand img{width:240px;max-width:100%;height:auto;}
.footer-logo img{width:160px;height:auto;max-width:100%;}
.header .btn-header{min-height:44px;height:44px;font-size:14px;line-height:20px;padding:0 16px;border-radius:12px;white-space:nowrap;gap:6px;}
@media(max-width:767.98px){
.header .navbar{height:68px;} .header .navbar-brand img{width:180px;} .header .navbar-toggler{width:30px;height:30px;border-radius:8px;padding:0;display:inline-flex;align-items:center;justify-content:center;} .header .navbar-toggler-icon{width:20px;height:20px;background-size:20px;display:block;}
.header .navbar-brand{margin-right:8px;}
.header .btn-header{height:30px;min-height:30px;font-size:12px;padding:0 12px;border-radius:11px;}
.header .btn-header svg{width:16px;height:16px;}
.footer-logo img{width:130px;height:auto;}
.site{padding-top:68px;}
.index-mobile-fit #image-compare{max-height:clamp(120px,calc(100svh - 450px),240px);}
}
@media(max-width:767.98px){
.tour-processing, .main-section:has(#process:not([style*="display: none"])) {padding-top:12px!important;padding-bottom:12px!important;min-height:0!important;}
#process{padding:16px 12px;}
#process .process-dimensions-unit{display:none;}
#process .dropzone-form-inner{padding:0;}
#process-title{margin:0;font-size:16px;line-height:24px;}
#process-scale-note{margin:12px 0;font-size:13px;line-height:20px;text-align:center;}
#process .dropzone-form-loading-info{margin:0;display:grid;grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col{min-width:0;}
#process .dropzone-form-loading-info-item{gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col:last-child .dropzone-form-loading-info-item{justify-content:flex-end;}
#process .dropzone-form-loading-info-item:not(:last-child){margin-bottom:8px;}
#process .dropzone-form-loading-info-icon svg{width:16px;height:16px;display:block;}
#process .dropzone-form-loading-info-text{font-size:clamp(12px,3.6vw,13px);line-height:20px;white-space:nowrap;}
#process .dropzone-form-loading-info-arrow{display:flex;justify-content:center;flex-basis:auto;opacity:.75;}
#process .dropzone-form-loading-info-arrow svg{width:24px;}
#process .dropzone-form-loading-progress{margin-top:16px;}
#process .progress{height:24px;}
#process .progress-label{font-size:12px;line-height:24px;}
#process .process-file-line{margin-top:12px;font-size:12px;line-height:18px;}
.tour-processing #preview, .main-section:has(#process:not([style*="display: none"])) #preview{height:clamp(220px,calc(100svh - 335px),380px)!important;margin-top:16px;}
}
@media(max-width:767.98px){.result-download-title{font-size:24px;line-height:1.2;}}
/* api#298: общий каркас API/Preland; синхронизировать этот блок в обоих репозиториях. */
html { scrollbar-gutter: stable; }
body { isolation: isolate; }
.wrapper {
--site-header-height: 90px;
--site-background: url(../images/bg.jpg);
min-height: 100svh;
background-image: none;
}
.theme-dark .wrapper { --site-background: url(../images/dark-bg.jpg); background-image: none; }
.wrapper::before {
content: "";
position: fixed;
z-index: -1;
top: 0;
left: 0;
width: 100%;
height: 100vh;
height: 100lvh;
background: var(--site-background) center / cover no-repeat;
pointer-events: none;
}
.wrapper .main-section:not(.main-section-alt),
.wrapper .main-section.main-section-alt2,
.wrapper .main-content-wrapper { min-height: calc(100svh - var(--site-header-height)); }
.wrapper .main-content-wrapper { height: auto; }
.wrapper .main-content-wrapper > .main-section { min-height: 0; }
@media (min-width: 768px) {
/* 520px — общий desktop-слот Index с фото и полосой примеров при контейнере 1300px.
Верхняя граница не зависит от короткого/длинного содержимого текущего шага. */
.wrapper .index-mobile-fit,
.wrapper .tour-processing {
justify-content: flex-start;
padding-top: max(24px, calc((100svh - var(--site-header-height) - 520px) / 2)) !important;
}
:is(.index-mobile-fit, .tour-processing) :is(#dropzone-form, #process) {
display: flex;
align-items: center;
justify-content: center;
min-height: 456px;
}
:is(.index-mobile-fit, .tour-processing) :is(#dropzone-form, #process) .dropzone-form-inner {
width: 100%;
padding-top: 0;
padding-bottom: 0;
}
:is(.index-mobile-fit, .tour-processing) #preview { height: auto; aspect-ratio: 1696 / 920; }
}
@media (max-width: 767.98px) { .wrapper { --site-header-height: 68px; } }
/* /api#298 */
+70 -6
View File
@@ -756,24 +756,88 @@ border-radius: 10px;
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
.image-examples {
max-width: calc(100dvh / 3);
max-width: calc(100svh / 3);
margin: 0 auto;
}
#dropzone-form {
padding: 2dvh 2.75dvh;
padding: 2svh 2.75svh;
}
.dropzone-form-icon {
max-height: 8dvh;
max-height: 8svh;
}
.dropzone-form-text,
.image-examples-label {
font-size: 2.45dvh;
font-size: 2.45svh;
}
.dropzone-form-format-label,
.dropzone-form-format-item {
font-size: 1.8dvh;
font-size: 1.8svh;
}
.main-section {
padding-top: 2dvh !important;
padding-top: 2svh !important;
}
}
/* api#283: утверждённый первый экран с раскрытыми панелями Яндекса. */
@media (max-width: 767.98px) {
.index-mobile-fit { padding-top: 8px !important; }
.index-mobile-fit #image-compare { width: 100%; container-type: inline-size; aspect-ratio: 1696 / 920; max-height: clamp(120px, calc(100svh - 440px), 240px); }
/* Обе стороны одного масштаба и кадрирования при ограниченной высоте. */
.index-mobile-fit #image-compare .icv__img { position: absolute; top: 0; bottom: 0; left: 0; width: 100cqw; height: 100%; object-fit: cover; object-position: center; }
.index-mobile-fit #image-compare .icv__img-b { left: auto; right: 0; }
.index-mobile-fit #image-compare.native-icv img { width: 100cqw !important; }
.index-mobile-fit #dropzone-form[data-mobile-upload] { padding: 12px; margin-top: 12px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-icon img { width: 36px; height: 36px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-text { margin-top: 6px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-format { margin-top: 8px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-action { margin-top: 10px; }
.index-mobile-fit .image-examples { max-width: min(100%, 50svh); margin: 12px auto 0; }
.index-mobile-fit .image-examples-label { display: none; }
.index-mobile-fit .image-examples-list { gap: 8px; }
.index-mobile-fit .image-examples-item { flex-basis: calc((100% - 32px) / 5); min-width: 0; }
.index-mobile-fit #image-compare .icv__label { top: 4px; bottom: auto; margin: 0; width: 48px; height: 20px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font: 600 9px/1.3 Inter, sans-serif; padding: 2px 5px; border: 1px solid rgb(255 255 255 / 65%); border-radius: 5px; background: rgb(67 72 82 / 72%); color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); text-shadow: 0 1px 1px rgb(0 0 0 / 35%); white-space: nowrap; }
.index-mobile-fit #image-compare .icv__label-before { left: 24px; }
.index-mobile-fit #image-compare .icv__label-after { right: 24px; }
}
/* api#284: общий контракт утверждённых шапки/подвала и мобильной обработки. */
.header .navbar{height:90px;padding-top:0!important;padding-bottom:0!important;}
.header .navbar>.container{height:100%;align-items:center;flex-wrap:nowrap;}
.header .navbar-brand{padding:0;margin-right:12px;min-width:0;flex:1 1 0;display:flex;align-items:center;}
.header .navbar-brand img{width:240px;max-width:100%;height:auto;}
.footer-logo img{width:160px;height:auto;max-width:100%;}
.header .btn-header{min-height:44px;height:44px;font-size:14px;line-height:20px;padding:0 16px;border-radius:12px;white-space:nowrap;gap:6px;}
@media(max-width:767.98px){
.header .navbar{height:68px;} .header .navbar-brand img{width:180px;} .header .navbar-toggler{width:30px;height:30px;border-radius:8px;padding:0;display:inline-flex;align-items:center;justify-content:center;} .header .navbar-toggler-icon{width:20px;height:20px;background-size:20px;display:block;}
.header .navbar-brand{margin-right:8px;}
.header .btn-header{height:30px;min-height:30px;font-size:12px;padding:0 12px;border-radius:11px;}
.header .btn-header svg{width:16px;height:16px;}
.footer-logo img{width:130px;height:auto;}
.site{padding-top:68px;}
.index-mobile-fit #image-compare{max-height:clamp(120px,calc(100svh - 450px),240px);}
}
@media(max-width:767.98px){
.tour-processing, .main-section:has(#process:not([style*="display: none"])) {padding-top:12px!important;padding-bottom:12px!important;min-height:0!important;}
#process{padding:16px 12px;}
#process .process-dimensions-unit{display:none;}
#process .dropzone-form-inner{padding:0;}
#process-title{margin:0;font-size:16px;line-height:24px;}
#process-scale-note{margin:12px 0;font-size:13px;line-height:20px;text-align:center;}
#process .dropzone-form-loading-info{margin:0;display:grid;grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col{min-width:0;}
#process .dropzone-form-loading-info-item{gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col:last-child .dropzone-form-loading-info-item{justify-content:flex-end;}
#process .dropzone-form-loading-info-item:not(:last-child){margin-bottom:8px;}
#process .dropzone-form-loading-info-icon svg{width:16px;height:16px;display:block;}
#process .dropzone-form-loading-info-text{font-size:clamp(12px,3.6vw,13px);line-height:20px;white-space:nowrap;}
#process .dropzone-form-loading-info-arrow{display:flex;justify-content:center;flex-basis:auto;opacity:.75;}
#process .dropzone-form-loading-info-arrow svg{width:24px;}
#process .dropzone-form-loading-progress{margin-top:16px;}
#process .progress{height:24px;}
#process .progress-label{font-size:12px;line-height:24px;}
#process .process-file-line{margin-top:12px;font-size:12px;line-height:18px;}
.tour-processing #preview, .main-section:has(#process:not([style*="display: none"])) #preview{height:clamp(220px,calc(100svh - 335px),380px)!important;margin-top:16px;}
}
@media(max-width:767.98px){.result-download-title{font-size:24px;line-height:1.2;}}
@media (min-width:768px){.image-compare .icv__label{top:10px;width:92px;height:36px;display:flex;align-items:center;justify-content:center;padding:4px 10px;font:400 16px/26px Inter,sans-serif;color:#fff;backdrop-filter:none;-webkit-backdrop-filter:none;background:rgb(0 0 0 / 25%);border:1px solid rgb(255 255 255 / 80%);box-shadow:none;text-shadow:none;}}
.upload-loading-dots{display:inline-grid;text-align:left;}.upload-loading-dots::before{content:'.....';visibility:hidden;grid-area:1 / 1;}.upload-loading-dots > span{grid-area:1 / 1;}
+117 -1
View File
@@ -1 +1,117 @@
.col-6,.col-md-4,.col-md-5,.col-md-7,.container{padding-right:15px;padding-left:15px;width:100%}.btn,.progress{background-color:transparent}.progress,.progress-bar{overflow:hidden;display:flex}.btn,.footer-main a,.list-unstyled a,.nav-link{text-decoration:none}*,::after,::before{box-sizing:border-box}body{margin:0;font-family:Inter,sans-serif;padding:unset!important;overflow:auto!important}.container{margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}.col-md-4{flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{flex:0 0 41.666667%;max-width:41.666667%}.col-md-7{flex:0 0 58.333333%;max-width:58.333333%}.order-md-1{order:1}.d-md-none{display:none!important}.d-md-flex{display:flex!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.mb-md-0{margin-bottom:0!important}.text-md-right{text-align:right!important}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1300px}}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.col-6,.col-md-4,.col-md-5,.col-md-7{position:relative}.col-6{flex:0 0 50%;max-width:50%}.d-none,.nav-link-auth{display:none!important}.d-flex{display:flex!important}.flex-column{flex-direction:column!important}.align-items-center{align-items:center!important}.btn,.navbar-toggler{align-items:center;cursor:pointer}.m-0{margin:0!important}.mb-0{margin-bottom:0!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mt-4{margin-top:1.5rem!important}.mr-4{margin-right:1.5rem!important}.px-0{padding-left:0!important;padding-right:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.h5{font-size:1.25rem;font-weight:500;line-height:1.2}.list-unstyled{padding-left:0;list-style:none}.list-unstyled a{color:#56ccf2}.btn{display:inline-flex;justify-content:center;font-weight:400;text-align:center;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}.btn.disabled{opacity:1}.progress{height:1rem;font-size:.75rem;border-radius:.25rem}.progress-bar{flex-direction:column;justify-content:center;color:#fff;text-align:center;white-space:nowrap;transition:width .6s}.btn-header,.btn-header:hover{color:#990694}.navbar{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;white-space:nowrap}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.collapse:not(.show),.footer-logo img:nth-child(2),.navbar-brand img:nth-child(2),.theme-dark .footer-logo img:first-child,.theme-dark .navbar-brand img:first-child{display:none}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.wrapper{display:flex;flex-direction:column;min-height:100vh;background:url(../images/bg.jpg) center/cover no-repeat}.header,.header .navbar-collapse{background-color:rgba(255,255,255,.6)}.site{flex-grow:1;padding-top:90px}.main-section{display:flex;flex-direction:column;justify-content:center;min-height:calc(100vh - 88px)}.header{position:absolute;top:0;left:0;width:100%;z-index:60}.dropzone-form-loading-progress .progress-label,.image-loading-error,.image-loading-icon,.image-loading-icon img.sandglass{top:50%;left:50%;transform:translate(-50%,-50%)}.header .navbar{border-bottom:1px solid #e5e5e7}.btn-header{gap:8px;border:1px solid #990694;border-radius:16px;font-size:16px;padding:.9rem 24px}.navbar-toggler{border-radius:16px;width:56px;height:56px;background:linear-gradient(to bottom,#3d87e3,#990694);color:#f9f9f9;border:none;display:inline-flex;justify-content:center}.navbar-toggler .navbar-toggler-icon{width:30px;height:30px;display:inline-block;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center/contain no-repeat}.navbar-toggler:not(.collapsed) .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-width='2' d='M6 6L24 23.9999M6 24L24 6.00015'/%3e%3c/svg%3e")}.header-navbar{max-width:448px;margin-left:auto;padding-top:8px;padding-bottom:24px}.header-navbar .nav-link{color:currentColor;transition:.2s;background-color:transparent!important;display:flex;align-items:center;gap:8px}.header-navbar .nav-link span{flex-grow:1}.drLine truncated
.col-6,.col-md-4,.col-md-5,.col-md-7,.container{padding-right:15px;padding-left:15px;width:100%}.btn,.progress{background-color:transparent}.progress,.progress-bar{overflow:hidden;display:flex}.btn,.footer-main a,.list-unstyled a,.nav-link{text-decoration:none}*,::after,::before{box-sizing:border-box}body{margin:0;font-family:Inter,sans-serif;padding:unset!important;overflow:auto!important}.container{margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}.col-md-4{flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{flex:0 0 41.666667%;max-width:41.666667%}.col-md-7{flex:0 0 58.333333%;max-width:58.333333%}.order-md-1{order:1}.d-md-none{display:none!important}.d-md-flex{display:flex!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.mb-md-0{margin-bottom:0!important}.text-md-right{text-align:right!important}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1300px}}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.col-6,.col-md-4,.col-md-5,.col-md-7{position:relative}.col-6{flex:0 0 50%;max-width:50%}.d-none,.nav-link-auth{display:none!important}.d-flex{display:flex!important}.flex-column{flex-direction:column!important}.align-items-center{align-items:center!important}.btn,.navbar-toggler{align-items:center;cursor:pointer}.m-0{margin:0!important}.mb-0{margin-bottom:0!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mt-4{margin-top:1.5rem!important}.mr-4{margin-right:1.5rem!important}.px-0{padding-left:0!important;padding-right:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.h5{font-size:1.25rem;font-weight:500;line-height:1.2}.list-unstyled{padding-left:0;list-style:none}.list-unstyled a{color:#56ccf2}.btn{display:inline-flex;justify-content:center;font-weight:400;text-align:center;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}.btn.disabled{opacity:1}.progress{height:1rem;font-size:.75rem;border-radius:.25rem}.progress-bar{flex-direction:column;justify-content:center;color:#fff;text-align:center;white-space:nowrap;transition:width .6s}.btn-header,.btn-header:hover{color:#990694}.navbar{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;white-space:nowrap}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.collapse:not(.show),.footer-logo img:nth-child(2),.navbar-brand img:nth-child(2),.theme-dark .footer-logo img:first-child,.theme-dark .navbar-brand img:first-child{display:none}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.wrapper{display:flex;flex-direction:column;min-height:100vh;background:url(../images/bg.jpg) center/cover no-repeat}.header,.header .navbar-collapse{background-color:rgba(255,255,255,.6)}.site{flex-grow:1;padding-top:90px}.main-section{display:flex;flex-direction:column;justify-content:center;min-height:calc(100vh - 88px)}.header{position:absolute;top:0;left:0;width:100%;z-index:60}.dropzone-form-loading-progress .progress-label,.image-loading-error,.image-loading-icon,.image-loading-icon img.sandglass{top:50%;left:50%;transform:translate(-50%,-50%)}.header .navbar{border-bottom:1px solid #e5e5e7}.btn-header{gap:8px;border:1px solid #990694;border-radius:16px;font-size:16px;padding:.9rem 24px}.navbar-toggler{border-radius:16px;width:56px;height:56px;background:linear-gradient(to bottom,#3d87e3,#990694);color:#f9f9f9;border:none;display:inline-flex;justify-content:center}.navbar-toggler .navbar-toggler-icon{width:30px;height:30px;display:inline-block;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center/contain no-repeat}.navbar-toggler:not(.collapsed) .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-width='2' d='M6 6L24 23.9999M6 24L24 6.00015'/%3e%3c/svg%3e")}.header-navbar{max-width:448px;margin-left:auto;padding-top:8px;padding-bottom:24px}.header-navbar .nav-link{color:currentColor;transition:.2s;background-color:transparent!important;display:flex;align-items:center;gap:8px}.header-navbar .nav-link span{flex-grow:1}.drLine truncated
/* api#283: утверждённый первый экран с раскрытыми панелями Яндекса. */
@media (max-width: 767.98px) {
.index-mobile-fit { padding-top: 8px !important; }
.index-mobile-fit #image-compare { width: 100%; container-type: inline-size; aspect-ratio: 1696 / 920; max-height: clamp(120px, calc(100svh - 440px), 240px); }
/* Обе стороны одного масштаба и кадрирования при ограниченной высоте. */
.index-mobile-fit #image-compare .icv__img { position: absolute; top: 0; bottom: 0; left: 0; width: 100cqw; height: 100%; object-fit: cover; object-position: center; }
.index-mobile-fit #image-compare .icv__img-b { left: auto; right: 0; }
.index-mobile-fit #image-compare.native-icv img { width: 100cqw !important; }
.index-mobile-fit #dropzone-form[data-mobile-upload] { padding: 12px; margin-top: 12px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-icon img { width: 36px; height: 36px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-text { margin-top: 6px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-format { margin-top: 8px; }
.index-mobile-fit #dropzone-form[data-mobile-upload] .dropzone-form-action { margin-top: 10px; }
.index-mobile-fit .image-examples { max-width: min(100%, 50svh); margin: 12px auto 0; }
.index-mobile-fit .image-examples-label { display: none; }
.index-mobile-fit .image-examples-list { gap: 8px; }
.index-mobile-fit .image-examples-item { flex-basis: calc((100% - 32px) / 5); min-width: 0; }
.index-mobile-fit #image-compare .icv__label { top: 4px; bottom: auto; margin: 0; width: 48px; height: 20px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font: 600 9px/1.3 Inter, sans-serif; padding: 2px 5px; border: 1px solid rgb(255 255 255 / 65%); border-radius: 5px; background: rgb(67 72 82 / 72%); color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); text-shadow: 0 1px 1px rgb(0 0 0 / 35%); white-space: nowrap; }
.index-mobile-fit #image-compare .icv__label-before { left: 24px; }
.index-mobile-fit #image-compare .icv__label-after { right: 24px; }
}
/* api#284: общий контракт утверждённых шапки/подвала и мобильной обработки. */
.header .navbar{height:90px;padding-top:0!important;padding-bottom:0!important;}
.header .navbar>.container{height:100%;align-items:center;flex-wrap:nowrap;}
.header .navbar-brand{padding:0;margin-right:12px;min-width:0;flex:1 1 0;display:flex;align-items:center;}
.header .navbar-brand img{width:240px;max-width:100%;height:auto;}
.footer-logo img{width:160px;height:auto;max-width:100%;}
.header .btn-header{min-height:44px;height:44px;font-size:14px;line-height:20px;padding:0 16px;border-radius:12px;white-space:nowrap;gap:6px;}
@media(max-width:767.98px){
.header .navbar{height:68px;} .header .navbar-brand img{width:180px;} .header .navbar-toggler{width:30px;height:30px;border-radius:8px;padding:0;display:inline-flex;align-items:center;justify-content:center;} .header .navbar-toggler-icon{width:20px;height:20px;background-size:20px;display:block;}
.header .navbar-brand{margin-right:8px;}
.header .btn-header{height:30px;min-height:30px;font-size:12px;padding:0 12px;border-radius:11px;}
.header .btn-header svg{width:16px;height:16px;}
.footer-logo img{width:130px;height:auto;}
.site{padding-top:68px;}
.index-mobile-fit #image-compare{max-height:clamp(120px,calc(100svh - 450px),240px);}
}
@media(max-width:767.98px){
.tour-processing, .main-section:has(#process:not([style*="display: none"])) {padding-top:12px!important;padding-bottom:12px!important;min-height:0!important;}
#process{padding:16px 12px;}
#process .process-dimensions-unit{display:none;}
#process .dropzone-form-inner{padding:0;}
#process-title{margin:0;font-size:16px;line-height:24px;}
#process-scale-note{margin:12px 0;font-size:13px;line-height:20px;text-align:center;}
#process .dropzone-form-loading-info{margin:0;display:grid;grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col{min-width:0;}
#process .dropzone-form-loading-info-item{gap:4px;align-items:center;}
#process .dropzone-form-loading-info-col:last-child .dropzone-form-loading-info-item{justify-content:flex-end;}
#process .dropzone-form-loading-info-item:not(:last-child){margin-bottom:8px;}
#process .dropzone-form-loading-info-icon svg{width:16px;height:16px;display:block;}
#process .dropzone-form-loading-info-text{font-size:clamp(12px,3.6vw,13px);line-height:20px;white-space:nowrap;}
#process .dropzone-form-loading-info-arrow{display:flex;justify-content:center;flex-basis:auto;opacity:.75;}
#process .dropzone-form-loading-info-arrow svg{width:24px;}
#process .dropzone-form-loading-progress{margin-top:16px;}
#process .progress{height:24px;}
#process .progress-label{font-size:12px;line-height:24px;}
#process .process-file-line{margin-top:12px;font-size:12px;line-height:18px;}
.tour-processing #preview, .main-section:has(#process:not([style*="display: none"])) #preview{height:clamp(220px,calc(100svh - 335px),380px)!important;margin-top:16px;}
}
@media(max-width:767.98px){.result-download-title{font-size:24px;line-height:1.2;}}
@media (min-width:768px){.image-compare .icv__label{top:10px;width:92px;height:36px;display:flex;align-items:center;justify-content:center;padding:4px 10px;font:400 16px/26px Inter,sans-serif;color:#fff;backdrop-filter:none;-webkit-backdrop-filter:none;background:rgb(0 0 0 / 25%);border:1px solid rgb(255 255 255 / 80%);box-shadow:none;text-shadow:none;}}
.upload-loading-dots{display:inline-grid;text-align:left;}.upload-loading-dots::before{content:'.....';visibility:hidden;grid-area:1 / 1;}.upload-loading-dots > span{grid-area:1 / 1;}
/* api#298: общий каркас API/Preland; синхронизировать этот блок в обоих репозиториях. */
html { scrollbar-gutter: stable; }
body { isolation: isolate; }
.wrapper {
--site-header-height: 90px;
--site-background: url(../images/bg.jpg);
min-height: 100svh;
background-image: none;
}
.theme-dark .wrapper { --site-background: url(../images/dark-bg.jpg); background-image: none; }
.wrapper::before {
content: "";
position: fixed;
z-index: -1;
top: 0;
left: 0;
width: 100%;
height: 100vh;
height: 100lvh;
background: var(--site-background) center / cover no-repeat;
pointer-events: none;
}
.wrapper .main-section:not(.main-section-alt),
.wrapper .main-section.main-section-alt2,
.wrapper .main-content-wrapper { min-height: calc(100svh - var(--site-header-height)); }
.wrapper .main-content-wrapper { height: auto; }
.wrapper .main-content-wrapper > .main-section { min-height: 0; }
@media (min-width: 768px) {
/* 520px — общий desktop-слот Index с фото и полосой примеров при контейнере 1300px.
Верхняя граница не зависит от короткого/длинного содержимого текущего шага. */
.wrapper .index-mobile-fit,
.wrapper .tour-processing {
justify-content: flex-start;
padding-top: max(24px, calc((100svh - var(--site-header-height) - 520px) / 2)) !important;
}
:is(.index-mobile-fit, .tour-processing) :is(#dropzone-form, #process) {
display: flex;
align-items: center;
justify-content: center;
min-height: 456px;
}
:is(.index-mobile-fit, .tour-processing) :is(#dropzone-form, #process) .dropzone-form-inner {
width: 100%;
padding-top: 0;
padding-bottom: 0;
}
:is(.index-mobile-fit, .tour-processing) #preview { height: auto; aspect-ratio: 1696 / 920; }
}
@media (max-width: 767.98px) { .wrapper { --site-header-height: 68px; } }
/* /api#298 */
+1 -1
View File
@@ -72,7 +72,7 @@
</header>
<main class="site">
<div class="py-4 main-section">
<div class="py-4 main-section index-mobile-fit">
<div class="container">
<div class="row">
+5 -1
View File
@@ -60,7 +60,11 @@ foreach ([
}
}
if (substr_count($workflow, 'while [ -n "$dir" ]; do') < 2) {
if (!str_contains($workflow, '|[0-9]+/)')) {
$failures[] = 'Stage-деплой не должен перезаписывать корневые наборы /N/: stage владеет их содержимым.';
}
if (substr_count($workflow, 'while [ -n "$dir" ]; do') < 1) {
$failures[] = 'SFTP-деплой должен создавать все родительские каталоги для новых наборов assets.';
}
+2 -1
View File
@@ -30,6 +30,7 @@ if (!is_string($query)) {
}
parse_str($query, $params);
$config = json_decode((string) file_get_contents(dirname(__DIR__) . '/config.json'), true);
$expected = [
'indpic' => '1',
'theme' => 'dark',
@@ -37,7 +38,7 @@ $expected = [
'registration' => 'after',
'bchoice' => 'a',
'chb' => 'b',
'tp' => '1',
'tp' => $config['utm']['tp']['default'] ?? null,
'focus' => 'face',
'utm_source' => 'stage-ad',
'subid' => 'click-42',
+25 -42
View File
@@ -17,56 +17,39 @@ $config = is_file($configPath) ? json_decode((string) file_get_contents($configP
if (!is_array($config)) {
$failures[] = 'Рабочий config.json должен существовать в корне приленда и содержать валидный JSON.';
} else {
$expected = [
'host' => 'zoomzilla.ru',
'indpic' => ['1' => 1, '2' => 0, 'default' => '1'],
'theme' => ['light' => 0, 'dark' => 1, 'default' => 'dark'],
'degr' => ['1' => 1, '2' => 0, 'default' => '1'],
'registration' => ['before' => 0, 'after' => 1, 'default' => 'after'],
'bchoice' => ['a' => 1, 'b' => 0, 'default' => 'a'],
'chb' => ['a' => 1, 'b' => 0, 'default' => 'b'],
'tp' => ['1' => 0, '2' => 1, 'default' => '1'],
'focus' => ['center' => 0, 'face' => 1, 'default' => 'face'],
];
if (($config['host'] ?? null) !== $expected['host']) {
if (($config['host'] ?? null) !== 'zoomzilla.ru') {
$failures[] = 'Рабочий config.json обязан направлять загрузку на zoomzilla.ru.';
}
foreach (array_diff_key($expected, ['host' => true]) as $key => $settings) {
$actual = $config['utm'][$key] ?? [];
if (($actual['weights'] ?? null) !== array_diff_key($settings, ['default' => true])
|| ($actual['default'] ?? null) !== $settings['default']) {
$failures[] = "Рабочий config.json должен сохранять stage-настройку UTM {$key}.";
$focus = $config['utm']['focus'] ?? null;
if (($focus['weights'] ?? null) !== ['center' => 0, 'face' => 1]
|| ($focus['default'] ?? null) !== 'face') {
$failures[] = 'Рабочий config.json должен фиксировать явно согласованный focus=face.';
}
foreach (['indpic', 'theme', 'degr', 'registration', 'bchoice', 'chb', 'tp'] as $key) {
$setting = $config['utm'][$key] ?? null;
if (!is_array($setting) || !is_array($setting['weights'] ?? null) || !is_string($setting['default'] ?? null)) {
$failures[] = "Рабочий config.json должен хранить валидный stage-снимок UTM {$key}.";
}
}
}
$workflow = (string) file_get_contents($root . '/.gitea/workflows/deploy.yml');
$legacyStart = strpos($workflow, ' deploy:');
$stageStart = strpos($workflow, 'deploy-zoomstage:');
$productionStart = strpos($workflow, 'deploy-zoompixel-production:');
$legacyBlock = $legacyStart === false || $stageStart === false
? ''
: substr($workflow, $legacyStart, $stageStart - $legacyStart);
$stageBlock = $stageStart === false || $productionStart === false
? ''
: substr($workflow, $stageStart, $productionStart - $stageStart);
$productionBlock = $productionStart === false ? '' : substr($workflow, $productionStart);
foreach ([
'legacy FTP' => $legacyBlock,
'deploy-zoomstage' => $stageBlock,
'deploy-zoompixel-production' => $productionBlock,
] as $delivery => $block) {
if ($block === ''
|| !str_contains($block, 'config\\.json$')
|| !str_contains($block, 'ensure-focus-config.php')
|| !str_contains($block, 'Preserve host config and add focus if absent')) {
$failures[] = "{$delivery} обязан сохранять хостовый config.json и менять только явно согласованный focus.";
}
$stageStart = strpos($workflow, ' deploy-zoomstage:');
$stageBlock = $stageStart === false ? '' : substr($workflow, $stageStart);
if ($stageBlock === '' || !str_contains($stageBlock, 'config\\.json$')
|| !str_contains($stageBlock, 'ensure-focus-config.php')
|| !str_contains($stageBlock, 'Preserve host config and add focus if absent')) {
$failures[] = 'Stage обязан сохранять хостовый config.json и согласованный focus-контракт.';
}
if (preg_match_all('/^ [a-z][a-z0-9-]*:/m', substr($workflow, strpos($workflow, 'jobs:')), $jobs) !== 1
|| !str_contains($workflow, " - staging")
|| str_contains($workflow, " - main")
|| str_contains($workflow, 'deploy-zoompixel-production:')
|| str_contains($workflow, 'barbariskatest')) {
$failures[] = 'По решению владельца автодеплой должен содержать только staging/zoomstage.online.';
}
if (is_file($root . '/config.json.example')) {
$failures[] = 'config.json.example не должен существовать: рабочий config.json единственный.';
}
@@ -76,4 +59,4 @@ if ($failures !== []) {
exit(1);
}
fwrite(STDOUT, "OK: versioned stage config and ZoomPixel delivery\n");
fwrite(STDOUT, "OK: host config preserved; deploy targets stage only\n");
+1 -1
View File
@@ -11,7 +11,7 @@ if ($form === false) {
exit(1);
}
preg_match_all('/<div class="dropzone-form-format-item">([^<]+)<\\/div>/', $form, $formatMatches);
preg_match_all('/<div class="dropzone-form-format-item"[^>]*>([^<]+)<\\/div>/', $form, $formatMatches);
$visibleFormats = ['JPG', 'PNG', 'HEIC', 'WebP', 'GIF', 'PDF', '+много'];
if ($formatMatches[1] !== $visibleFormats) {
fwrite(STDERR, "FAIL: Preland не показывает утверждённый компактный список форматов в нужном порядке.\n");