diff --git a/.env.demo b/.env.demo new file mode 100644 index 0000000..472162d --- /dev/null +++ b/.env.demo @@ -0,0 +1,21 @@ +# Local test branding — not committed (.gitignore). +# Delete or rename this file to fall back to built-in defaults. + +# Branding +IRANDOM_NAME=LuckyDraw +IRANDOM_TITLE=LuckyDraw - test theme +IRANDOM_BRAND_URL=https://example.com +IRANDOM_LOGO_URL=/logo.png +IRANDOM_DEFAULT_LOCALE=en + +# Cool slate + teal (contrast check vs default gold/brown) +IRANDOM_COLOR_PRIMARY=#2dd4bf +IRANDOM_COLOR_ACCENT=#5eead4 +IRANDOM_COLOR_BG=#0f172a +IRANDOM_COLOR_SURFACE=#1e293b +IRANDOM_COLOR_SURFACE_RAISED=#334155 +IRANDOM_COLOR_TEXT=#f1f5f9 +IRANDOM_COLOR_TEXT_MUTED=#94a3b8 +IRANDOM_COLOR_DANGER=#f87171 +IRANDOM_COLOR_LINK=#38bdf8 +IRANDOM_COLOR_BORDER=#475569 diff --git a/.gitignore b/.gitignore index e548c97..42c0b25 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /node_modules /dist +# Generated at serve/build / Docker entrypoint +/public/config.js # local env files .env diff --git a/README.md b/README.md index 8c8d90c..f36d6d9 100644 --- a/README.md +++ b/README.md @@ -3,33 +3,35 @@ Сервис генерации случайных значений: числа из диапазона, выбор из списка, орёл/решка. Vue 3 + Vite + Element Plus. Тема и брендинг настраиваются через env / Docker. -**Версия:** `1.0.0` +**Версия:** `1.0.1` -## Setup +## Установка ``` npm install ``` -### Dev server +### Dev-сервер ``` npm run serve ``` -### Production build +### Production-сборка ``` npm run build npm run preview ``` -### Lint +### Линт ``` npm run lint ``` -## Customization -Copy `.env.example` to `.env` and set `IRANDOM_*` variables -(name, title, logo URL, colors, default locale). -`npm run serve` / `npm run build` regenerates `public/config.js`. +## Кастомизация +Скопируйте `.env.example` в `.env` и задайте переменные `IRANDOM_*` +(имя, title, URL логотипа, цвета, язык по умолчанию). +`npm run serve` / `npm run build` пересобирают `public/config.js`. + +Чтобы локально проверить другую палитру брендинга, скопируйте `.env.demo` → `.env` и перезапустите `serve`. ## Docker ``` @@ -37,6 +39,6 @@ docker compose up --build ``` → http://localhost:8080 -## Offline (PWA) -After one online visit to a production build (`build` + `preview` or Docker), -the app shell works offline. Runtime branding updates title, theme-color, icons and manifest. +## Офлайн (PWA) +После одного визита онлайн к production-сборке (`build` + `preview` или Docker) +оболочка приложения работает офлайн. Runtime-брендинг обновляет title, theme-color, иконки и manifest. diff --git a/docker-compose.yml b/docker-compose.yml index 5a0cfb4..47d06bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: irandom: build: . - image: irandom:1.0.0 + image: irandom:1.0.1 ports: - "8080:80" environment: diff --git a/index.html b/index.html index de34a09..e2b28b9 100644 --- a/index.html +++ b/index.html @@ -8,12 +8,12 @@ - irandom +
diff --git a/package.json b/package.json index 0b9ccde..3c30dfe 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { "name": "irandom", - "version": "1.0.0", + "version": "1.0.1", "private": true, "scripts": { "generate-config": "node scripts/generate-config.js", "predev": "node scripts/generate-config.js", - "dev": "vite", + "dev": "vite --host", "preserve": "node scripts/generate-config.js", - "serve": "vite", + "serve": "vite --host", "prebuild": "node scripts/generate-config.js", "build": "vite build", - "preview": "vite preview", + "preview": "vite preview --host", "lint": "eslint --ext .js,.vue src" }, "dependencies": { diff --git a/public/config.js b/public/config.js deleted file mode 100644 index d1637fe..0000000 --- a/public/config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* Generated by scripts/generate-config.js — do not edit by hand */ -window.__APP_CONFIG__ = { - "name": "irandom", - "title": "irandom", - "brandUrl": "https://git.imiheev.online/admin/irandom", - "logoUrl": "/logo.png", - "defaultLocale": "ru", - "colors": { - "primary": "#c9a66b", - "accent": "#e6c566", - "bg": "#1a1815", - "surface": "#2e2820", - "surfaceRaised": "#3a3228", - "text": "#ffffff", - "textMuted": "#c8c0b4", - "danger": "#ee5c5c", - "link": "#4a6a8a", - "border": "#4a4034" - } -}; diff --git a/src/App.vue b/src/App.vue index b562e64..9be0a36 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,17 +64,22 @@ export default { } .aside { + position: relative; + z-index: 5; background: var(--ir-surface); - overflow: hidden; + overflow: visible !important; padding: 0; transition: width 0.2s ease; - .mode-sidebar { + .sidebar-shell { height: 100%; + min-height: 0; } } .main-column { + position: relative; + z-index: 1; min-width: 0; } @@ -101,7 +106,7 @@ export default { border: 1px solid var(--ir-border) !important; } -@media (max-width: 424px) { +@media (max-width: 650px), ((orientation: landscape) and (max-height: 500px)) { .app-shell { flex-direction: column !important; padding-bottom: 72px; @@ -117,7 +122,8 @@ export default { } .main { - padding: 1rem 1rem 2rem; + /* Extra scroll room so Result can be brought to mid-screen above the toolbar */ + padding-bottom: 72px; } .mobile-toolbar { diff --git a/src/components/GeneratorActions.vue b/src/components/GeneratorActions.vue index f3a352f..7078264 100644 --- a/src/components/GeneratorActions.vue +++ b/src/components/GeneratorActions.vue @@ -1,5 +1,5 @@