This commit is contained in:
sagiferi
2026-10-24 13:20:55 +02:00
parent 93e06d148a
commit b33d1543fc
326 changed files with 20843 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+16
View File
@@ -0,0 +1,16 @@
# React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
## React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the ESLint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
+29
View File
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
+16
View File
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#0A0D13" />
<style>html, body { background: #04060B; }</style>
<title>SkyContour</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
+2644
View File
File diff suppressed because it is too large Load Diff
+31
View File
@@ -0,0 +1,31 @@
{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview",
"i18n:check": "node scripts/check-i18n.mjs"
},
"dependencies": {
"@fontsource/barlow": "^5.3.0",
"@fontsource/ibm-plex-mono": "^5.3.0",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-basic-ssl": "^2.2.0",
"@vitejs/plugin-react": "^6.0.0",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"vite": "^8.0.0"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<rect width="100" height="100" rx="22.5" fill="#0E1424"/>
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2"/><circle cx="24" cy="22" r="1.5" fill="#C9D2DE"/><circle cx="74" cy="20" r="1.3" fill="#C9D2DE"/><circle cx="88" cy="30" r="1.1" fill="#93A0B4"/>
<path d="M0 77.5 L0 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L100 63 L100 77.5 A22.5 22.5 0 0 1 77.5 100 L22.5 100 A22.5 22.5 0 0 1 0 77.5 Z" fill="#070A12"/>
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fill-opacity="0.9"/>
<path d="M2 70 L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 L85 66 L89 58 L87 58 L92 48 L97 58 L95 58 L98 63" fill="none" stroke="#F5B544" stroke-width="4" stroke-linejoin="round" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+53
View File
@@ -0,0 +1,53 @@
// Checks the translations against English: same keys, every plural category
// the language needs, and no placeholder lost or invented.
// Run: npm run i18n:check
import { readdirSync } from 'node:fs'
import { fileURLToPath, pathToFileURL } from 'node:url'
import { dirname, join } from 'node:path'
const dir = join(dirname(fileURLToPath(import.meta.url)), '../src/i18n/locales')
const load = async (f) => (await import(pathToFileURL(join(dir, f)).href)).default
const en = await load('en.js')
const params = (s) => new Set([...String(s).matchAll(/\{(\w+)\}/g)].map((m) => m[1]))
const variants = (m) => (m && typeof m === 'object' ? Object.entries(m) : [['', m]])
let problems = 0
const report = (msg) => { problems++; console.log(' ✗ ' + msg) }
for (const file of readdirSync(dir).filter((f) => f.endsWith('.js') && f !== 'en.js').sort()) {
const code = file.replace('.js', '')
const loc = await load(file)
const before = problems
console.log(code)
// Categories that occur for 0…1000 (Romance "many" only applies to millions
// and falls back to "other", which t() does anyway).
const rules = new Intl.PluralRules(code)
const needed = [...new Set(Array.from({ length: 1001 }, (_, n) => rules.select(n)))]
for (const key of Object.keys(en)) if (!(key in loc)) report(`missing key ${key}`)
for (const key of Object.keys(loc)) if (!(key in en)) report(`unknown key ${key}`)
for (const [key, msg] of Object.entries(loc)) {
if (!(key in en)) continue
const enMsg = en[key]
const enParams = new Set(variants(enMsg).flatMap(([, s]) => [...params(s)]))
if (typeof enMsg === 'object') {
if (typeof msg !== 'object') { report(`${key}: should have plural forms`); continue }
for (const cat of needed) if (!(cat in msg) && !('other' in msg && cat === 'other')) report(`${key}: missing plural "${cat}"`)
}
for (const [cat, s] of variants(msg)) {
for (const p of params(s)) if (!enParams.has(p)) report(`${key}${cat && '.' + cat}: unknown {${p}}`)
// Plural forms may spell out small counts ("one file", Arabic "two"), so {count} may be absent there.
for (const p of enParams) if (!params(s).has(p) && !(p === 'count' && typeof msg === 'object') && !(p === 'name' && cat && cat !== 'one')) {
report(`${key}${cat && '.' + cat}: lost {${p}}`)
}
}
}
if (problems === before) console.log(` ✓ ${Object.keys(loc).length} keys, plural categories: ${needed.join(' ')}`)
}
if (problems) {
console.log(`\n${problems} problem(s)`)
process.exit(1)
}
console.log('\nall translations complete')
+226
View File
@@ -0,0 +1,226 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import Sites from './screens/Sites'
import Setup from './screens/Setup'
import Capture from './screens/Capture'
import Review from './screens/Review'
import Export from './screens/Export'
import Settings from './screens/Settings'
import Calibrate from './screens/Calibrate'
import Welcome from './screens/Welcome'
import { loadSites, saveSites, loadSettings, saveSettings, newSite, deleteStrip, CELLS } from './lib/store'
import { closeSession } from './lib/survey'
import { loadWasm, errText } from './lib/wasm'
import { EMBEDDED, nativeCall } from './lib/files'
import { t, setLocale, resolveLocale, isRtl } from './i18n'
// Flow (docs/SPEC.md): Sites → Setup → Capture → Review → Export.
// Development: ?skipWelcome opens straight on the site list (not saved).
const SKIP_WELCOME = typeof location !== 'undefined' && new URLSearchParams(location.search).has('skipWelcome')
function withStatus(site) {
if (site.source === 'import') return { ...site, status: 'complete' }
const done = (site.cells || []).filter(Boolean).length >= CELLS
return { ...site, status: done ? 'complete' : 'in-progress' }
}
export default function App() {
const [sites, setSites] = useState(loadSites)
const [settings, setSettings] = useState(() => {
const s = loadSettings()
setLocale(resolveLocale(s.language)) // before the first render
return s
})
const [route, setRoute] = useState({ name: 'sites' })
const [fatal, setFatal] = useState('')
// Load wasm up front: the capture start must call into it synchronously
// from the tap (iOS motion permission).
useEffect(() => {
loadWasm().catch((e) => setFatal(t('app.engineError', { error: errText(e) })))
}, [])
// On a phone there is no console: show uncaught errors.
useEffect(() => {
const onError = (e) => setFatal(errText(e.error || e.message))
const onRejection = (e) => setFatal(errText(e.reason))
window.addEventListener('error', onError)
window.addEventListener('unhandledrejection', onRejection)
return () => {
window.removeEventListener('error', onError)
window.removeEventListener('unhandledrejection', onRejection)
}
}, [])
const commit = useCallback((fn) => {
setSites((list) => {
const next = fn(list)
saveSites(next)
return next
})
}, [])
const siteId = route.siteId
const changeSite = useCallback((patch) => {
commit((list) => list.map((s) => (
s.id === siteId ? withStatus({ ...s, ...patch, updatedAt: new Date().toISOString() }) : s
)))
}, [commit, siteId])
const changeSettings = useCallback((patch) => {
// Switch the language before the state update re-renders every screen.
if ('language' in patch) setLocale(resolveLocale(patch.language))
setSettings((s) => {
const next = { ...s, ...patch }
saveSettings(next)
return next
})
}, [])
const go = (name, id) => setRoute({ name, siteId: id })
const site = sites.find((s) => s.id === siteId)
// Android back button (called by the app shell): one screen back, false on the start screen.
const backOverride = useRef(null)
const registerBack = useCallback((fn) => { backOverride.current = fn }, [])
useEffect(() => {
window.__sfzBack = () => {
if (backOverride.current) return backOverride.current()
switch (route.name) {
case 'setup':
case 'settings':
case 'review':
setRoute({ name: 'sites' })
return true
case 'export':
setRoute({ name: 'review', siteId: route.siteId })
return true
case 'calibrate':
setRoute({ name: 'settings' })
return true
default:
return false
}
}
return () => { delete window.__sfzBack }
}, [route])
// Native tab bar (app shell only): tell it where we are, follow its taps.
const welcomed = settings.welcomed || SKIP_WELCOME
const shownRoute = route.name === 'sites' && !welcomed ? 'welcome' : route.name
useEffect(() => {
if (!EMBEDDED) return
const tab = shownRoute === 'sites' || shownRoute === 'settings' ? shownRoute : null
nativeCall('route', {
name: shownRoute,
tab,
labels: { sites: t('tab.sites'), new: t('tab.new'), settings: t('tab.settings') },
rtl: isRtl(),
})
}, [shownRoute, settings.language])
useEffect(() => {
window.__sfzNav = (tab) => {
if (tab === 'new') setRoute({ name: 'setup' })
else if (tab === 'settings') setRoute({ name: 'settings' })
else setRoute({ name: 'sites' })
}
return () => { delete window.__sfzNav }
}, [])
let screen
switch (route.name) {
case 'setup':
screen = (
<Setup
suggestedName={t('sites.defaultName', { n: sites.length + 1 })}
onBack={() => go('sites')}
onStart={({ name, location }) => {
const s = { ...newSite(name), location }
commit((list) => [...list, s])
go('capture', s.id)
}}
/>
)
break
case 'capture':
screen = site && (
<Capture
key={site.id}
site={site}
settings={settings}
onSettingsChange={changeSettings}
onSiteChange={changeSite}
onClose={() => go('sites')}
onFinish={() => go('review', site.id)}
onRegisterBack={registerBack}
/>
)
break
case 'review':
screen = site && (
<Review
key={site.id}
site={site}
onSiteChange={changeSite}
onBack={() => go('sites')}
onExport={() => go('export', site.id)}
onDelete={() => {
closeSession(site.id)
deleteStrip(site.id).catch(() => {})
commit((list) => list.filter((s) => s.id !== site.id))
go('sites')
}}
/>
)
break
case 'export':
screen = site && (
<Export site={site} settings={settings} onSiteChange={changeSite} onBack={() => go('review', site.id)} />
)
break
case 'settings':
screen = (
<Settings settings={settings} onSettingsChange={changeSettings} onBack={EMBEDDED ? null : () => go('sites')} onCalibrate={() => go('calibrate')} />
)
break
case 'calibrate':
screen = <Calibrate onSettingsChange={changeSettings} onBack={() => go('settings')} />
break
default:
screen = null
}
if (!screen && !welcomed) {
screen = <Welcome onStart={() => changeSettings({ welcomed: true })} />
}
if (!screen) {
screen = (
<Sites
sites={sites}
onNew={() => go('setup')}
onSettings={() => go('settings')}
onOpen={(s) => go(s.status === 'complete' ? 'review' : 'capture', s.id)}
onImport={(name, profile) => {
const s = withStatus({
...newSite(name || t('sites.importedName')),
source: 'import',
// A NINA file already contains its author's safety margin.
marginDeg: 0,
profile,
coverage: Array(360).fill(1),
})
commit((list) => [...list, s])
go('review', s.id)
}}
/>
)
}
return (
<>
{screen}
{fatal && <div className="fatal" onClick={() => setFatal('')}>⚠ {fatal}</div>}
</>
)
}
+20
View File
@@ -0,0 +1,20 @@
// App icon, concept A "Skyline" (assets/branding/make_icons.py — keep in sync).
const EDGE = 'L8 70 L8 56 L21 44 L27 49.5 L27 43 L30.5 43 L30.5 52.8 L34 56 L34 70 L46 70 ' +
'L50 66 L59 56 L54 56 L62 44 L58 44 L66 28 L74 44 L70 44 L78 56 L73 56 L82 66 ' +
'L85 66 L89 58 L87 58 L92 48 L97 58 L95 58'
export default function AppIcon({ size = 64, border = false }) {
return (
<svg width={size} height={size} viewBox="0 0 100 100" aria-hidden="true">
<rect width="100" height="100" rx="22.5" fill="#0E1424" stroke={border ? '#263042' : 'none'} strokeWidth="1.5" />
<circle cx="48" cy="30" r="2.6" fill="#E8ECF2" />
<circle cx="24" cy="22" r="1.5" fill="#C9D2DE" />
<circle cx="74" cy="20" r="1.3" fill="#C9D2DE" />
<circle cx="88" cy="30" r="1.1" fill="#93A0B4" />
<path d={`M0 77.5 L0 70 ${EDGE} L100 63 L100 77.5 A22.5 22.5 0 0 1 77.5 100 L22.5 100 A22.5 22.5 0 0 1 0 77.5 Z`} fill="#070A12" />
<rect x="16" y="58" width="6" height="6" fill="#F5B544" fillOpacity="0.9" />
<path d={`M2 70 ${EDGE} L98 63`} fill="none" stroke="#F5B544" strokeWidth="4" strokeLinejoin="round" strokeLinecap="round" />
</svg>
)
}
+93
View File
@@ -0,0 +1,93 @@
// Horizon charts: the small sparkline on site cards and the Review profile.
import { coveredRuns } from '../lib/profile'
import { t } from '../i18n'
const compass = () => [t('compass.n'), t('compass.e'), t('compass.s'), t('compass.w'), t('compass.n')]
const f = (n) => n.toFixed(1)
/** Site-card sparkline: area + line, 0–40°, dashed box over uncovered azimuths. */
export function Sparkline({ profile, coverage, width = 318, height = 64, max = 40 }) {
const px = (az) => (az / 360) * width
const py = (alt) => height - (Math.max(0, Math.min(alt, max)) / max) * height
const runs = profile ? coveredRuns(coverage) : []
const gaps = []
let prev = 0
for (const [a, b] of runs) {
if (a > prev) gaps.push([prev, a])
prev = b
}
if (prev < 360) gaps.push([prev, 360])
const paths = runs.map(([a, b]) => {
const end = b === 360 ? 360 : b - 1
const pts = []
for (let d = a; d <= end; d++) pts.push([d, profile[d % 360]])
if (pts.length === 1) pts.push([pts[0][0] + 1, pts[0][1]])
const line = pts.map((p, i) => `${i ? 'L' : 'M'}${f(px(p[0]))} ${f(py(p[1]))}`).join(' ')
const area = `M${f(px(pts[0][0]))} ${height} ` +
pts.map((p) => `L${f(px(p[0]))} ${f(py(p[1]))}`).join(' ') +
` L${f(px(pts[pts.length - 1][0]))} ${height} Z`
return { line, area }
})
return (
<svg viewBox={`0 0 ${width} ${height}`} width="100%" height={height} preserveAspectRatio="none" aria-hidden="true" style={{ display: 'block' }}>
<line x1="0" y1={height} x2={width} y2={height} stroke="#263042" strokeWidth="1" />
{gaps.map(([a, b]) => (
<rect key={a} x={px(a)} y="0.5" width={px(b) - px(a)} height={height - 1}
fill="#121722" stroke="#263042" strokeDasharray="3 4" vectorEffect="non-scaling-stroke" />
))}
{paths.map((p, i) => (
<g key={i}>
<path d={p.area} fill="#F5B544" fillOpacity="0.16" />
<path d={p.line} fill="none" stroke="#F5B544" strokeWidth="1.6" strokeLinejoin="round" vectorEffect="non-scaling-stroke" />
</g>
))}
</svg>
)
}
/** Review chart: edge (accent, filled) and what goes into the .hrz (dashed blue). */
export function ProfileChart({ profile, marginDeg }) {
const W = 350, H = 250, X0 = 30, X1 = 346, Y0 = 10, Y1 = 210
let top = 40
for (const v of profile) top = Math.max(top, Math.ceil((v + marginDeg) / 10) * 10)
top = Math.min(top, 90)
const step = top / 4
const px = (az) => X0 + (az / 360) * (X1 - X0)
const py = (alt) => Y1 - (Math.max(0, Math.min(alt, top)) / top) * (Y1 - Y0)
const pts = Array.from({ length: 361 }, (_, d) => [d, profile[d % 360]])
const line = pts.map((p, i) => `${i ? 'L' : 'M'}${f(px(p[0]))} ${f(py(p[1]))}`).join(' ')
const margin = pts.map((p, i) => `${i ? 'L' : 'M'}${f(px(p[0]))} ${f(py(Math.min(90, p[1] + marginDeg)))}`).join(' ')
const area = `M${X0} ${Y1} ` + pts.map((p) => `L${f(px(p[0]))} ${f(py(p[1]))}`).join(' ') + ` L${X1} ${Y1} Z`
const grid = [0, 1, 2, 3, 4].map((k) => top - k * step)
return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" role="img" style={{ display: 'block' }}
aria-label={t('review.chartLabel')}>
<g stroke="#1E2634" strokeWidth="1">
{grid.slice(0, 4).map((v) => <line key={v} x1={X0} y1={py(v)} x2={X1} y2={py(v)} />)}
</g>
<line x1={X0} y1={Y1} x2={X1} y2={Y1} stroke="#3A4558" strokeWidth="1" />
<g fontFamily="IBM Plex Mono, ui-monospace, monospace" fontSize="10" fill="#93A0B4" textAnchor="end">
{grid.map((v) => <text key={v} x="24" y={py(v) + 4}>{Math.round(v)}°</text>)}
</g>
<g fontFamily="IBM Plex Mono, ui-monospace, monospace" fontSize="11" fill="#93A0B4" textAnchor="middle">
{compass().map((l, i) => <text key={i} x={px(i * 90)} y="232">{l}</text>)}
</g>
<path d={area} fill="#F5B544" fillOpacity="0.16" />
<path d={line} fill="none" stroke="#F5B544" strokeWidth="1.6" strokeLinejoin="round" />
<path d={margin} fill="none" stroke="#6CC3E6" strokeWidth="2" strokeDasharray="5 4" strokeLinejoin="round" />
</svg>
)
}
export function CompassLabels({ style }) {
return (
<div className="compass-labels" style={style}>
{compass().map((l, i) => <span key={i}>{l}</span>)}
</div>
)
}
+86
View File
@@ -0,0 +1,86 @@
// Stroke icons from the design source (docs/design/source/*.dc.html).
const base = {
fill: 'none',
stroke: 'currentColor',
strokeLinecap: 'round',
strokeLinejoin: 'round',
'aria-hidden': true,
}
const icon = (paths, defaultSize = 20, defaultWidth = 2) =>
function Icon({ size = defaultSize, width = defaultWidth, ...rest }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" strokeWidth={width} {...base} {...rest}>
{paths}
</svg>
)
}
export const IconSettings = icon(
<>
<path d="M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1" />
<circle cx="15" cy="6" r="2" />
<circle cx="9" cy="12" r="2" />
<circle cx="17" cy="18" r="2" />
</>,
20,
1.8,
)
export const IconChevronRight = icon(<path d="M9 5l7 7-7 7" />, 20, 2.2)
export const IconBack = icon(<path d="M15 5l-7 7 7 7" />, 22, 2)
export const IconPlus = icon(<path d="M12 5v14M5 12h14" />, 20, 2.2)
export const IconImport = icon(
<>
<path d="M14 3H6v18h12V7z" />
<path d="M14 3v4h4" />
<path d="M12 11v6M9 14l3 3 3-3" />
</>,
18,
1.8,
)
export const IconCheck = icon(<path d="M5 12.5l4.5 4.5L19 7" />, 12, 2.4)
export const IconPin = icon(
<>
<path d="M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z" />
<circle cx="12" cy="9.5" r="2.5" />
</>,
20,
1.8,
)
export const IconCompass = icon(
<>
<circle cx="12" cy="12" r="9" />
<path d="M15.5 8.5l-2 5-5 2 2-5z" />
</>,
20,
1.8,
)
export const IconClose = icon(<path d="M6 6l12 12M18 6L6 18" />, 20, 2)
export const IconUndo = icon(
<>
<path d="M9 14L4 9l5-5" />
<path d="M4 9h10a6 6 0 0 1 0 12h-3" />
</>,
20,
2,
)
export const IconDownload = icon(<path d="M12 4v12M7 11l5 5 5-5M5 20h14" />, 18, 2)
export const IconShare = icon(
<path d="M12 3v12M7 8l5-5 5 5M5 14v5a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-5" />,
18,
2,
)
export const IconTrash = icon(
<path d="M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3" />,
20,
1.8,
)
export const IconCamera = icon(
<>
<path d="M4 8h3l2-3h6l2 3h3v11H4z" />
<circle cx="12" cy="13" r="3.5" />
</>,
22,
1.8,
)
+104
View File
@@ -0,0 +1,104 @@
// Tiny i18n layer: flat message keys, {param} interpolation, plurals via
// Intl.PluralRules. English is the source and the fallback for missing keys.
//
// Messages are plain strings, or for counts an object keyed by plural
// category ({ one, few, many, other, … }) selected with params.count.
import en from './locales/en'
import es from './locales/es'
import ar from './locales/ar'
import de from './locales/de'
import hu from './locales/hu'
import pl from './locales/pl'
import fr from './locales/fr'
import it from './locales/it'
import sk from './locales/sk'
/** Supported languages, endonyms for the language picker. */
export const LOCALES = [
{ code: 'en', name: 'English' },
{ code: 'es', name: 'Español' },
{ code: 'ar', name: 'العربية', dir: 'rtl' },
{ code: 'de', name: 'Deutsch' },
{ code: 'hu', name: 'Magyar' },
{ code: 'pl', name: 'Polski' },
{ code: 'fr', name: 'Français' },
{ code: 'it', name: 'Italiano' },
{ code: 'sk', name: 'Slovenčina' },
]
const MESSAGES = { en, es, ar, de, hu, pl, fr, it, sk }
let locale = 'en'
let messages = en
let plural = new Intl.PluralRules('en')
/** First supported language from the system preferences, else English. */
export function systemLocale() {
const prefs = (typeof navigator !== 'undefined' && (navigator.languages || [navigator.language])) || []
for (const tag of prefs) {
const base = String(tag || '').toLowerCase().split(/[-_]/)[0]
if (MESSAGES[base]) return base
}
return 'en'
}
/** Resolve a stored preference ('' or null = follow the system). */
export function resolveLocale(pref) {
return pref && MESSAGES[pref] ? pref : systemLocale()
}
export function setLocale(code) {
locale = MESSAGES[code] ? code : 'en'
messages = MESSAGES[locale]
plural = new Intl.PluralRules(locale)
numberFormats.clear()
if (typeof document !== 'undefined') {
document.documentElement.lang = locale
document.documentElement.dir = isRtl() ? 'rtl' : 'ltr'
}
}
export function getLocale() {
return locale
}
export function isRtl() {
return LOCALES.find((l) => l.code === locale)?.dir === 'rtl'
}
export function localeName(code) {
return LOCALES.find((l) => l.code === code)?.name || code
}
/** Translate a key. Missing keys fall back to English, then to the key itself. */
export function t(key, params) {
let m = messages[key] ?? en[key] ?? key
if (m && typeof m === 'object') {
const n = params && typeof params.count === 'number' ? params.count : 0
m = m[plural.select(n)] ?? m.other ?? Object.values(m)[0]
}
if (!params) return m
return m.replace(/\{(\w+)\}/g, (all, k) => (params[k] !== undefined ? String(params[k]) : all))
}
// ---------- numbers ----------
const numberFormats = new Map()
/** Locale-aware fixed-decimals number; Latin digits everywhere (also in Arabic). */
export function formatNumber(v, digits) {
const key = digits
let f = numberFormats.get(key)
if (!f) {
f = new Intl.NumberFormat(`${locale}-u-nu-latn`, {
minimumFractionDigits: digits,
maximumFractionDigits: digits,
useGrouping: false,
})
numberFormats.set(key, f)
}
return f.format(v)
}
setLocale(systemLocale())
+220
View File
@@ -0,0 +1,220 @@
// العربية (\u200E before .hrz/.zip keeps the extension readable in RTL text; right to left; plural categories: zero, one, two, few = 3–10, many = 11–99, other = 100+)
export default {
'tab.sites': 'المواقع',
'tab.new': 'مسح جديد',
'tab.settings': 'الإعدادات',
'compass.n': 'ش',
'compass.e': 'ق',
'compass.s': 'ج',
'compass.w': 'غ',
'common.back': 'رجوع',
'common.startCamera': 'تشغيل الكاميرا',
'common.startingCamera': 'جارٍ تشغيل الكاميرا…',
'common.noLocation': 'لا يوجد موقع',
'app.engineError': 'تعذّر تحميل المحرّك: {error}',
'welcome.tagline': 'تتبّع الأشجار وأسطح المنازل حول تلسكوبك',
'welcome.formats': 'NINA .HRZ · مشهد Stellarium',
'welcome.start': 'ابدأ',
'welcome.sceneLabel': 'حديقة ليلية فيها منزل وأشجار وتلسكوب تحت سماء مرصّعة بالنجوم؛ خطّ كهرماني متقطّع يتتبّع الأفق فوق الأسطح وقمم الأشجار',
'sites.subtitle': 'آفاق اصطناعية لـ NINA و Stellarium',
'sites.settings': 'الإعدادات',
'sites.count': 'المواقع · {count}',
'sites.emptyTitle': 'لا توجد مواقع بعد',
'sites.emptyHint': 'قف حيث يقف تلسكوبك وابدأ مسحًا.',
'sites.emptyHintApp': 'اضغط «{tab}» في الأسفل، أو استورد ملف \u200E.hrz من NINA بالزر في الأعلى.',
'sites.newSurvey': 'مسح جديد للأفق',
'sites.import': 'استيراد ملف \u200E.hrz موجود',
'sites.importError': 'تعذّرت قراءة {file}: {error}',
'sites.inProgress': 'قيد التنفيذ',
'sites.noHorizon': 'لا يوجد أفق بعد',
'sites.covered': 'تمت تغطية {deg}° من 360°',
'sites.continue': 'متابعة المسح',
'sites.imported': 'ملف \u200E.hrz مستورد',
'sites.framesFull': {
zero: '{count} صورة · 360° كاملة', one: 'صورة واحدة · 360° كاملة', two: 'صورتان · 360° كاملة',
few: '{count} صور · 360° كاملة', many: '{count} صورة · 360° كاملة', other: '{count} صورة · 360° كاملة',
},
'sites.framesPartial': {
zero: '{count} صورة · تغطية {deg}°', one: 'صورة واحدة · تغطية {deg}°', two: 'صورتان · تغطية {deg}°',
few: '{count} صور · تغطية {deg}°', many: '{count} صورة · تغطية {deg}°', other: '{count} صورة · تغطية {deg}°',
},
'sites.defaultName': 'الموقع {n}',
'sites.importedName': 'أفق مستورد',
'setup.title': 'مسح جديد',
'setup.siteName': 'اسم الموقع',
'setup.locating': 'جارٍ تحديد الموقع…',
'setup.locationHint': 'يُكتب في مشهد Stellarium',
'setup.altitudeUnknown': 'الارتفاع غير معروف',
'setup.elevation': '{m} م',
'setup.gps': 'GPS ±{m} م',
'setup.refresh': 'تحديث',
'setup.noGeo': 'لا تتوفر خدمة الموقع في هذا المتصفح',
'setup.geoUnavailable': 'الموقع غير متاح',
'setup.northTitle': 'الشمال من البوصلة',
'setup.northHint': 'لم يُطبَّق الانحراف المغناطيسي بعد: صحّح الشمال بالإزاحة في شاشة المراجعة',
'setup.howTo': 'طريقة التصوير',
'setup.skyNotNeeded': 'لا حاجة للسماء',
'setup.illustration': 'استدر دورة كاملة في مكانك والهاتف قائم؛ يُصوَّر فقط شريط حول الأفق',
'setup.step1': 'قف حيث يقف التلسكوب.',
'setup.step2': 'أمسك الهاتف قائمًا ومائلًا قليلًا فوق الأفق.',
'setup.step3': 'استدر ببطء دورة كاملة. تُلتقط الصور تلقائيًا.',
'setup.start': 'بدء التصوير',
'setup.sensorsError': 'مستشعرات الحركة غير متاحة: {error}',
'setup.cameraError': 'الكاميرا: {error}',
'capture.openError': 'تعذّر فتح المسح: {error}',
'capture.saveError': 'تعذّر الحفظ: {error}',
'capture.close': 'إغلاق المسح',
'capture.undo': 'إعادة التقاط آخر صورة',
'capture.frameOf': 'الصورة {n} من {total}',
'capture.allFrames': 'كل الصور ({count})',
'capture.progress': 'تقدّم البانوراما على 360 درجة',
'capture.heading': 'الاتجاه',
'capture.tilt': 'الميل',
'capture.covers': 'التغطية',
'capture.autoOn': 'تلقائي: تشغيل',
'capture.autoOff': 'تلقائي: إيقاف',
'capture.shutter': 'التقاط صورة',
'capture.finish': 'إنهاء',
'capture.topTouch': 'عائق يصل إلى أعلى الصورة عند {az}°',
'capture.addHigher': 'صورة أعلى',
'capture.hint.compass': 'بانتظار البوصلة…',
'capture.hint.done': 'التُقطت كل الصور. اضغط إنهاء.',
'capture.hint.higher': 'صورة أعلى: وجّه الهاتف نحو النقطة',
'capture.hint.turnRight': 'استدر يمينًا حتى تدخل النقطة في الدائرة',
'capture.hint.turnLeft': 'استدر يسارًا حتى تدخل النقطة في الدائرة',
'capture.hint.manual': 'وجّه الهاتف نحو النقطة ثم اضغط زر الالتقاط',
'capture.hint.tiltUp': 'أمِل الهاتف قليلًا إلى الأعلى',
'capture.hint.tiltDown': 'أمِل الهاتف قليلًا إلى الأسفل',
'capture.hint.hold': 'اثبت…',
'capture.hint.tap': 'اضغط زر الالتقاط',
'capture.err.noHeading': 'لا يوجد اتجاه من البوصلة بعد',
'capture.err.cameraNotReady': 'الكاميرا غير جاهزة',
'capture.err.encode': 'تعذّر إنشاء البانوراما',
'camera.err.https': 'تحتاج الكاميرا إلى HTTPS (أو localhost).',
'camera.err.noApi': 'لا يمكن لهذا المتصفح الوصول إلى الكاميرا.',
'camera.err.noPicture': 'بدأت الكاميرا لكنها لا ترسل صورة.',
'review.title': 'مراجعة الأفق',
'review.imported': 'مستورد من ملف \u200E.hrz',
'review.stitchedFull': {
zero: '{count} صورة مدمجة · 360° كاملة', one: 'صورة واحدة مدمجة · 360° كاملة', two: 'صورتان مدمجتان · 360° كاملة',
few: '{count} صور مدمجة · 360° كاملة', many: '{count} صورة مدمجة · 360° كاملة', other: '{count} صورة مدمجة · 360° كاملة',
},
'review.stitchedPartial': {
zero: '{count} صورة مدمجة · {deg}° من 360°', one: 'صورة واحدة مدمجة · {deg}° من 360°', two: 'صورتان مدمجتان · {deg}° من 360°',
few: '{count} صور مدمجة · {deg}° من 360°', many: '{count} صورة مدمجة · {deg}° من 360°', other: '{count} صورة مدمجة · {deg}° من 360°',
},
'review.delete': 'حذف الموقع',
'review.deleteConfirm': 'حذف؟',
'review.tabNina': 'أفق NINA',
'review.tabPano': 'بانوراما',
'review.detecting': 'جارٍ اكتشاف حافة السماء…',
'review.noHorizon': 'لا يوجد أفق بعد: التقط بعض الصور أولًا.',
'review.legendEdge': 'حافة السماء المكتشفة',
'review.legendHrz': 'يُكتب في ملف \u200E.hrz',
'review.chartLabel': 'مقطع الأفق: ارتفاع العوائق حسب السمت، مع هامش الأمان بخط متقطّع',
'review.margin': 'هامش الأمان',
'review.marginHint': 'يُبعد أهداف NINA عن قمم الأشجار وعن خطأ البوصلة',
'review.toolAuto': 'تلقائي',
'review.toolSky': 'تلوين السماء',
'review.toolGround': 'تلوين الأرض',
'review.edits': {
zero: 'لا تعديلات', one: 'تعديل واحد', two: 'تعديلان',
few: '{count} تعديلات', many: '{count} تعديلًا', other: '{count} تعديل',
},
'review.undoEdit': 'تراجع عن الأخير',
'review.clearEdits': 'العودة إلى التلقائي',
'review.transparentSky': 'سماء شفافة في Stellarium',
'review.dragHint': 'اسحب للنظر حولك',
'review.paintHint': 'لوّن بإصبعك',
'review.zoomLabel': 'بانوراما مكبّرة: المنطقة المربّعة سماء شفافة، والخط هو الحافة المكتشفة',
'review.overviewLabel': 'البانوراما الكاملة بزاوية 360 درجة مع تحديد الجزء المكبّر',
'review.north': 'إزاحة الشمال',
'review.northHint': 'تنطبق على ملف \u200E.hrz والبانوراما',
'review.rotateLeft': 'تدوير 0.5 درجة إلى اليسار',
'review.rotateRight': 'تدوير 0.5 درجة إلى اليمين',
'review.export': 'تصدير',
'export.title': 'تصدير',
'export.back': 'العودة إلى المراجعة',
'export.summary': '{name} · الهامش {margin}° · إزاحة الشمال {north}°',
'export.ninaTitle': 'أفق مخصّص لـ NINA',
'export.ninaSub': 'حافة السماء + هامش الأمان كأزواج سمت/ارتفاع، لحدود ارتفاع الأهداف',
'export.panoTitle': 'بانوراما Stellarium',
'export.panoSub': 'مشهد كروي: شريط صور بزاوية 360° مع سماء شفافة، PNG بحجم 8192 × 2048',
'export.polyTitle': 'Stellarium، المخطط فقط',
'export.polySub': 'مشهد مضلّع: خط الأفق فقط، بلا صورة',
'export.panoUnavailable': 'يتطلب مسحًا بالصور (غير متاح للآفاق المستوردة)',
'export.panoGaps': 'لم تُصوَّر الـ 360° كاملة: تُملأ الفجوات بلون داكن',
'export.preview': 'معاينة',
'export.loading': 'جارٍ التحميل…',
'export.lines': {
zero: '{count} سطر · السمت الارتفاع، هامش {margin}°', one: 'سطر واحد · السمت الارتفاع، هامش {margin}°',
two: 'سطران · السمت الارتفاع، هامش {margin}°', few: '{count} أسطر · السمت الارتفاع، هامش {margin}°',
many: '{count} سطرًا · السمت الارتفاع، هامش {margin}°', other: '{count} سطر · السمت الارتفاع، هامش {margin}°',
},
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: ثبّت ملف \u200E.zip من خيارات السماء والعرض › المشهد › إضافة/إزالة المشاهد.',
'export.rendering': 'جارٍ إنشاء البانوراما…',
'export.preparing': 'جارٍ التحضير…',
'export.sharing': 'جارٍ المشاركة…',
'export.saving': 'جارٍ الحفظ…',
'export.save': 'حفظ',
'export.share': {
zero: 'مشاركة', one: 'مشاركة ملف واحد', two: 'مشاركة ملفين',
few: 'مشاركة {count} ملفات', many: 'مشاركة {count} ملفًا', other: 'مشاركة {count} ملف',
},
'files.downloaded': {
zero: 'لم يُنزَّل أي ملف', one: 'تم تنزيل {name}', two: 'تم تنزيل ملفين',
few: 'تم تنزيل {count} ملفات', many: 'تم تنزيل {count} ملفًا', other: 'تم تنزيل {count} ملف',
},
'files.savedAndroid': {
zero: 'لم يُحفظ أي ملف', one: 'حُفظ في التنزيلات: {name}', two: 'حُفظ ملفان في التنزيلات',
few: 'حُفظت {count} ملفات في التنزيلات', many: 'حُفظ {count} ملفًا في التنزيلات', other: 'حُفظ {count} ملف في التنزيلات',
},
'files.savedIos': {
zero: 'لم يُحفظ أي ملف', one: 'حُفظ في الملفات › SkyContour: {name}', two: 'حُفظ ملفان في الملفات › SkyContour',
few: 'حُفظت {count} ملفات في الملفات › SkyContour', many: 'حُفظ {count} ملفًا في الملفات › SkyContour', other: 'حُفظ {count} ملف في الملفات › SkyContour',
},
'files.shared': 'تمت المشاركة',
'files.shareCancelled': 'أُلغيت المشاركة',
'files.shareUnsupported': 'لا يستطيع هذا المتصفح مشاركة الملفات، لذا تم تنزيلها.',
'settings.title': 'الإعدادات',
'settings.camera': 'الكاميرا',
'settings.fov': 'مجال الرؤية',
'settings.fovValue': '{fov}° على عرض الصورة',
'settings.fovAssumed': 'غير معايَر: يُفترض نحو {fov}°',
'settings.narrower': 'أضيق',
'settings.wider': 'أوسع',
'settings.calibrate': 'المعايرة بالكاميرا',
'settings.reset': 'إعادة الضبط',
'settings.fovHint': 'يحدّد مجال الرؤية موضع كل صورة في البانوراما. عايِر مرة واحدة لكل هاتف: استدر ببطء بينما يقارن التطبيق بين منظرين متداخلين.',
'settings.author': 'المؤلّف في ملفات Stellarium',
'settings.authorPlaceholder': 'اسمك',
'settings.language': 'اللغة',
'settings.systemLanguage': 'لغة النظام ({name})',
'settings.about': '{app} · آفاق لـ NINA و Stellarium',
'calib.title': 'مجال الرؤية',
'calib.intro': 'وجّه الكاميرا نحو تفاصيل بعيدة (أشجار، أسطح)، ثم اضغط بدء واستدر ببطء إلى الجانب.',
'calib.turn': 'أدِر الهاتف ببطء إلى الجانب ⟷',
'calib.turnAuto': 'أدِر الهاتف ببطء إلى الجانب ⟷ (ينتهي تلقائيًا)',
'calib.newRef': 'التُقطت صورة مرجعية جديدة: تابع الاستدارة ببطء ⟷',
'calib.noMatch': 'لا يوجد تطابق: استدر أبطأ ووجّه نحو تفاصيل بعيدة',
'calib.almost': 'اقتربنا: القيم ما زالت تتغيّر، تابع الاستدارة ببطء',
'calib.measuring': 'جارٍ القياس… تابع الاستدارة ببطء',
'calib.waiting': 'بانتظار الكاميرا والبوصلة…',
'calib.done': 'تم: حُفظ مجال رؤية {fov}°.',
'calib.doneButton': 'تم',
'calib.restart': 'إعادة القياس',
'calib.start': 'بدء',
}
+189
View File
@@ -0,0 +1,189 @@
// Deutsch
export default {
'tab.sites': 'Standorte',
'tab.new': 'Neue Messung',
'tab.settings': 'Einstellungen',
'compass.n': 'N',
'compass.e': 'O',
'compass.s': 'S',
'compass.w': 'W',
'common.back': 'Zurück',
'common.startCamera': 'Kamera starten',
'common.startingCamera': 'Kamera wird gestartet…',
'common.noLocation': 'Kein Standort',
'app.engineError': 'Die Rechen-Engine konnte nicht geladen werden: {error}',
'welcome.tagline': 'Erfasse die Bäume und Dächer rund um dein Teleskop',
'welcome.formats': 'NINA .HRZ · STELLARIUM-LANDSCHAFT',
'welcome.start': 'Los geht’s',
'welcome.sceneLabel': 'Nächtlicher Garten mit Haus, Bäumen und Teleskop unter Sternenhimmel; eine gestrichelte bernsteinfarbene Linie folgt dem Horizont über Dächern und Baumkronen',
'sites.subtitle': 'Künstliche Horizonte für NINA & Stellarium',
'sites.settings': 'Einstellungen',
'sites.count': 'Standorte · {count}',
'sites.emptyTitle': 'Noch keine Standorte',
'sites.emptyHint': 'Stell dich dorthin, wo dein Teleskop steht, und starte eine Messung.',
'sites.emptyHintApp': 'Tippe unten auf „{tab}“ oder importiere eine NINA-.hrz mit der Schaltfläche oben.',
'sites.newSurvey': 'Neue Horizontmessung',
'sites.import': 'Vorhandene .hrz importieren',
'sites.importError': '{file} konnte nicht gelesen werden: {error}',
'sites.inProgress': 'In Arbeit',
'sites.noHorizon': 'Noch kein Horizont',
'sites.covered': '{deg}° von 360° erfasst',
'sites.continue': 'Messung fortsetzen',
'sites.imported': 'Importierte .hrz',
'sites.framesFull': { one: '{count} Bild · volle 360°', other: '{count} Bilder · volle 360°' },
'sites.framesPartial': { one: '{count} Bild · {deg}° erfasst', other: '{count} Bilder · {deg}° erfasst' },
'sites.defaultName': 'Standort {n}',
'sites.importedName': 'Importierter Horizont',
'setup.title': 'Neue Messung',
'setup.siteName': 'Name des Standorts',
'setup.locating': 'Standort wird ermittelt…',
'setup.locationHint': 'Wird in die Stellarium-Landschaft geschrieben',
'setup.altitudeUnknown': 'Höhe unbekannt',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Aktualisieren',
'setup.noGeo': 'Dieser Browser hat keine Ortungsdienste',
'setup.geoUnavailable': 'Standort nicht verfügbar',
'setup.northTitle': 'Norden vom Kompass',
'setup.northHint': 'Die Deklination wird noch nicht berücksichtigt: korrigiere Norden mit dem Versatz in der Prüfung',
'setup.howTo': 'So wird aufgenommen',
'setup.skyNotNeeded': 'Himmel nicht nötig',
'setup.illustration': 'Dreh dich einmal auf der Stelle und halte das Telefon aufrecht; fotografiert wird nur ein Band um den Horizont',
'setup.step1': 'Stell dich dorthin, wo das Teleskop steht.',
'setup.step2': 'Halte das Telefon aufrecht, leicht über den Horizont geneigt.',
'setup.step3': 'Dreh dich langsam einmal im Kreis. Die Bilder entstehen automatisch.',
'setup.start': 'Aufnahme starten',
'setup.sensorsError': 'Bewegungssensoren nicht verfügbar: {error}',
'setup.cameraError': 'Kamera: {error}',
'capture.openError': 'Die Messung konnte nicht geöffnet werden: {error}',
'capture.saveError': 'Speichern fehlgeschlagen: {error}',
'capture.close': 'Messung schließen',
'capture.undo': 'Letztes Bild wiederholen',
'capture.frameOf': 'Bild {n} von {total}',
'capture.allFrames': 'alle {count} Bilder',
'capture.progress': 'Panorama-Fortschritt über 360 Grad',
'capture.heading': 'RICHTUNG',
'capture.tilt': 'NEIGUNG',
'capture.covers': 'BEREICH',
'capture.autoOn': 'Auto an',
'capture.autoOff': 'Auto aus',
'capture.shutter': 'Bild aufnehmen',
'capture.finish': 'Fertig',
'capture.topTouch': 'Hindernis reicht bei {az}° bis an den Bildrand',
'capture.addHigher': 'Höheres Bild',
'capture.hint.compass': 'Warte auf den Kompass…',
'capture.hint.done': 'Alle Bilder aufgenommen. Tippe auf Fertig.',
'capture.hint.higher': 'Höheres Bild: richte den Punkt aus',
'capture.hint.turnRight': 'Nach rechts drehen, bis der Punkt im Kreis ist',
'capture.hint.turnLeft': 'Nach links drehen, bis der Punkt im Kreis ist',
'capture.hint.manual': 'Richte den Punkt aus und tippe dann auf den Auslöser',
'capture.hint.tiltUp': 'Telefon etwas nach oben neigen',
'capture.hint.tiltDown': 'Telefon etwas nach unten neigen',
'capture.hint.hold': 'Ruhig halten…',
'capture.hint.tap': 'Tippe auf den Auslöser',
'capture.err.noHeading': 'Noch keine Kompassrichtung',
'capture.err.cameraNotReady': 'Kamera nicht bereit',
'capture.err.encode': 'Das Panorama konnte nicht erstellt werden',
'camera.err.https': 'Die Kamera braucht HTTPS (oder localhost).',
'camera.err.noApi': 'Dieser Browser hat keinen Kamerazugriff.',
'camera.err.noPicture': 'Die Kamera läuft, liefert aber kein Bild.',
'review.title': 'Horizont prüfen',
'review.imported': 'Aus .hrz importiert',
'review.stitchedFull': { one: '{count} Bild zusammengefügt · volle 360°', other: '{count} Bilder zusammengefügt · volle 360°' },
'review.stitchedPartial': { one: '{count} Bild zusammengefügt · {deg}° von 360°', other: '{count} Bilder zusammengefügt · {deg}° von 360°' },
'review.delete': 'Standort löschen',
'review.deleteConfirm': 'Löschen?',
'review.tabNina': 'NINA-Horizont',
'review.tabPano': 'Panorama',
'review.detecting': 'Himmelskante wird erkannt…',
'review.noHorizon': 'Noch kein Horizont: nimm zuerst ein paar Bilder auf.',
'review.legendEdge': 'Erkannte Himmelskante',
'review.legendHrz': 'In die .hrz geschrieben',
'review.chartLabel': 'Horizontprofil: Höhe der Hindernisse nach Azimut, gestrichelt mit Sicherheitsabstand',
'review.margin': 'Sicherheitsabstand',
'review.marginHint': 'Hält NINA-Ziele von Baumspitzen und Kompassfehlern fern',
'review.toolAuto': 'Automatisch',
'review.toolSky': 'Himmel malen',
'review.toolGround': 'Boden malen',
'review.edits': { one: '{count} Korrektur', other: '{count} Korrekturen' },
'review.undoEdit': 'Letzte rückgängig',
'review.clearEdits': 'Zurück zur Automatik',
'review.transparentSky': 'Transparenter Himmel in Stellarium',
'review.dragHint': 'Ziehen zum Umsehen',
'review.paintHint': 'Mit dem Finger malen',
'review.zoomLabel': 'Vergrößertes Panorama: kariert ist transparenter Himmel, die Linie ist die erkannte Kante',
'review.overviewLabel': 'Gesamtes 360-Grad-Panorama, der vergrößerte Teil ist markiert',
'review.north': 'Nordversatz',
'review.northHint': 'Gilt für .hrz und Panorama',
'review.rotateLeft': 'Um 0,5 Grad nach links drehen',
'review.rotateRight': 'Um 0,5 Grad nach rechts drehen',
'review.export': 'Exportieren',
'export.title': 'Exportieren',
'export.back': 'Zurück zur Prüfung',
'export.summary': '{name} · Abstand {margin}° · Nordversatz {north}°',
'export.ninaTitle': 'NINA Custom Horizon',
'export.ninaSub': 'Himmelskante + Sicherheitsabstand als Azimut/Höhe-Paare, für Höhengrenzen der Ziele',
'export.panoTitle': 'Stellarium-Panorama',
'export.panoSub': 'Sphärische Landschaft: 360°-Fotoband mit transparentem Himmel, 8192 × 2048 PNG',
'export.polyTitle': 'Stellarium, nur Umriss',
'export.polySub': 'Polygonale Landschaft: nur die Horizontlinie, ohne Foto',
'export.panoUnavailable': 'Braucht eine Fotomessung (für importierte Horizonte nicht verfügbar)',
'export.panoGaps': 'Nicht alle 360° fotografiert: Lücken werden dunkel gefüllt',
'export.preview': 'Vorschau',
'export.loading': 'Wird geladen…',
'export.lines': { one: '{count} Zeile · Azimut Höhe, {margin}° Abstand', other: '{count} Zeilen · Azimut Höhe, {margin}° Abstand' },
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: die .zip unter Himmels- und Ansichtsoptionen › Landschaft › Landschaften hinzufügen/entfernen installieren.',
'export.rendering': 'Panorama wird erstellt…',
'export.preparing': 'Wird vorbereitet…',
'export.sharing': 'Wird geteilt…',
'export.saving': 'Wird gespeichert…',
'export.save': 'Speichern',
'export.share': { one: '{count} Datei teilen', other: '{count} Dateien teilen' },
'files.downloaded': { one: 'Heruntergeladen: {name}', other: '{count} Dateien heruntergeladen' },
'files.savedAndroid': { one: 'In Downloads gespeichert: {name}', other: '{count} Dateien in Downloads gespeichert' },
'files.savedIos': { one: 'Gespeichert in Dateien › SkyContour: {name}', other: '{count} Dateien gespeichert in Dateien › SkyContour' },
'files.shared': 'Geteilt',
'files.shareCancelled': 'Teilen abgebrochen',
'files.shareUnsupported': 'Dieser Browser kann keine Dateien teilen, deshalb wurden sie heruntergeladen.',
'settings.title': 'Einstellungen',
'settings.camera': 'Kamera',
'settings.fov': 'Bildwinkel',
'settings.fovValue': '{fov}° über die Bildbreite',
'settings.fovAssumed': 'Nicht kalibriert: etwa {fov}° angenommen',
'settings.narrower': 'Enger',
'settings.wider': 'Weiter',
'settings.calibrate': 'Mit der Kamera kalibrieren',
'settings.reset': 'Zurücksetzen',
'settings.fovHint': 'Der Bildwinkel bestimmt, wo jedes Foto im Panorama landet. Einmal pro Telefon kalibrieren: langsam drehen, während die App zwei überlappende Ansichten vergleicht.',
'settings.author': 'Autor in Stellarium-Dateien',
'settings.authorPlaceholder': 'Dein Name',
'settings.language': 'Sprache',
'settings.systemLanguage': 'Systemsprache ({name})',
'settings.about': '{app} · Horizonte für NINA und Stellarium',
'calib.title': 'Bildwinkel',
'calib.intro': 'Richte die Kamera auf entfernte Details (Bäume, Dächer), tippe auf Start und dreh dich langsam zur Seite.',
'calib.turn': 'Telefon langsam zur Seite drehen ⟷',
'calib.turnAuto': 'Telefon langsam zur Seite drehen ⟷ (endet von selbst)',
'calib.newRef': 'Neue Referenz aufgenommen: weiter langsam drehen ⟷',
'calib.noMatch': 'Keine Übereinstimmung: langsamer drehen und auf entfernte Details zielen',
'calib.almost': 'Fast fertig: die Werte schwanken noch, weiter langsam drehen',
'calib.measuring': 'Messung… weiter langsam drehen',
'calib.waiting': 'Warte auf Kamera und Kompass…',
'calib.done': 'Fertig: Bildwinkel {fov}° gespeichert.',
'calib.doneButton': 'Fertig',
'calib.restart': 'Messung neu starten',
'calib.start': 'Start',
}
+201
View File
@@ -0,0 +1,201 @@
// English: the source language and the fallback for every other locale.
// Plural messages are objects keyed by Intl.PluralRules category.
export default {
// Native tab bar (sent to the app shell)
'tab.sites': 'Sites',
'tab.new': 'New survey',
'tab.settings': 'Settings',
// Compass points: axis labels and coordinate hemispheres
'compass.n': 'N',
'compass.e': 'E',
'compass.s': 'S',
'compass.w': 'W',
'common.back': 'Back',
'common.startCamera': 'Start camera',
'common.startingCamera': 'Starting camera…',
'common.noLocation': 'No location',
'app.engineError': 'Could not load the engine: {error}',
// Welcome
'welcome.tagline': 'Trace the trees and rooftops around your telescope',
'welcome.formats': 'NINA .HRZ · STELLARIUM LANDSCAPE',
'welcome.start': 'Get started',
'welcome.sceneLabel': 'Night garden with a house, trees and a telescope under a starry sky; a dashed amber line traces the horizon over the rooftops and treetops',
// Sites
'sites.subtitle': 'Artificial horizons for NINA & Stellarium',
'sites.settings': 'Settings',
'sites.count': 'Sites · {count}',
'sites.emptyTitle': 'No sites yet',
'sites.emptyHint': 'Stand where your telescope stands and start a survey.',
'sites.emptyHintApp': 'Tap “{tab}” below, or import a NINA .hrz with the button above.',
'sites.newSurvey': 'New horizon survey',
'sites.import': 'Import existing .hrz',
'sites.importError': 'Could not read {file}: {error}',
'sites.inProgress': 'In progress',
'sites.noHorizon': 'No horizon yet',
'sites.covered': '{deg}° of 360° covered',
'sites.continue': 'Continue survey',
'sites.imported': 'Imported .hrz',
'sites.framesFull': { one: '{count} frame · full 360°', other: '{count} frames · full 360°' },
'sites.framesPartial': { one: '{count} frame · {deg}° covered', other: '{count} frames · {deg}° covered' },
'sites.defaultName': 'Site {n}',
'sites.importedName': 'Imported horizon',
// Setup
'setup.title': 'New survey',
'setup.siteName': 'Site name',
'setup.locating': 'Finding location…',
'setup.locationHint': 'Written into the Stellarium landscape',
'setup.altitudeUnknown': 'Altitude unknown',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Refresh',
'setup.noGeo': 'No location service in this browser',
'setup.geoUnavailable': 'Location unavailable',
'setup.northTitle': 'North from compass',
'setup.northHint': 'Declination is not applied yet: correct north with the offset in Review',
'setup.howTo': 'How to capture',
'setup.skyNotNeeded': 'sky not needed',
'setup.illustration': 'Turn once around in place, holding the phone upright; only a band around the horizon is photographed',
'setup.step1': 'Stand where the telescope stands.',
'setup.step2': 'Hold the phone upright, tilted slightly above the horizon.',
'setup.step3': 'Turn once around slowly. Frames are taken automatically.',
'setup.start': 'Start capture',
'setup.sensorsError': 'Motion sensors are not available: {error}',
'setup.cameraError': 'Camera: {error}',
// Capture
'capture.openError': 'Could not open the survey: {error}',
'capture.saveError': 'Could not save: {error}',
'capture.close': 'Close survey',
'capture.undo': 'Retake last frame',
'capture.frameOf': 'frame {n} of {total}',
'capture.allFrames': 'all {count} frames',
'capture.progress': 'Panorama progress around 360 degrees',
'capture.heading': 'HEADING',
'capture.tilt': 'TILT',
'capture.covers': 'COVERS',
'capture.autoOn': 'Auto on',
'capture.autoOff': 'Auto off',
'capture.shutter': 'Take frame',
'capture.finish': 'Finish',
'capture.topTouch': 'Obstruction reaches the frame top at {az}°',
'capture.addHigher': 'Add higher shot',
'capture.hint.compass': 'Waiting for the compass…',
'capture.hint.done': 'All frames taken. Tap Finish.',
'capture.hint.higher': 'Higher shot: line up the dot',
'capture.hint.turnRight': 'Turn right until the dot is in the circle',
'capture.hint.turnLeft': 'Turn left until the dot is in the circle',
'capture.hint.manual': 'Line up the dot, then tap the shutter',
'capture.hint.tiltUp': 'Tilt the phone up a little',
'capture.hint.tiltDown': 'Tilt the phone down a little',
'capture.hint.hold': 'Hold still…',
'capture.hint.tap': 'Tap the shutter',
'capture.err.noHeading': 'No compass heading yet',
'capture.err.cameraNotReady': 'Camera not ready',
'capture.err.encode': 'Could not encode the panorama',
'camera.err.https': 'The camera needs HTTPS (or localhost).',
'camera.err.noApi': 'This browser has no camera access.',
'camera.err.noPicture': 'The camera started but sends no picture.',
// Review
'review.title': 'Review horizon',
'review.imported': 'Imported from .hrz',
'review.stitchedFull': { one: '{count} frame stitched · full 360°', other: '{count} frames stitched · full 360°' },
'review.stitchedPartial': { one: '{count} frame stitched · {deg}° of 360°', other: '{count} frames stitched · {deg}° of 360°' },
'review.delete': 'Delete site',
'review.deleteConfirm': 'Delete site?',
'review.tabNina': 'NINA horizon',
'review.tabPano': 'Panorama',
'review.detecting': 'Detecting the sky edge…',
'review.noHorizon': 'No horizon yet: capture some frames first.',
'review.legendEdge': 'Detected sky edge',
'review.legendHrz': 'Written to .hrz',
'review.chartLabel': 'Horizon profile: obstruction altitude by azimuth, with the safety margin dashed',
'review.margin': 'Safety margin',
'review.marginHint': 'Keeps NINA targets clear of tree tips and compass error',
'review.toolAuto': 'Auto edge',
'review.toolSky': 'Paint sky',
'review.toolGround': 'Paint ground',
'review.edits': { one: '{count} edit', other: '{count} edits' },
'review.undoEdit': 'Undo last',
'review.clearEdits': 'Back to auto edge',
'review.transparentSky': 'Transparent sky in Stellarium',
'review.dragHint': 'Drag to look around',
'review.paintHint': 'Paint with your finger',
'review.zoomLabel': 'Zoomed panorama: checkered area is transparent sky, the line is the detected edge',
'review.overviewLabel': 'Whole 360 degree panorama with the zoomed part outlined',
'review.north': 'North offset',
'review.northHint': 'Applies to .hrz and panorama',
'review.rotateLeft': 'Rotate 0.5 degrees left',
'review.rotateRight': 'Rotate 0.5 degrees right',
'review.export': 'Export',
// Export
'export.title': 'Export',
'export.back': 'Back to review',
'export.summary': '{name} · margin {margin}° · north offset {north}°',
'export.ninaTitle': 'NINA custom horizon',
'export.ninaSub': 'Sky edge + safety margin as azimuth / altitude pairs, for target altitude limits',
'export.panoTitle': 'Stellarium panorama',
'export.panoSub': 'Spherical landscape: 360° photo band with transparent sky, 8192 × 2048 PNG',
'export.polyTitle': 'Stellarium outline only',
'export.polySub': 'Polygonal landscape: just the horizon line, no photo',
'export.panoUnavailable': 'Needs a photo survey (not available for imported horizons)',
'export.panoGaps': 'Not all 360° is photographed: gaps are filled dark',
'export.preview': 'Preview',
'export.loading': 'Loading…',
'export.lines': { one: '{count} line · azimuth altitude, {margin}° margin', other: '{count} lines · azimuth altitude, {margin}° margin' },
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: install the .zip under Sky and viewing options › Landscape › Add/remove landscapes.',
'export.rendering': 'Rendering panorama…',
'export.preparing': 'Preparing…',
'export.sharing': 'Sharing…',
'export.saving': 'Saving…',
'export.save': 'Save',
'export.share': { one: 'Share {count} file', other: 'Share {count} files' },
// Save / share results
'files.downloaded': { one: 'Downloaded {name}', other: 'Downloaded {count} files' },
'files.savedAndroid': { one: 'Saved to Downloads: {name}', other: 'Saved {count} files to Downloads' },
'files.savedIos': { one: 'Saved to Files › SkyContour: {name}', other: 'Saved {count} files to Files › SkyContour' },
'files.shared': 'Shared',
'files.shareCancelled': 'Share cancelled',
'files.shareUnsupported': 'This browser cannot share files, so they were downloaded instead.',
// Settings
'settings.title': 'Settings',
'settings.camera': 'Camera',
'settings.fov': 'Field of view',
'settings.fovValue': '{fov}° across the frame',
'settings.fovAssumed': 'Not calibrated: about {fov}° is assumed',
'settings.narrower': 'Narrower',
'settings.wider': 'Wider',
'settings.calibrate': 'Calibrate with the camera',
'settings.reset': 'Reset',
'settings.fovHint': 'The field of view places each photo in the panorama. Calibrate once per phone: turn slowly while the app compares two overlapping views.',
'settings.author': 'Author for Stellarium files',
'settings.authorPlaceholder': 'Your name',
'settings.language': 'Language',
'settings.systemLanguage': 'System default ({name})',
'settings.about': '{app} · horizons for NINA and Stellarium',
// FOV calibration
'calib.title': 'Field of view',
'calib.intro': 'Point at distant detail (trees, roofs), then tap Start and turn slowly sideways.',
'calib.turn': 'Turn the phone slowly to the side ⟷',
'calib.turnAuto': 'Turn the phone slowly to the side ⟷ (finishes by itself)',
'calib.newRef': 'New reference taken: keep turning slowly ⟷',
'calib.noMatch': 'No match: turn slower and aim at distant detail',
'calib.almost': 'Almost there: values still vary, keep turning slowly',
'calib.measuring': 'Measuring… keep turning slowly',
'calib.waiting': 'Waiting for camera and compass…',
'calib.done': 'Done: field of view {fov}° saved.',
'calib.doneButton': 'Done',
'calib.restart': 'Restart measurement',
'calib.start': 'Start',
}
+189
View File
@@ -0,0 +1,189 @@
// Español
export default {
'tab.sites': 'Lugares',
'tab.new': 'Nuevo estudio',
'tab.settings': 'Ajustes',
'compass.n': 'N',
'compass.e': 'E',
'compass.s': 'S',
'compass.w': 'O',
'common.back': 'Atrás',
'common.startCamera': 'Iniciar cámara',
'common.startingCamera': 'Iniciando cámara…',
'common.noLocation': 'Sin ubicación',
'app.engineError': 'No se pudo cargar el motor: {error}',
'welcome.tagline': 'Traza los árboles y tejados alrededor de tu telescopio',
'welcome.formats': 'NINA .HRZ · PAISAJE DE STELLARIUM',
'welcome.start': 'Empezar',
'welcome.sceneLabel': 'Jardín nocturno con una casa, árboles y un telescopio bajo un cielo estrellado; una línea ámbar discontinua sigue el horizonte sobre los tejados y las copas de los árboles',
'sites.subtitle': 'Horizontes artificiales para NINA y Stellarium',
'sites.settings': 'Ajustes',
'sites.count': 'Lugares · {count}',
'sites.emptyTitle': 'Aún no hay lugares',
'sites.emptyHint': 'Colócate donde está tu telescopio e inicia un estudio.',
'sites.emptyHintApp': 'Toca «{tab}» abajo o importa un .hrz de NINA con el botón de arriba.',
'sites.newSurvey': 'Nuevo estudio del horizonte',
'sites.import': 'Importar un .hrz existente',
'sites.importError': 'No se pudo leer {file}: {error}',
'sites.inProgress': 'En curso',
'sites.noHorizon': 'Aún sin horizonte',
'sites.covered': '{deg}° de 360° cubiertos',
'sites.continue': 'Continuar estudio',
'sites.imported': '.hrz importado',
'sites.framesFull': { one: '{count} foto · 360° completos', other: '{count} fotos · 360° completos' },
'sites.framesPartial': { one: '{count} foto · {deg}° cubiertos', other: '{count} fotos · {deg}° cubiertos' },
'sites.defaultName': 'Lugar {n}',
'sites.importedName': 'Horizonte importado',
'setup.title': 'Nuevo estudio',
'setup.siteName': 'Nombre del lugar',
'setup.locating': 'Buscando ubicación…',
'setup.locationHint': 'Se guarda en el paisaje de Stellarium',
'setup.altitudeUnknown': 'Altitud desconocida',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Actualizar',
'setup.noGeo': 'Este navegador no tiene servicio de ubicación',
'setup.geoUnavailable': 'Ubicación no disponible',
'setup.northTitle': 'Norte de la brújula',
'setup.northHint': 'La declinación aún no se aplica: corrige el norte con el desfase en la revisión',
'setup.howTo': 'Cómo capturar',
'setup.skyNotNeeded': 'el cielo no hace falta',
'setup.illustration': 'Gira una vez sobre ti mismo con el teléfono vertical; solo se fotografía una franja alrededor del horizonte',
'setup.step1': 'Colócate donde está el telescopio.',
'setup.step2': 'Sujeta el teléfono en vertical, un poco inclinado por encima del horizonte.',
'setup.step3': 'Gira despacio una vuelta completa. Las fotos se toman solas.',
'setup.start': 'Iniciar captura',
'setup.sensorsError': 'Los sensores de movimiento no están disponibles: {error}',
'setup.cameraError': 'Cámara: {error}',
'capture.openError': 'No se pudo abrir el estudio: {error}',
'capture.saveError': 'No se pudo guardar: {error}',
'capture.close': 'Cerrar estudio',
'capture.undo': 'Repetir la última foto',
'capture.frameOf': 'foto {n} de {total}',
'capture.allFrames': 'las {count} fotos',
'capture.progress': 'Progreso del panorama en 360 grados',
'capture.heading': 'RUMBO',
'capture.tilt': 'INCLINACIÓN',
'capture.covers': 'CUBRE',
'capture.autoOn': 'Auto sí',
'capture.autoOff': 'Auto no',
'capture.shutter': 'Tomar foto',
'capture.finish': 'Terminar',
'capture.topTouch': 'Un obstáculo llega al borde superior en {az}°',
'capture.addHigher': 'Foto más alta',
'capture.hint.compass': 'Esperando la brújula…',
'capture.hint.done': 'Todas las fotos tomadas. Toca Terminar.',
'capture.hint.higher': 'Foto más alta: alinea el punto',
'capture.hint.turnRight': 'Gira a la derecha hasta que el punto entre en el círculo',
'capture.hint.turnLeft': 'Gira a la izquierda hasta que el punto entre en el círculo',
'capture.hint.manual': 'Alinea el punto y toca el disparador',
'capture.hint.tiltUp': 'Inclina el teléfono un poco hacia arriba',
'capture.hint.tiltDown': 'Inclina el teléfono un poco hacia abajo',
'capture.hint.hold': 'Quieto…',
'capture.hint.tap': 'Toca el disparador',
'capture.err.noHeading': 'Aún no hay rumbo de la brújula',
'capture.err.cameraNotReady': 'La cámara no está lista',
'capture.err.encode': 'No se pudo generar el panorama',
'camera.err.https': 'La cámara necesita HTTPS (o localhost).',
'camera.err.noApi': 'Este navegador no tiene acceso a la cámara.',
'camera.err.noPicture': 'La cámara se inició pero no envía imagen.',
'review.title': 'Revisar horizonte',
'review.imported': 'Importado de .hrz',
'review.stitchedFull': { one: '{count} foto unida · 360° completos', other: '{count} fotos unidas · 360° completos' },
'review.stitchedPartial': { one: '{count} foto unida · {deg}° de 360°', other: '{count} fotos unidas · {deg}° de 360°' },
'review.delete': 'Eliminar lugar',
'review.deleteConfirm': '¿Eliminar?',
'review.tabNina': 'Horizonte NINA',
'review.tabPano': 'Panorama',
'review.detecting': 'Detectando el borde del cielo…',
'review.noHorizon': 'Aún sin horizonte: primero toma algunas fotos.',
'review.legendEdge': 'Borde del cielo detectado',
'review.legendHrz': 'Se escribe en el .hrz',
'review.chartLabel': 'Perfil del horizonte: altura de los obstáculos por azimut, con el margen de seguridad discontinuo',
'review.margin': 'Margen de seguridad',
'review.marginHint': 'Mantiene los objetivos de NINA lejos de las copas de los árboles y del error de la brújula',
'review.toolAuto': 'Automático',
'review.toolSky': 'Pintar cielo',
'review.toolGround': 'Pintar suelo',
'review.edits': { one: '{count} corrección', other: '{count} correcciones' },
'review.undoEdit': 'Deshacer última',
'review.clearEdits': 'Volver a automático',
'review.transparentSky': 'Cielo transparente en Stellarium',
'review.dragHint': 'Arrastra para mirar alrededor',
'review.paintHint': 'Pinta con el dedo',
'review.zoomLabel': 'Panorama ampliado: la zona a cuadros es cielo transparente, la línea es el borde detectado',
'review.overviewLabel': 'Panorama completo de 360 grados con la parte ampliada marcada',
'review.north': 'Desfase del norte',
'review.northHint': 'Se aplica al .hrz y al panorama',
'review.rotateLeft': 'Girar 0,5 grados a la izquierda',
'review.rotateRight': 'Girar 0,5 grados a la derecha',
'review.export': 'Exportar',
'export.title': 'Exportar',
'export.back': 'Volver a la revisión',
'export.summary': '{name} · margen {margin}° · desfase del norte {north}°',
'export.ninaTitle': 'Horizonte personalizado NINA',
'export.ninaSub': 'Borde del cielo + margen de seguridad como pares azimut/altura, para límites de altura de los objetivos',
'export.panoTitle': 'Panorama de Stellarium',
'export.panoSub': 'Paisaje esférico: franja fotográfica de 360° con cielo transparente, PNG de 8192 × 2048',
'export.polyTitle': 'Stellarium, solo contorno',
'export.polySub': 'Paisaje poligonal: solo la línea del horizonte, sin foto',
'export.panoUnavailable': 'Requiere un estudio con fotos (no disponible para horizontes importados)',
'export.panoGaps': 'No se han fotografiado los 360°: los huecos se rellenan en oscuro',
'export.preview': 'Vista previa',
'export.loading': 'Cargando…',
'export.lines': { one: '{count} línea · azimut altura, margen {margin}°', other: '{count} líneas · azimut altura, margen {margin}°' },
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: instala el .zip en Opciones de cielo y visualización › Paisaje › Añadir/eliminar paisajes.',
'export.rendering': 'Generando panorama…',
'export.preparing': 'Preparando…',
'export.sharing': 'Compartiendo…',
'export.saving': 'Guardando…',
'export.save': 'Guardar',
'export.share': { one: 'Compartir {count} archivo', other: 'Compartir {count} archivos' },
'files.downloaded': { one: 'Descargado: {name}', other: '{count} archivos descargados' },
'files.savedAndroid': { one: 'Guardado en Descargas: {name}', other: '{count} archivos guardados en Descargas' },
'files.savedIos': { one: 'Guardado en Archivos › SkyContour: {name}', other: '{count} archivos guardados en Archivos › SkyContour' },
'files.shared': 'Compartido',
'files.shareCancelled': 'Se canceló el envío',
'files.shareUnsupported': 'Este navegador no puede compartir archivos, así que se han descargado.',
'settings.title': 'Ajustes',
'settings.camera': 'Cámara',
'settings.fov': 'Campo de visión',
'settings.fovValue': '{fov}° a lo ancho de la imagen',
'settings.fovAssumed': 'Sin calibrar: se suponen unos {fov}°',
'settings.narrower': 'Más estrecho',
'settings.wider': 'Más amplio',
'settings.calibrate': 'Calibrar con la cámara',
'settings.reset': 'Restablecer',
'settings.fovHint': 'El campo de visión sitúa cada foto en el panorama. Calibra una vez por teléfono: gira despacio mientras la app compara dos vistas superpuestas.',
'settings.author': 'Autor en los archivos de Stellarium',
'settings.authorPlaceholder': 'Tu nombre',
'settings.language': 'Idioma',
'settings.systemLanguage': 'Idioma del sistema ({name})',
'settings.about': '{app} · horizontes para NINA y Stellarium',
'calib.title': 'Campo de visión',
'calib.intro': 'Apunta a detalles lejanos (árboles, tejados), toca Iniciar y gira despacio hacia un lado.',
'calib.turn': 'Gira el teléfono despacio hacia un lado ⟷',
'calib.turnAuto': 'Gira el teléfono despacio hacia un lado ⟷ (termina solo)',
'calib.newRef': 'Nueva referencia tomada: sigue girando despacio ⟷',
'calib.noMatch': 'Sin coincidencia: gira más despacio y apunta a detalles lejanos',
'calib.almost': 'Casi listo: los valores aún varían, sigue girando despacio',
'calib.measuring': 'Midiendo… sigue girando despacio',
'calib.waiting': 'Esperando la cámara y la brújula…',
'calib.done': 'Listo: campo de visión de {fov}° guardado.',
'calib.doneButton': 'Listo',
'calib.restart': 'Repetir medición',
'calib.start': 'Iniciar',
}
+189
View File
@@ -0,0 +1,189 @@
// Français
export default {
'tab.sites': 'Sites',
'tab.new': 'Nouveau relevé',
'tab.settings': 'Réglages',
'compass.n': 'N',
'compass.e': 'E',
'compass.s': 'S',
'compass.w': 'O',
'common.back': 'Retour',
'common.startCamera': 'Démarrer la caméra',
'common.startingCamera': 'Démarrage de la caméra…',
'common.noLocation': 'Pas de position',
'app.engineError': 'Impossible de charger le moteur : {error}',
'welcome.tagline': 'Tracez les arbres et les toits autour de votre télescope',
'welcome.formats': 'NINA .HRZ · PAYSAGE STELLARIUM',
'welcome.start': 'Commencer',
'welcome.sceneLabel': 'Jardin de nuit avec une maison, des arbres et un télescope sous un ciel étoilé ; une ligne ambre en pointillés suit l’horizon au-dessus des toits et des arbres',
'sites.subtitle': 'Horizons artificiels pour NINA et Stellarium',
'sites.settings': 'Réglages',
'sites.count': 'Sites · {count}',
'sites.emptyTitle': 'Aucun site pour l’instant',
'sites.emptyHint': 'Placez-vous à l’emplacement de votre télescope et lancez un relevé.',
'sites.emptyHintApp': 'Touchez « {tab} » en bas, ou importez un .hrz NINA avec le bouton en haut.',
'sites.newSurvey': 'Nouveau relevé d’horizon',
'sites.import': 'Importer un .hrz existant',
'sites.importError': 'Impossible de lire {file} : {error}',
'sites.inProgress': 'En cours',
'sites.noHorizon': 'Pas encore d’horizon',
'sites.covered': '{deg}° sur 360° couverts',
'sites.continue': 'Continuer le relevé',
'sites.imported': '.hrz importé',
'sites.framesFull': { one: '{count} photo · 360° complets', other: '{count} photos · 360° complets' },
'sites.framesPartial': { one: '{count} photo · {deg}° couverts', other: '{count} photos · {deg}° couverts' },
'sites.defaultName': 'Site {n}',
'sites.importedName': 'Horizon importé',
'setup.title': 'Nouveau relevé',
'setup.siteName': 'Nom du site',
'setup.locating': 'Recherche de la position…',
'setup.locationHint': 'Inscrite dans le paysage Stellarium',
'setup.altitudeUnknown': 'Altitude inconnue',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Actualiser',
'setup.noGeo': 'Ce navigateur n’a pas de service de localisation',
'setup.geoUnavailable': 'Position indisponible',
'setup.northTitle': 'Nord donné par la boussole',
'setup.northHint': 'La déclinaison n’est pas encore appliquée : corrigez le nord avec le décalage dans la vérification',
'setup.howTo': 'Comment capturer',
'setup.skyNotNeeded': 'ciel inutile',
'setup.illustration': 'Faites un tour sur vous-même en tenant le téléphone droit ; seule une bande autour de l’horizon est photographiée',
'setup.step1': 'Placez-vous à l’emplacement du télescope.',
'setup.step2': 'Tenez le téléphone droit, légèrement incliné au-dessus de l’horizon.',
'setup.step3': 'Faites lentement un tour complet. Les photos se prennent toutes seules.',
'setup.start': 'Lancer la capture',
'setup.sensorsError': 'Capteurs de mouvement indisponibles : {error}',
'setup.cameraError': 'Caméra : {error}',
'capture.openError': 'Impossible d’ouvrir le relevé : {error}',
'capture.saveError': 'Échec de l’enregistrement : {error}',
'capture.close': 'Fermer le relevé',
'capture.undo': 'Reprendre la dernière photo',
'capture.frameOf': 'photo {n} sur {total}',
'capture.allFrames': 'les {count} photos',
'capture.progress': 'Progression du panorama sur 360 degrés',
'capture.heading': 'CAP',
'capture.tilt': 'INCLINAISON',
'capture.covers': 'COUVRE',
'capture.autoOn': 'Auto oui',
'capture.autoOff': 'Auto non',
'capture.shutter': 'Prendre la photo',
'capture.finish': 'Terminer',
'capture.topTouch': 'Un obstacle touche le haut de l’image à {az}°',
'capture.addHigher': 'Photo plus haute',
'capture.hint.compass': 'En attente de la boussole…',
'capture.hint.done': 'Toutes les photos sont prises. Touchez Terminer.',
'capture.hint.higher': 'Photo plus haute : alignez le point',
'capture.hint.turnRight': 'Tournez à droite jusqu’à ce que le point soit dans le cercle',
'capture.hint.turnLeft': 'Tournez à gauche jusqu’à ce que le point soit dans le cercle',
'capture.hint.manual': 'Alignez le point, puis touchez le déclencheur',
'capture.hint.tiltUp': 'Inclinez un peu le téléphone vers le haut',
'capture.hint.tiltDown': 'Inclinez un peu le téléphone vers le bas',
'capture.hint.hold': 'Ne bougez plus…',
'capture.hint.tap': 'Touchez le déclencheur',
'capture.err.noHeading': 'Pas encore de cap de la boussole',
'capture.err.cameraNotReady': 'Caméra pas prête',
'capture.err.encode': 'Impossible de créer le panorama',
'camera.err.https': 'La caméra nécessite HTTPS (ou localhost).',
'camera.err.noApi': 'Ce navigateur n’a pas accès à la caméra.',
'camera.err.noPicture': 'La caméra a démarré mais n’envoie pas d’image.',
'review.title': 'Vérifier l’horizon',
'review.imported': 'Importé depuis un .hrz',
'review.stitchedFull': { one: '{count} photo assemblée · 360° complets', other: '{count} photos assemblées · 360° complets' },
'review.stitchedPartial': { one: '{count} photo assemblée · {deg}° sur 360°', other: '{count} photos assemblées · {deg}° sur 360°' },
'review.delete': 'Supprimer le site',
'review.deleteConfirm': 'Supprimer ?',
'review.tabNina': 'Horizon NINA',
'review.tabPano': 'Panorama',
'review.detecting': 'Détection de la limite du ciel…',
'review.noHorizon': 'Pas encore d’horizon : prenez d’abord quelques photos.',
'review.legendEdge': 'Limite du ciel détectée',
'review.legendHrz': 'Écrit dans le .hrz',
'review.chartLabel': 'Profil d’horizon : hauteur des obstacles selon l’azimut, marge de sécurité en pointillés',
'review.margin': 'Marge de sécurité',
'review.marginHint': 'Tient les cibles NINA à l’écart des cimes des arbres et des erreurs de boussole',
'review.toolAuto': 'Automatique',
'review.toolSky': 'Peindre le ciel',
'review.toolGround': 'Peindre le sol',
'review.edits': { one: '{count} retouche', other: '{count} retouches' },
'review.undoEdit': 'Annuler la dernière',
'review.clearEdits': 'Revenir à l’automatique',
'review.transparentSky': 'Ciel transparent dans Stellarium',
'review.dragHint': 'Faites glisser pour regarder autour',
'review.paintHint': 'Peignez avec le doigt',
'review.zoomLabel': 'Panorama agrandi : la zone en damier est le ciel transparent, la ligne est la limite détectée',
'review.overviewLabel': 'Panorama complet à 360 degrés, partie agrandie encadrée',
'review.north': 'Décalage du nord',
'review.northHint': 'S’applique au .hrz et au panorama',
'review.rotateLeft': 'Tourner de 0,5 degré vers la gauche',
'review.rotateRight': 'Tourner de 0,5 degré vers la droite',
'review.export': 'Exporter',
'export.title': 'Exporter',
'export.back': 'Retour à la vérification',
'export.summary': '{name} · marge {margin}° · décalage du nord {north}°',
'export.ninaTitle': 'Horizon personnalisé NINA',
'export.ninaSub': 'Limite du ciel + marge de sécurité en paires azimut/hauteur, pour les limites de hauteur des cibles',
'export.panoTitle': 'Panorama Stellarium',
'export.panoSub': 'Paysage sphérique : bande photo à 360° avec ciel transparent, PNG 8192 × 2048',
'export.polyTitle': 'Stellarium, contour seul',
'export.polySub': 'Paysage polygonal : seulement la ligne d’horizon, sans photo',
'export.panoUnavailable': 'Nécessite un relevé photo (indisponible pour les horizons importés)',
'export.panoGaps': 'Les 360° ne sont pas tous photographiés : les trous sont remplis en sombre',
'export.preview': 'Aperçu',
'export.loading': 'Chargement…',
'export.lines': { one: '{count} ligne · azimut hauteur, marge {margin}°', other: '{count} lignes · azimut hauteur, marge {margin}°' },
'export.help': 'NINA : Options › General › Astrometry › Custom Horizon. Stellarium : installez le .zip dans Options du ciel et de la vue › Paysage › Ajouter/supprimer des paysages.',
'export.rendering': 'Création du panorama…',
'export.preparing': 'Préparation…',
'export.sharing': 'Partage…',
'export.saving': 'Enregistrement…',
'export.save': 'Enregistrer',
'export.share': { one: 'Partager {count} fichier', other: 'Partager {count} fichiers' },
'files.downloaded': { one: 'Téléchargé : {name}', other: '{count} fichiers téléchargés' },
'files.savedAndroid': { one: 'Enregistré dans Téléchargements : {name}', other: '{count} fichiers enregistrés dans Téléchargements' },
'files.savedIos': { one: 'Enregistré dans Fichiers › SkyContour : {name}', other: '{count} fichiers enregistrés dans Fichiers › SkyContour' },
'files.shared': 'Partagé',
'files.shareCancelled': 'Partage annulé',
'files.shareUnsupported': 'Ce navigateur ne peut pas partager de fichiers, ils ont donc été téléchargés.',
'settings.title': 'Réglages',
'settings.camera': 'Caméra',
'settings.fov': 'Champ de vision',
'settings.fovValue': '{fov}° sur la largeur de l’image',
'settings.fovAssumed': 'Non calibré : environ {fov}° supposés',
'settings.narrower': 'Plus étroit',
'settings.wider': 'Plus large',
'settings.calibrate': 'Calibrer avec la caméra',
'settings.reset': 'Réinitialiser',
'settings.fovHint': 'Le champ de vision place chaque photo dans le panorama. Calibrez une fois par téléphone : tournez lentement pendant que l’app compare deux vues qui se chevauchent.',
'settings.author': 'Auteur dans les fichiers Stellarium',
'settings.authorPlaceholder': 'Votre nom',
'settings.language': 'Langue',
'settings.systemLanguage': 'Langue du système ({name})',
'settings.about': '{app} · horizons pour NINA et Stellarium',
'calib.title': 'Champ de vision',
'calib.intro': 'Visez des détails lointains (arbres, toits), touchez Démarrer et tournez lentement sur le côté.',
'calib.turn': 'Tournez lentement le téléphone sur le côté ⟷',
'calib.turnAuto': 'Tournez lentement le téléphone sur le côté ⟷ (s’arrête tout seul)',
'calib.newRef': 'Nouvelle référence prise : continuez à tourner lentement ⟷',
'calib.noMatch': 'Pas de correspondance : tournez plus lentement et visez des détails lointains',
'calib.almost': 'Presque fini : les valeurs varient encore, continuez à tourner lentement',
'calib.measuring': 'Mesure… continuez à tourner lentement',
'calib.waiting': 'En attente de la caméra et de la boussole…',
'calib.done': 'Terminé : champ de vision de {fov}° enregistré.',
'calib.doneButton': 'Terminé',
'calib.restart': 'Recommencer la mesure',
'calib.start': 'Démarrer',
}
+189
View File
@@ -0,0 +1,189 @@
// Magyar
export default {
'tab.sites': 'Helyszínek',
'tab.new': 'Új felmérés',
'tab.settings': 'Beállítások',
'compass.n': 'É',
'compass.e': 'K',
'compass.s': 'D',
'compass.w': 'Ny',
'common.back': 'Vissza',
'common.startCamera': 'Kamera indítása',
'common.startingCamera': 'Kamera indítása…',
'common.noLocation': 'Nincs helyadat',
'app.engineError': 'Nem sikerült betölteni a motort: {error}',
'welcome.tagline': 'Rajzold körbe a fákat és háztetőket a távcsöved körül',
'welcome.formats': 'NINA .HRZ · STELLARIUM TÁJKÉP',
'welcome.start': 'Kezdjük',
'welcome.sceneLabel': 'Éjszakai kert házzal, fákkal és távcsővel a csillagos ég alatt; szaggatott borostyánszínű vonal követi a horizontot a háztetők és fák fölött',
'sites.subtitle': 'Mesterséges horizontok a NINA-hoz és a Stellariumhoz',
'sites.settings': 'Beállítások',
'sites.count': 'Helyszínek · {count}',
'sites.emptyTitle': 'Még nincs helyszín',
'sites.emptyHint': 'Állj oda, ahol a távcsöved áll, és indíts egy felmérést.',
'sites.emptyHintApp': 'Koppints lent az „{tab}” fülre, vagy importálj egy NINA .hrz fájlt a fenti gombbal.',
'sites.newSurvey': 'Új horizontfelmérés',
'sites.import': 'Meglévő .hrz importálása',
'sites.importError': 'Nem sikerült beolvasni: {file}: {error}',
'sites.inProgress': 'Folyamatban',
'sites.noHorizon': 'Még nincs horizont',
'sites.covered': '360°-ból {deg}° felvéve',
'sites.continue': 'Felmérés folytatása',
'sites.imported': 'Importált .hrz',
'sites.framesFull': { one: '{count} kép · teljes 360°', other: '{count} kép · teljes 360°' },
'sites.framesPartial': { one: '{count} kép · {deg}° felvéve', other: '{count} kép · {deg}° felvéve' },
'sites.defaultName': '{n}. helyszín',
'sites.importedName': 'Importált horizont',
'setup.title': 'Új felmérés',
'setup.siteName': 'Helyszín neve',
'setup.locating': 'Hely meghatározása…',
'setup.locationHint': 'Bekerül a Stellarium tájképbe',
'setup.altitudeUnknown': 'Ismeretlen magasság',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Frissítés',
'setup.noGeo': 'Ebben a böngészőben nincs helymeghatározás',
'setup.geoUnavailable': 'A hely nem érhető el',
'setup.northTitle': 'Észak az iránytűből',
'setup.northHint': 'A deklinációt még nem számolja az app: az északot a Review képernyőn az eltolással igazítsd',
'setup.howTo': 'Így készül a felvétel',
'setup.skyNotNeeded': 'az ég nem kell',
'setup.illustration': 'Fordulj körbe egy helyben, a telefont függőlegesen tartva; csak a horizont körüli sáv kerül a képekre',
'setup.step1': 'Állj oda, ahol a távcső áll.',
'setup.step2': 'Tartsd a telefont függőlegesen, kicsit a horizont fölé döntve.',
'setup.step3': 'Fordulj körbe lassan egyszer. A képek maguktól készülnek.',
'setup.start': 'Felvétel indítása',
'setup.sensorsError': 'A mozgásérzékelők nem érhetők el: {error}',
'setup.cameraError': 'Kamera: {error}',
'capture.openError': 'Nem sikerült megnyitni a felmérést: {error}',
'capture.saveError': 'Nem sikerült menteni: {error}',
'capture.close': 'Felmérés bezárása',
'capture.undo': 'Utolsó kép újra',
'capture.frameOf': '{n}. kép / {total}',
'capture.allFrames': 'mind a {count} kép kész',
'capture.progress': 'A panoráma haladása 360 fokban',
'capture.heading': 'IRÁNY',
'capture.tilt': 'DŐLÉS',
'capture.covers': 'LEFEDÉS',
'capture.autoOn': 'Auto be',
'capture.autoOff': 'Auto ki',
'capture.shutter': 'Kép készítése',
'capture.finish': 'Kész',
'capture.topTouch': 'Az akadály eléri a kép tetejét itt: {az}°',
'capture.addHigher': 'Magasabb kép',
'capture.hint.compass': 'Várakozás az iránytűre…',
'capture.hint.done': 'Minden kép kész. Koppints a Kész gombra.',
'capture.hint.higher': 'Magasabb kép: célozd be a pontot',
'capture.hint.turnRight': 'Fordulj jobbra, amíg a pont a körbe nem ér',
'capture.hint.turnLeft': 'Fordulj balra, amíg a pont a körbe nem ér',
'capture.hint.manual': 'Célozd be a pontot, majd nyomd meg az exponálógombot',
'capture.hint.tiltUp': 'Döntsd kicsit feljebb a telefont',
'capture.hint.tiltDown': 'Döntsd kicsit lejjebb a telefont',
'capture.hint.hold': 'Tartsd mozdulatlanul…',
'capture.hint.tap': 'Nyomd meg az exponálógombot',
'capture.err.noHeading': 'Még nincs iránytűadat',
'capture.err.cameraNotReady': 'A kamera még nem kész',
'capture.err.encode': 'Nem sikerült elkészíteni a panorámát',
'camera.err.https': 'A kamerához HTTPS kell (vagy localhost).',
'camera.err.noApi': 'Ez a böngésző nem fér hozzá a kamerához.',
'camera.err.noPicture': 'A kamera elindult, de nem küld képet.',
'review.title': 'Horizont áttekintése',
'review.imported': '.hrz fájlból importálva',
'review.stitchedFull': { one: '{count} kép összefűzve · teljes 360°', other: '{count} kép összefűzve · teljes 360°' },
'review.stitchedPartial': { one: '{count} kép összefűzve · 360°-ból {deg}°', other: '{count} kép összefűzve · 360°-ból {deg}°' },
'review.delete': 'Helyszín törlése',
'review.deleteConfirm': 'Törlöd?',
'review.tabNina': 'NINA horizont',
'review.tabPano': 'Panoráma',
'review.detecting': 'Az ég határának felismerése…',
'review.noHorizon': 'Még nincs horizont: előbb készíts néhány képet.',
'review.legendEdge': 'Felismert éghatár',
'review.legendHrz': 'A .hrz-be kerül',
'review.chartLabel': 'Horizontprofil: az akadályok magassága azimut szerint, szaggatottan a biztonsági ráhagyással',
'review.margin': 'Biztonsági ráhagyás',
'review.marginHint': 'A NINA célpontjait távol tartja a fák csúcsától és az iránytű hibájától',
'review.toolAuto': 'Automatikus',
'review.toolSky': 'Ég festése',
'review.toolGround': 'Talaj festése',
'review.edits': { one: '{count} javítás', other: '{count} javítás' },
'review.undoEdit': 'Utolsó visszavonása',
'review.clearEdits': 'Vissza az automatikushoz',
'review.transparentSky': 'Átlátszó ég a Stellariumban',
'review.dragHint': 'Húzd a körbenézéshez',
'review.paintHint': 'Fess az ujjaddal',
'review.zoomLabel': 'Nagyított panoráma: a kockás rész az átlátszó ég, a vonal a felismert határ',
'review.overviewLabel': 'A teljes 360 fokos panoráma, a nagyított rész kijelölve',
'review.north': 'Észak-eltolás',
'review.northHint': 'A .hrz-re és a panorámára is vonatkozik',
'review.rotateLeft': 'Forgatás 0,5 fokkal balra',
'review.rotateRight': 'Forgatás 0,5 fokkal jobbra',
'review.export': 'Exportálás',
'export.title': 'Exportálás',
'export.back': 'Vissza az áttekintéshez',
'export.summary': '{name} · ráhagyás {margin}° · észak-eltolás {north}°',
'export.ninaTitle': 'NINA egyéni horizont',
'export.ninaSub': 'Éghatár + biztonsági ráhagyás azimut/magasság párokként, a célpontok magassági korlátjához',
'export.panoTitle': 'Stellarium panoráma',
'export.panoSub': 'Gömbi tájkép: 360°-os fotósáv átlátszó éggel, 8192 × 2048 PNG',
'export.polyTitle': 'Stellarium, csak körvonal',
'export.polySub': 'Poligon tájkép: csak a horizontvonal, fotó nélkül',
'export.panoUnavailable': 'Fotós felmérés kell hozzá (importált horizontnál nem érhető el)',
'export.panoGaps': 'Nincs mind a 360° lefényképezve: a hiányok sötét kitöltést kapnak',
'export.preview': 'Előnézet',
'export.loading': 'Betöltés…',
'export.lines': { one: '{count} sor · azimut magasság, {margin}° ráhagyás', other: '{count} sor · azimut magasság, {margin}° ráhagyás' },
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: a .zip telepítése: Égbolt és nézet beállításai › Tájkép › Tájképek hozzáadása/eltávolítása.',
'export.rendering': 'Panoráma készítése…',
'export.preparing': 'Előkészítés…',
'export.sharing': 'Megosztás…',
'export.saving': 'Mentés…',
'export.save': 'Mentés',
'export.share': { one: '{count} fájl megosztása', other: '{count} fájl megosztása' },
'files.downloaded': { one: 'Letöltve: {name}', other: '{count} fájl letöltve' },
'files.savedAndroid': { one: 'Mentve a Letöltésekbe: {name}', other: '{count} fájl mentve a Letöltésekbe' },
'files.savedIos': { one: 'Mentve: Fájlok › SkyContour: {name}', other: '{count} fájl mentve: Fájlok › SkyContour' },
'files.shared': 'Megosztva',
'files.shareCancelled': 'Megosztás megszakítva',
'files.shareUnsupported': 'Ez a böngésző nem tud fájlt megosztani, ezért letöltöttük őket.',
'settings.title': 'Beállítások',
'settings.camera': 'Kamera',
'settings.fov': 'Látószög',
'settings.fovValue': '{fov}° a kép szélességében',
'settings.fovAssumed': 'Nincs kalibrálva: kb. {fov}° a feltételezett érték',
'settings.narrower': 'Szűkebb',
'settings.wider': 'Szélesebb',
'settings.calibrate': 'Kalibrálás a kamerával',
'settings.reset': 'Alaphelyzet',
'settings.fovHint': 'A látószög alapján kerül minden fotó a helyére a panorámán. Telefononként egyszer kalibráld: fordulj lassan, közben az app összehasonlít két átfedő képet.',
'settings.author': 'Szerző a Stellarium-fájlokban',
'settings.authorPlaceholder': 'A neved',
'settings.language': 'Nyelv',
'settings.systemLanguage': 'Rendszer nyelve ({name})',
'settings.about': '{app} · horizontok a NINA-hoz és a Stellariumhoz',
'calib.title': 'Látószög',
'calib.intro': 'Célozz meg távoli részleteket (fák, tetők), koppints az Indítás gombra, és fordulj lassan oldalra.',
'calib.turn': 'Fordítsd lassan oldalra a telefont ⟷',
'calib.turnAuto': 'Fordítsd lassan oldalra a telefont ⟷ (magától befejeződik)',
'calib.newRef': 'Új referenciakép: fordulj tovább lassan ⟷',
'calib.noMatch': 'Nincs egyezés: fordulj lassabban, és célozz távoli részletekre',
'calib.almost': 'Mindjárt kész: az értékek még ingadoznak, fordulj tovább lassan',
'calib.measuring': 'Mérés… fordulj tovább lassan',
'calib.waiting': 'Várakozás a kamerára és az iránytűre…',
'calib.done': 'Kész: {fov}° látószög elmentve.',
'calib.doneButton': 'Kész',
'calib.restart': 'Mérés újrakezdése',
'calib.start': 'Indítás',
}
+189
View File
@@ -0,0 +1,189 @@
// Italiano
export default {
'tab.sites': 'Luoghi',
'tab.new': 'Nuovo rilievo',
'tab.settings': 'Impostazioni',
'compass.n': 'N',
'compass.e': 'E',
'compass.s': 'S',
'compass.w': 'O',
'common.back': 'Indietro',
'common.startCamera': 'Avvia fotocamera',
'common.startingCamera': 'Avvio della fotocamera…',
'common.noLocation': 'Nessuna posizione',
'app.engineError': 'Impossibile caricare il motore: {error}',
'welcome.tagline': 'Traccia gli alberi e i tetti intorno al tuo telescopio',
'welcome.formats': 'NINA .HRZ · PAESAGGIO STELLARIUM',
'welcome.start': 'Inizia',
'welcome.sceneLabel': 'Giardino notturno con una casa, alberi e un telescopio sotto un cielo stellato; una linea ambra tratteggiata segue l’orizzonte sopra i tetti e le chiome degli alberi',
'sites.subtitle': 'Orizzonti artificiali per NINA e Stellarium',
'sites.settings': 'Impostazioni',
'sites.count': 'Luoghi · {count}',
'sites.emptyTitle': 'Ancora nessun luogo',
'sites.emptyHint': 'Mettiti dove si trova il tuo telescopio e avvia un rilievo.',
'sites.emptyHintApp': 'Tocca «{tab}» in basso oppure importa un .hrz di NINA con il pulsante in alto.',
'sites.newSurvey': 'Nuovo rilievo dell’orizzonte',
'sites.import': 'Importa un .hrz esistente',
'sites.importError': 'Impossibile leggere {file}: {error}',
'sites.inProgress': 'In corso',
'sites.noHorizon': 'Ancora nessun orizzonte',
'sites.covered': '{deg}° di 360° coperti',
'sites.continue': 'Continua il rilievo',
'sites.imported': '.hrz importato',
'sites.framesFull': { one: '{count} foto · 360° completi', other: '{count} foto · 360° completi' },
'sites.framesPartial': { one: '{count} foto · {deg}° coperti', other: '{count} foto · {deg}° coperti' },
'sites.defaultName': 'Luogo {n}',
'sites.importedName': 'Orizzonte importato',
'setup.title': 'Nuovo rilievo',
'setup.siteName': 'Nome del luogo',
'setup.locating': 'Ricerca della posizione…',
'setup.locationHint': 'Viene scritta nel paesaggio di Stellarium',
'setup.altitudeUnknown': 'Altitudine sconosciuta',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Aggiorna',
'setup.noGeo': 'Questo browser non ha il servizio di localizzazione',
'setup.geoUnavailable': 'Posizione non disponibile',
'setup.northTitle': 'Nord dalla bussola',
'setup.northHint': 'La declinazione non è ancora applicata: correggi il nord con lo scostamento nella revisione',
'setup.howTo': 'Come riprendere',
'setup.skyNotNeeded': 'il cielo non serve',
'setup.illustration': 'Fai un giro su te stesso tenendo il telefono in verticale; viene fotografata solo una fascia intorno all’orizzonte',
'setup.step1': 'Mettiti dove si trova il telescopio.',
'setup.step2': 'Tieni il telefono in verticale, leggermente inclinato sopra l’orizzonte.',
'setup.step3': 'Fai lentamente un giro completo. Le foto vengono scattate da sole.',
'setup.start': 'Avvia la ripresa',
'setup.sensorsError': 'Sensori di movimento non disponibili: {error}',
'setup.cameraError': 'Fotocamera: {error}',
'capture.openError': 'Impossibile aprire il rilievo: {error}',
'capture.saveError': 'Salvataggio non riuscito: {error}',
'capture.close': 'Chiudi il rilievo',
'capture.undo': 'Ripeti l’ultima foto',
'capture.frameOf': 'foto {n} di {total}',
'capture.allFrames': 'tutte le {count} foto',
'capture.progress': 'Avanzamento del panorama su 360 gradi',
'capture.heading': 'DIREZIONE',
'capture.tilt': 'INCLINAZIONE',
'capture.covers': 'COPRE',
'capture.autoOn': 'Auto sì',
'capture.autoOff': 'Auto no',
'capture.shutter': 'Scatta',
'capture.finish': 'Fine',
'capture.topTouch': 'Un ostacolo tocca il bordo superiore a {az}°',
'capture.addHigher': 'Foto più alta',
'capture.hint.compass': 'In attesa della bussola…',
'capture.hint.done': 'Tutte le foto scattate. Tocca Fine.',
'capture.hint.higher': 'Foto più alta: allinea il punto',
'capture.hint.turnRight': 'Girati a destra finché il punto è nel cerchio',
'capture.hint.turnLeft': 'Girati a sinistra finché il punto è nel cerchio',
'capture.hint.manual': 'Allinea il punto, poi tocca il pulsante di scatto',
'capture.hint.tiltUp': 'Inclina il telefono un po’ verso l’alto',
'capture.hint.tiltDown': 'Inclina il telefono un po’ verso il basso',
'capture.hint.hold': 'Tieni fermo…',
'capture.hint.tap': 'Tocca il pulsante di scatto',
'capture.err.noHeading': 'Ancora nessuna direzione dalla bussola',
'capture.err.cameraNotReady': 'Fotocamera non pronta',
'capture.err.encode': 'Impossibile creare il panorama',
'camera.err.https': 'La fotocamera richiede HTTPS (o localhost).',
'camera.err.noApi': 'Questo browser non ha accesso alla fotocamera.',
'camera.err.noPicture': 'La fotocamera è avviata ma non invia immagini.',
'review.title': 'Rivedi l’orizzonte',
'review.imported': 'Importato da .hrz',
'review.stitchedFull': { one: '{count} foto unita · 360° completi', other: '{count} foto unite · 360° completi' },
'review.stitchedPartial': { one: '{count} foto unita · {deg}° di 360°', other: '{count} foto unite · {deg}° di 360°' },
'review.delete': 'Elimina il luogo',
'review.deleteConfirm': 'Eliminare?',
'review.tabNina': 'Orizzonte NINA',
'review.tabPano': 'Panorama',
'review.detecting': 'Rilevamento del bordo del cielo…',
'review.noHorizon': 'Ancora nessun orizzonte: scatta prima qualche foto.',
'review.legendEdge': 'Bordo del cielo rilevato',
'review.legendHrz': 'Scritto nel .hrz',
'review.chartLabel': 'Profilo dell’orizzonte: altezza degli ostacoli per azimut, con il margine di sicurezza tratteggiato',
'review.margin': 'Margine di sicurezza',
'review.marginHint': 'Tiene i bersagli di NINA lontani dalle cime degli alberi e dagli errori della bussola',
'review.toolAuto': 'Automatico',
'review.toolSky': 'Dipingi cielo',
'review.toolGround': 'Dipingi suolo',
'review.edits': { one: '{count} correzione', other: '{count} correzioni' },
'review.undoEdit': 'Annulla l’ultima',
'review.clearEdits': 'Torna all’automatico',
'review.transparentSky': 'Cielo trasparente in Stellarium',
'review.dragHint': 'Trascina per guardarti intorno',
'review.paintHint': 'Dipingi con il dito',
'review.zoomLabel': 'Panorama ingrandito: l’area a scacchi è cielo trasparente, la linea è il bordo rilevato',
'review.overviewLabel': 'Panorama completo a 360 gradi con la parte ingrandita evidenziata',
'review.north': 'Scostamento del nord',
'review.northHint': 'Vale per il .hrz e il panorama',
'review.rotateLeft': 'Ruota di 0,5 gradi a sinistra',
'review.rotateRight': 'Ruota di 0,5 gradi a destra',
'review.export': 'Esporta',
'export.title': 'Esporta',
'export.back': 'Torna alla revisione',
'export.summary': '{name} · margine {margin}° · scostamento del nord {north}°',
'export.ninaTitle': 'Orizzonte personalizzato NINA',
'export.ninaSub': 'Bordo del cielo + margine di sicurezza come coppie azimut/altezza, per i limiti di altezza dei bersagli',
'export.panoTitle': 'Panorama Stellarium',
'export.panoSub': 'Paesaggio sferico: fascia fotografica a 360° con cielo trasparente, PNG 8192 × 2048',
'export.polyTitle': 'Stellarium, solo contorno',
'export.polySub': 'Paesaggio poligonale: solo la linea dell’orizzonte, senza foto',
'export.panoUnavailable': 'Richiede un rilievo fotografico (non disponibile per gli orizzonti importati)',
'export.panoGaps': 'Non tutti i 360° sono fotografati: i vuoti vengono riempiti di scuro',
'export.preview': 'Anteprima',
'export.loading': 'Caricamento…',
'export.lines': { one: '{count} riga · azimut altezza, margine {margin}°', other: '{count} righe · azimut altezza, margine {margin}°' },
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: installa lo .zip in Opzioni cielo e visualizzazione › Paesaggio › Aggiungi/rimuovi paesaggi.',
'export.rendering': 'Creazione del panorama…',
'export.preparing': 'Preparazione…',
'export.sharing': 'Condivisione…',
'export.saving': 'Salvataggio…',
'export.save': 'Salva',
'export.share': { one: 'Condividi {count} file', other: 'Condividi {count} file' },
'files.downloaded': { one: 'Scaricato: {name}', other: '{count} file scaricati' },
'files.savedAndroid': { one: 'Salvato in Download: {name}', other: '{count} file salvati in Download' },
'files.savedIos': { one: 'Salvato in File › SkyContour: {name}', other: '{count} file salvati in File › SkyContour' },
'files.shared': 'Condiviso',
'files.shareCancelled': 'Condivisione annullata',
'files.shareUnsupported': 'Questo browser non può condividere file, quindi sono stati scaricati.',
'settings.title': 'Impostazioni',
'settings.camera': 'Fotocamera',
'settings.fov': 'Campo visivo',
'settings.fovValue': '{fov}° sulla larghezza dell’immagine',
'settings.fovAssumed': 'Non calibrato: si assumono circa {fov}°',
'settings.narrower': 'Più stretto',
'settings.wider': 'Più ampio',
'settings.calibrate': 'Calibra con la fotocamera',
'settings.reset': 'Ripristina',
'settings.fovHint': 'Il campo visivo colloca ogni foto nel panorama. Calibra una volta per telefono: girati lentamente mentre l’app confronta due viste sovrapposte.',
'settings.author': 'Autore nei file di Stellarium',
'settings.authorPlaceholder': 'Il tuo nome',
'settings.language': 'Lingua',
'settings.systemLanguage': 'Lingua di sistema ({name})',
'settings.about': '{app} · orizzonti per NINA e Stellarium',
'calib.title': 'Campo visivo',
'calib.intro': 'Inquadra dettagli lontani (alberi, tetti), tocca Avvia e girati lentamente di lato.',
'calib.turn': 'Gira lentamente il telefono di lato ⟷',
'calib.turnAuto': 'Gira lentamente il telefono di lato ⟷ (termina da solo)',
'calib.newRef': 'Nuovo riferimento acquisito: continua a girare lentamente ⟷',
'calib.noMatch': 'Nessuna corrispondenza: gira più lentamente e inquadra dettagli lontani',
'calib.almost': 'Quasi fatto: i valori variano ancora, continua a girare lentamente',
'calib.measuring': 'Misurazione… continua a girare lentamente',
'calib.waiting': 'In attesa di fotocamera e bussola…',
'calib.done': 'Fatto: campo visivo di {fov}° salvato.',
'calib.doneButton': 'Fatto',
'calib.restart': 'Ripeti la misurazione',
'calib.start': 'Avvia',
}
+210
View File
@@ -0,0 +1,210 @@
// Polski (plural categories: one = 1, few = 2–4, 22–24…, many = 0, 5–21…, other = fractions)
export default {
'tab.sites': 'Miejsca',
'tab.new': 'Nowy pomiar',
'tab.settings': 'Ustawienia',
'compass.n': 'Pn',
'compass.e': 'Wsch',
'compass.s': 'Pd',
'compass.w': 'Zach',
'common.back': 'Wstecz',
'common.startCamera': 'Uruchom aparat',
'common.startingCamera': 'Uruchamianie aparatu…',
'common.noLocation': 'Brak lokalizacji',
'app.engineError': 'Nie udało się wczytać silnika: {error}',
'welcome.tagline': 'Obrysuj drzewa i dachy wokół swojego teleskopu',
'welcome.formats': 'NINA .HRZ · KRAJOBRAZ STELLARIUM',
'welcome.start': 'Zaczynamy',
'welcome.sceneLabel': 'Nocny ogród z domem, drzewami i teleskopem pod rozgwieżdżonym niebem; przerywana bursztynowa linia biegnie wzdłuż horyzontu nad dachami i koronami drzew',
'sites.subtitle': 'Sztuczne horyzonty dla NINA i Stellarium',
'sites.settings': 'Ustawienia',
'sites.count': 'Miejsca · {count}',
'sites.emptyTitle': 'Brak miejsc',
'sites.emptyHint': 'Stań tam, gdzie stoi twój teleskop, i rozpocznij pomiar.',
'sites.emptyHintApp': 'Dotknij „{tab}” na dole albo zaimportuj plik .hrz z NINA przyciskiem u góry.',
'sites.newSurvey': 'Nowy pomiar horyzontu',
'sites.import': 'Importuj istniejący .hrz',
'sites.importError': 'Nie udało się odczytać {file}: {error}',
'sites.inProgress': 'W toku',
'sites.noHorizon': 'Brak horyzontu',
'sites.covered': 'Pokryto {deg}° z 360°',
'sites.continue': 'Kontynuuj pomiar',
'sites.imported': 'Zaimportowany .hrz',
'sites.framesFull': {
one: '{count} zdjęcie · pełne 360°', few: '{count} zdjęcia · pełne 360°',
many: '{count} zdjęć · pełne 360°', other: '{count} zdjęcia · pełne 360°',
},
'sites.framesPartial': {
one: '{count} zdjęcie · pokryto {deg}°', few: '{count} zdjęcia · pokryto {deg}°',
many: '{count} zdjęć · pokryto {deg}°', other: '{count} zdjęcia · pokryto {deg}°',
},
'sites.defaultName': 'Miejsce {n}',
'sites.importedName': 'Zaimportowany horyzont',
'setup.title': 'Nowy pomiar',
'setup.siteName': 'Nazwa miejsca',
'setup.locating': 'Ustalanie lokalizacji…',
'setup.locationHint': 'Zapisywana w krajobrazie Stellarium',
'setup.altitudeUnknown': 'Nieznana wysokość',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Odśwież',
'setup.noGeo': 'Ta przeglądarka nie ma usługi lokalizacji',
'setup.geoUnavailable': 'Lokalizacja niedostępna',
'setup.northTitle': 'Północ z kompasu',
'setup.northHint': 'Deklinacja nie jest jeszcze uwzględniana: popraw północ przesunięciem w przeglądzie',
'setup.howTo': 'Jak wykonać pomiar',
'setup.skyNotNeeded': 'niebo zbędne',
'setup.illustration': 'Obróć się raz w miejscu, trzymając telefon pionowo; fotografowany jest tylko pas wokół horyzontu',
'setup.step1': 'Stań tam, gdzie stoi teleskop.',
'setup.step2': 'Trzymaj telefon pionowo, lekko pochylony nad horyzont.',
'setup.step3': 'Powoli obróć się raz dookoła. Zdjęcia wykonują się same.',
'setup.start': 'Rozpocznij nagrywanie',
'setup.sensorsError': 'Czujniki ruchu są niedostępne: {error}',
'setup.cameraError': 'Aparat: {error}',
'capture.openError': 'Nie udało się otworzyć pomiaru: {error}',
'capture.saveError': 'Nie udało się zapisać: {error}',
'capture.close': 'Zamknij pomiar',
'capture.undo': 'Powtórz ostatnie zdjęcie',
'capture.frameOf': 'zdjęcie {n} z {total}',
'capture.allFrames': 'wszystkie zdjęcia ({count})',
'capture.progress': 'Postęp panoramy na 360 stopniach',
'capture.heading': 'KIERUNEK',
'capture.tilt': 'POCHYLENIE',
'capture.covers': 'ZAKRES',
'capture.autoOn': 'Auto wł.',
'capture.autoOff': 'Auto wył.',
'capture.shutter': 'Zrób zdjęcie',
'capture.finish': 'Gotowe',
'capture.topTouch': 'Przeszkoda sięga górnej krawędzi kadru przy {az}°',
'capture.addHigher': 'Wyższe zdjęcie',
'capture.hint.compass': 'Czekam na kompas…',
'capture.hint.done': 'Wszystkie zdjęcia gotowe. Dotknij Gotowe.',
'capture.hint.higher': 'Wyższe zdjęcie: wyceluj w punkt',
'capture.hint.turnRight': 'Obracaj się w prawo, aż punkt znajdzie się w okręgu',
'capture.hint.turnLeft': 'Obracaj się w lewo, aż punkt znajdzie się w okręgu',
'capture.hint.manual': 'Wyceluj w punkt, a potem dotknij migawki',
'capture.hint.tiltUp': 'Pochyl telefon trochę w górę',
'capture.hint.tiltDown': 'Pochyl telefon trochę w dół',
'capture.hint.hold': 'Nie ruszaj się…',
'capture.hint.tap': 'Dotknij migawki',
'capture.err.noHeading': 'Brak jeszcze kierunku z kompasu',
'capture.err.cameraNotReady': 'Aparat nie jest gotowy',
'capture.err.encode': 'Nie udało się utworzyć panoramy',
'camera.err.https': 'Aparat wymaga HTTPS (lub localhost).',
'camera.err.noApi': 'Ta przeglądarka nie ma dostępu do aparatu.',
'camera.err.noPicture': 'Aparat działa, ale nie przesyła obrazu.',
'review.title': 'Przegląd horyzontu',
'review.imported': 'Zaimportowano z .hrz',
'review.stitchedFull': {
one: '{count} zdjęcie połączone · pełne 360°', few: '{count} zdjęcia połączone · pełne 360°',
many: '{count} zdjęć połączonych · pełne 360°', other: '{count} zdjęcia połączone · pełne 360°',
},
'review.stitchedPartial': {
one: '{count} zdjęcie połączone · {deg}° z 360°', few: '{count} zdjęcia połączone · {deg}° z 360°',
many: '{count} zdjęć połączonych · {deg}° z 360°', other: '{count} zdjęcia połączone · {deg}° z 360°',
},
'review.delete': 'Usuń miejsce',
'review.deleteConfirm': 'Usunąć?',
'review.tabNina': 'Horyzont NINA',
'review.tabPano': 'Panorama',
'review.detecting': 'Wykrywanie granicy nieba…',
'review.noHorizon': 'Brak horyzontu: najpierw zrób kilka zdjęć.',
'review.legendEdge': 'Wykryta granica nieba',
'review.legendHrz': 'Zapisywane w .hrz',
'review.chartLabel': 'Profil horyzontu: wysokość przeszkód według azymutu, margines bezpieczeństwa przerywaną linią',
'review.margin': 'Margines bezpieczeństwa',
'review.marginHint': 'Trzyma cele NINA z dala od wierzchołków drzew i błędów kompasu',
'review.toolAuto': 'Automatycznie',
'review.toolSky': 'Maluj niebo',
'review.toolGround': 'Maluj grunt',
'review.edits': { one: '{count} poprawka', few: '{count} poprawki', many: '{count} poprawek', other: '{count} poprawki' },
'review.undoEdit': 'Cofnij ostatnią',
'review.clearEdits': 'Wróć do automatycznego',
'review.transparentSky': 'Przezroczyste niebo w Stellarium',
'review.dragHint': 'Przeciągnij, aby się rozejrzeć',
'review.paintHint': 'Maluj palcem',
'review.zoomLabel': 'Powiększona panorama: obszar w kratkę to przezroczyste niebo, linia to wykryta granica',
'review.overviewLabel': 'Cała panorama 360 stopni z zaznaczoną powiększoną częścią',
'review.north': 'Przesunięcie północy',
'review.northHint': 'Dotyczy .hrz i panoramy',
'review.rotateLeft': 'Obróć o 0,5 stopnia w lewo',
'review.rotateRight': 'Obróć o 0,5 stopnia w prawo',
'review.export': 'Eksportuj',
'export.title': 'Eksport',
'export.back': 'Wróć do przeglądu',
'export.summary': '{name} · margines {margin}° · przesunięcie północy {north}°',
'export.ninaTitle': 'Własny horyzont NINA',
'export.ninaSub': 'Granica nieba + margines bezpieczeństwa jako pary azymut/wysokość, do limitów wysokości celów',
'export.panoTitle': 'Panorama Stellarium',
'export.panoSub': 'Krajobraz sferyczny: pas zdjęć 360° z przezroczystym niebem, PNG 8192 × 2048',
'export.polyTitle': 'Stellarium, tylko kontur',
'export.polySub': 'Krajobraz wielokątny: tylko linia horyzontu, bez zdjęcia',
'export.panoUnavailable': 'Wymaga pomiaru ze zdjęciami (niedostępne dla zaimportowanych horyzontów)',
'export.panoGaps': 'Nie sfotografowano pełnych 360°: luki są wypełniane ciemnym kolorem',
'export.preview': 'Podgląd',
'export.loading': 'Wczytywanie…',
'export.lines': {
one: '{count} wiersz · azymut wysokość, margines {margin}°', few: '{count} wiersze · azymut wysokość, margines {margin}°',
many: '{count} wierszy · azymut wysokość, margines {margin}°', other: '{count} wiersza · azymut wysokość, margines {margin}°',
},
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: zainstaluj .zip w Opcje nieba i widoku › Krajobraz › Dodaj/usuń krajobrazy.',
'export.rendering': 'Tworzenie panoramy…',
'export.preparing': 'Przygotowywanie…',
'export.sharing': 'Udostępnianie…',
'export.saving': 'Zapisywanie…',
'export.save': 'Zapisz',
'export.share': { one: 'Udostępnij {count} plik', few: 'Udostępnij {count} pliki', many: 'Udostępnij {count} plików', other: 'Udostępnij {count} pliku' },
'files.downloaded': { one: 'Pobrano: {name}', few: 'Pobrano {count} pliki', many: 'Pobrano {count} plików', other: 'Pobrano {count} pliku' },
'files.savedAndroid': {
one: 'Zapisano w Pobranych: {name}', few: 'Zapisano {count} pliki w Pobranych',
many: 'Zapisano {count} plików w Pobranych', other: 'Zapisano {count} pliku w Pobranych',
},
'files.savedIos': {
one: 'Zapisano w Pliki › SkyContour: {name}', few: 'Zapisano {count} pliki w Pliki › SkyContour',
many: 'Zapisano {count} plików w Pliki › SkyContour', other: 'Zapisano {count} pliku w Pliki › SkyContour',
},
'files.shared': 'Udostępniono',
'files.shareCancelled': 'Anulowano udostępnianie',
'files.shareUnsupported': 'Ta przeglądarka nie potrafi udostępniać plików, więc zostały pobrane.',
'settings.title': 'Ustawienia',
'settings.camera': 'Aparat',
'settings.fov': 'Pole widzenia',
'settings.fovValue': '{fov}° na szerokość kadru',
'settings.fovAssumed': 'Nie skalibrowano: przyjęto około {fov}°',
'settings.narrower': 'Węższe',
'settings.wider': 'Szersze',
'settings.calibrate': 'Kalibruj aparatem',
'settings.reset': 'Resetuj',
'settings.fovHint': 'Pole widzenia ustala położenie każdego zdjęcia w panoramie. Skalibruj raz dla każdego telefonu: obracaj się powoli, a aplikacja porówna dwa nakładające się widoki.',
'settings.author': 'Autor w plikach Stellarium',
'settings.authorPlaceholder': 'Twoje imię',
'settings.language': 'Język',
'settings.systemLanguage': 'Język systemu ({name})',
'settings.about': '{app} · horyzonty dla NINA i Stellarium',
'calib.title': 'Pole widzenia',
'calib.intro': 'Wyceluj w odległe szczegóły (drzewa, dachy), dotknij Start i powoli obracaj się w bok.',
'calib.turn': 'Powoli obracaj telefon w bok ⟷',
'calib.turnAuto': 'Powoli obracaj telefon w bok ⟷ (zakończy się samo)',
'calib.newRef': 'Nowy punkt odniesienia: obracaj się dalej powoli ⟷',
'calib.noMatch': 'Brak dopasowania: obracaj się wolniej i celuj w odległe szczegóły',
'calib.almost': 'Prawie gotowe: wartości jeszcze się wahają, obracaj się dalej powoli',
'calib.measuring': 'Pomiar… obracaj się dalej powoli',
'calib.waiting': 'Czekam na aparat i kompas…',
'calib.done': 'Gotowe: zapisano pole widzenia {fov}°.',
'calib.doneButton': 'Gotowe',
'calib.restart': 'Powtórz pomiar',
'calib.start': 'Start',
}
+210
View File
@@ -0,0 +1,210 @@
// Slovenčina (plural categories: one = 1, few = 2–4, many = fractions, other = 0, 5+)
export default {
'tab.sites': 'Miesta',
'tab.new': 'Nové meranie',
'tab.settings': 'Nastavenia',
'compass.n': 'S',
'compass.e': 'V',
'compass.s': 'J',
'compass.w': 'Z',
'common.back': 'Späť',
'common.startCamera': 'Spustiť kameru',
'common.startingCamera': 'Spúšťa sa kamera…',
'common.noLocation': 'Bez polohy',
'app.engineError': 'Nepodarilo sa načítať výpočtové jadro: {error}',
'welcome.tagline': 'Obkresli stromy a strechy okolo svojho ďalekohľadu',
'welcome.formats': 'NINA .HRZ · KRAJINA STELLARIUM',
'welcome.start': 'Začať',
'welcome.sceneLabel': 'Nočná záhrada s domom, stromami a ďalekohľadom pod hviezdnou oblohou; prerušovaná jantárová čiara sleduje horizont nad strechami a korunami stromov',
'sites.subtitle': 'Umelé horizonty pre NINA a Stellarium',
'sites.settings': 'Nastavenia',
'sites.count': 'Miesta · {count}',
'sites.emptyTitle': 'Zatiaľ žiadne miesta',
'sites.emptyHint': 'Postav sa tam, kde stojí tvoj ďalekohľad, a začni meranie.',
'sites.emptyHintApp': 'Ťukni dole na „{tab}“ alebo importuj súbor .hrz z NINA tlačidlom hore.',
'sites.newSurvey': 'Nové meranie horizontu',
'sites.import': 'Importovať existujúci .hrz',
'sites.importError': 'Súbor {file} sa nepodarilo načítať: {error}',
'sites.inProgress': 'Prebieha',
'sites.noHorizon': 'Zatiaľ bez horizontu',
'sites.covered': 'Pokrytých {deg}° z 360°',
'sites.continue': 'Pokračovať v meraní',
'sites.imported': 'Importovaný .hrz',
'sites.framesFull': {
one: '{count} snímka · celých 360°', few: '{count} snímky · celých 360°',
many: '{count} snímky · celých 360°', other: '{count} snímok · celých 360°',
},
'sites.framesPartial': {
one: '{count} snímka · pokrytých {deg}°', few: '{count} snímky · pokrytých {deg}°',
many: '{count} snímky · pokrytých {deg}°', other: '{count} snímok · pokrytých {deg}°',
},
'sites.defaultName': 'Miesto {n}',
'sites.importedName': 'Importovaný horizont',
'setup.title': 'Nové meranie',
'setup.siteName': 'Názov miesta',
'setup.locating': 'Zisťuje sa poloha…',
'setup.locationHint': 'Zapíše sa do krajiny Stellarium',
'setup.altitudeUnknown': 'Neznáma nadmorská výška',
'setup.elevation': '{m} m',
'setup.gps': 'GPS ±{m} m',
'setup.refresh': 'Obnoviť',
'setup.noGeo': 'Tento prehliadač nemá lokalizačnú službu',
'setup.geoUnavailable': 'Poloha nie je dostupná',
'setup.northTitle': 'Sever z kompasu',
'setup.northHint': 'Deklinácia sa zatiaľ neuplatňuje: sever oprav posunom pri kontrole',
'setup.howTo': 'Ako snímať',
'setup.skyNotNeeded': 'obloha nie je potrebná',
'setup.illustration': 'Raz sa otoč na mieste a drž telefón zvisle; fotí sa len pás okolo horizontu',
'setup.step1': 'Postav sa tam, kde stojí ďalekohľad.',
'setup.step2': 'Drž telefón zvisle, mierne naklonený nad horizont.',
'setup.step3': 'Pomaly sa raz otoč dokola. Snímky sa robia samé.',
'setup.start': 'Spustiť snímanie',
'setup.sensorsError': 'Snímače pohybu nie sú dostupné: {error}',
'setup.cameraError': 'Kamera: {error}',
'capture.openError': 'Meranie sa nepodarilo otvoriť: {error}',
'capture.saveError': 'Nepodarilo sa uložiť: {error}',
'capture.close': 'Zavrieť meranie',
'capture.undo': 'Zopakovať poslednú snímku',
'capture.frameOf': 'snímka {n} z {total}',
'capture.allFrames': 'všetky snímky ({count})',
'capture.progress': 'Priebeh panorámy v 360 stupňoch',
'capture.heading': 'SMER',
'capture.tilt': 'NÁKLON',
'capture.covers': 'ROZSAH',
'capture.autoOn': 'Auto zap.',
'capture.autoOff': 'Auto vyp.',
'capture.shutter': 'Odfotiť',
'capture.finish': 'Hotovo',
'capture.topTouch': 'Prekážka siaha po horný okraj snímky pri {az}°',
'capture.addHigher': 'Vyššia snímka',
'capture.hint.compass': 'Čaká sa na kompas…',
'capture.hint.done': 'Všetky snímky sú hotové. Ťukni na Hotovo.',
'capture.hint.higher': 'Vyššia snímka: zamier na bod',
'capture.hint.turnRight': 'Otáčaj sa doprava, kým bod nebude v kruhu',
'capture.hint.turnLeft': 'Otáčaj sa doľava, kým bod nebude v kruhu',
'capture.hint.manual': 'Zamier na bod a potom ťukni na spúšť',
'capture.hint.tiltUp': 'Nakloň telefón trochu nahor',
'capture.hint.tiltDown': 'Nakloň telefón trochu nadol',
'capture.hint.hold': 'Drž bez pohybu…',
'capture.hint.tap': 'Ťukni na spúšť',
'capture.err.noHeading': 'Kompas zatiaľ neudáva smer',
'capture.err.cameraNotReady': 'Kamera nie je pripravená',
'capture.err.encode': 'Panorámu sa nepodarilo vytvoriť',
'camera.err.https': 'Kamera potrebuje HTTPS (alebo localhost).',
'camera.err.noApi': 'Tento prehliadač nemá prístup ku kamere.',
'camera.err.noPicture': 'Kamera sa spustila, ale neposiela obraz.',
'review.title': 'Kontrola horizontu',
'review.imported': 'Importované z .hrz',
'review.stitchedFull': {
one: '{count} spojená snímka · celých 360°', few: '{count} spojené snímky · celých 360°',
many: '{count} spojenej snímky · celých 360°', other: '{count} spojených snímok · celých 360°',
},
'review.stitchedPartial': {
one: '{count} spojená snímka · {deg}° z 360°', few: '{count} spojené snímky · {deg}° z 360°',
many: '{count} spojenej snímky · {deg}° z 360°', other: '{count} spojených snímok · {deg}° z 360°',
},
'review.delete': 'Odstrániť miesto',
'review.deleteConfirm': 'Odstrániť?',
'review.tabNina': 'Horizont NINA',
'review.tabPano': 'Panoráma',
'review.detecting': 'Rozpoznáva sa okraj oblohy…',
'review.noHorizon': 'Zatiaľ bez horizontu: najprv urob niekoľko snímok.',
'review.legendEdge': 'Rozpoznaný okraj oblohy',
'review.legendHrz': 'Zapisuje sa do .hrz',
'review.chartLabel': 'Profil horizontu: výška prekážok podľa azimutu, bezpečnostná rezerva prerušovane',
'review.margin': 'Bezpečnostná rezerva',
'review.marginHint': 'Drží ciele NINA mimo vrcholov stromov a chýb kompasu',
'review.toolAuto': 'Automaticky',
'review.toolSky': 'Maľovať oblohu',
'review.toolGround': 'Maľovať terén',
'review.edits': { one: '{count} úprava', few: '{count} úpravy', many: '{count} úpravy', other: '{count} úprav' },
'review.undoEdit': 'Vrátiť poslednú',
'review.clearEdits': 'Späť na automatiku',
'review.transparentSky': 'Priehľadná obloha v Stellariu',
'review.dragHint': 'Ťahaním sa rozhliadneš',
'review.paintHint': 'Maľuj prstom',
'review.zoomLabel': 'Zväčšená panoráma: kockovaná plocha je priehľadná obloha, čiara je rozpoznaný okraj',
'review.overviewLabel': 'Celá 360-stupňová panoráma so zvýraznenou zväčšenou časťou',
'review.north': 'Posun severu',
'review.northHint': 'Platí pre .hrz aj panorámu',
'review.rotateLeft': 'Otočiť o 0,5 stupňa doľava',
'review.rotateRight': 'Otočiť o 0,5 stupňa doprava',
'review.export': 'Exportovať',
'export.title': 'Export',
'export.back': 'Späť na kontrolu',
'export.summary': '{name} · rezerva {margin}° · posun severu {north}°',
'export.ninaTitle': 'Vlastný horizont NINA',
'export.ninaSub': 'Okraj oblohy + bezpečnostná rezerva ako dvojice azimut/výška, pre výškové limity cieľov',
'export.panoTitle': 'Panoráma Stellarium',
'export.panoSub': 'Sférická krajina: 360° pás fotiek s priehľadnou oblohou, PNG 8192 × 2048',
'export.polyTitle': 'Stellarium, len obrys',
'export.polySub': 'Polygónová krajina: len čiara horizontu, bez fotky',
'export.panoUnavailable': 'Vyžaduje meranie s fotkami (pre importované horizonty nie je dostupné)',
'export.panoGaps': 'Nie je nafotených všetkých 360°: medzery sa vyplnia tmavou',
'export.preview': 'Náhľad',
'export.loading': 'Načítava sa…',
'export.lines': {
one: '{count} riadok · azimut výška, rezerva {margin}°', few: '{count} riadky · azimut výška, rezerva {margin}°',
many: '{count} riadka · azimut výška, rezerva {margin}°', other: '{count} riadkov · azimut výška, rezerva {margin}°',
},
'export.help': 'NINA: Options › General › Astrometry › Custom Horizon. Stellarium: .zip nainštaluj v Možnosti oblohy a zobrazenia › Krajina › Pridať/odstrániť krajiny.',
'export.rendering': 'Vytvára sa panoráma…',
'export.preparing': 'Pripravuje sa…',
'export.sharing': 'Zdieľa sa…',
'export.saving': 'Ukladá sa…',
'export.save': 'Uložiť',
'export.share': { one: 'Zdieľať {count} súbor', few: 'Zdieľať {count} súbory', many: 'Zdieľať {count} súboru', other: 'Zdieľať {count} súborov' },
'files.downloaded': { one: 'Stiahnuté: {name}', few: 'Stiahnuté {count} súbory', many: 'Stiahnuté {count} súboru', other: 'Stiahnutých {count} súborov' },
'files.savedAndroid': {
one: 'Uložené do Stiahnutých: {name}', few: '{count} súbory uložené do Stiahnutých',
many: '{count} súboru uloženého do Stiahnutých', other: '{count} súborov uložených do Stiahnutých',
},
'files.savedIos': {
one: 'Uložené do Súbory › SkyContour: {name}', few: '{count} súbory uložené do Súbory › SkyContour',
many: '{count} súboru uloženého do Súbory › SkyContour', other: '{count} súborov uložených do Súbory › SkyContour',
},
'files.shared': 'Zdieľané',
'files.shareCancelled': 'Zdieľanie zrušené',
'files.shareUnsupported': 'Tento prehliadač nevie zdieľať súbory, preto sa stiahli.',
'settings.title': 'Nastavenia',
'settings.camera': 'Kamera',
'settings.fov': 'Zorné pole',
'settings.fovValue': '{fov}° na šírku snímky',
'settings.fovAssumed': 'Nekalibrované: predpokladá sa asi {fov}°',
'settings.narrower': 'Užšie',
'settings.wider': 'Širšie',
'settings.calibrate': 'Kalibrovať kamerou',
'settings.reset': 'Obnoviť predvolené',
'settings.fovHint': 'Zorné pole určuje, kam sa každá fotka umiestni v panoráme. Kalibruj raz pre každý telefón: pomaly sa otáčaj, kým aplikácia porovná dva prekrývajúce sa pohľady.',
'settings.author': 'Autor v súboroch Stellarium',
'settings.authorPlaceholder': 'Tvoje meno',
'settings.language': 'Jazyk',
'settings.systemLanguage': 'Jazyk systému ({name})',
'settings.about': '{app} · horizonty pre NINA a Stellarium',
'calib.title': 'Zorné pole',
'calib.intro': 'Zamier na vzdialené detaily (stromy, strechy), ťukni na Spustiť a pomaly sa otáčaj do strany.',
'calib.turn': 'Pomaly otáčaj telefón do strany ⟷',
'calib.turnAuto': 'Pomaly otáčaj telefón do strany ⟷ (skončí samo)',
'calib.newRef': 'Nová referencia: otáčaj sa ďalej pomaly ⟷',
'calib.noMatch': 'Bez zhody: otáčaj sa pomalšie a mier na vzdialené detaily',
'calib.almost': 'Takmer hotovo: hodnoty ešte kolíšu, otáčaj sa ďalej pomaly',
'calib.measuring': 'Meria sa… otáčaj sa ďalej pomaly',
'calib.waiting': 'Čaká sa na kameru a kompas…',
'calib.done': 'Hotovo: zorné pole {fov}° uložené.',
'calib.doneButton': 'Hotovo',
'calib.restart': 'Zopakovať meranie',
'calib.start': 'Spustiť',
}
+2
View File
@@ -0,0 +1,2 @@
// App name: shown in the UI and written into exported files.
export const APP_NAME = 'SkyContour'
+140
View File
@@ -0,0 +1,140 @@
// Camera stream + orientation sensors (both via the wasm glue), FOV helpers,
// and a desktop simulator (?sim) that feeds synthetic orientation events.
import { loadWasm, wasm } from './wasm'
import { t } from '../i18n'
const VIDEO_ID = 'sfz-video'
export const DEFAULT_FOV = 65 // landscape-frame horizontal FOV fallback
let video = null
/** Hidden <video> that receives the camera stream (preview is drawn to canvases). */
export function getVideo() {
if (!video) {
video = document.createElement('video')
video.id = VIDEO_ID
video.autoplay = true
video.muted = true
video.playsInline = true
video.setAttribute('playsinline', '')
Object.assign(video.style, {
position: 'fixed', left: '0', top: '0', width: '2px', height: '2px',
opacity: '0', pointerEvents: 'none',
})
document.body.appendChild(video)
}
return video
}
export function cameraLive() {
const v = getVideo()
const s = v.srcObject
return !!(s && s.getVideoTracks && s.getVideoTracks().some((t) => t.readyState === 'live'))
}
export async function startCamera() {
if (!window.isSecureContext) throw new Error(t('camera.err.https'))
if (!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia)) {
throw new Error(t('camera.err.noApi'))
}
await loadWasm()
const v = getVideo()
if (!cameraLive()) await wasm().init_camera(VIDEO_ID)
await v.play().catch(() => {})
const t0 = performance.now()
while (v.videoWidth === 0 && performance.now() - t0 < 5000) {
await new Promise((r) => setTimeout(r, 50))
}
if (v.videoWidth === 0) throw new Error(t('camera.err.noPicture'))
}
export function stopCamera() {
if (!video || !video.srcObject) return
video.srcObject.getTracks().forEach((t) => t.stop())
video.srcObject = null
}
// ---------- Orientation ----------
const SIM = typeof location !== 'undefined' && new URLSearchParams(location.search).has('sim')
let oriPromise = null
/** Start the sensors. Call it straight from a tap: iOS asks for permission. */
export function startOrientation() {
if (!oriPromise) {
const go = (m) => m.start_orientation('sfz-none-heading', 'sfz-none-tilt')
let p
try {
p = go(wasm()) // synchronous call keeps the user gesture on iOS
} catch {
p = loadWasm().then(go)
}
oriPromise = p.then(() => { if (SIM) startSim() }).catch((e) => {
oriPromise = null
throw e
})
}
return oriPromise
}
export function orientationStarted() {
return !!oriPromise
}
/** {heading: 0–360 or −1, tilt: deg above horizon, ori: {alpha,beta,gamma}|null} */
export function readOrientation() {
const m = wasm()
const a = m.get_orientation()
return {
heading: m.get_heading(),
tilt: m.get_tilt(),
ori: a.length === 3 ? { alpha: a[0], beta: a[1], gamma: a[2] } : null,
}
}
export function screenAngle() {
return (window.screen && window.screen.orientation && window.screen.orientation.angle) || 0
}
// ---------- FOV ----------
/** Portrait frames are narrower: 65° landscape → ~39° at 9:16. */
export function defaultFovFor(w, h) {
if (w >= h) return DEFAULT_FOV
const half = (DEFAULT_FOV / 2) * Math.PI / 180
return 2 * Math.atan(Math.tan(half) * (w / h)) * 180 / Math.PI
}
/** Horizontal/vertical FOV of the current frames (calibrated value wins). */
export function frameFov(calibrated, w, h) {
const hfov = calibrated != null ? calibrated : defaultFovFor(w || 9, h || 16)
const vfov = 2 * Math.atan(Math.tan((hfov / 2) * Math.PI / 180) * ((h || 16) / (w || 9))) * 180 / Math.PI
return { hfov, vfov }
}
// ---------- Desktop simulator (?sim) ----------
// Arrow keys turn/tilt; ?sim=sweep turns slowly on its own so auto-capture
// can be exercised with Chrome's fake camera.
function startSim() {
const sweep = new URLSearchParams(location.search).get('sim') === 'sweep'
const st = { heading: 0, tilt: 10 }
window.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') st.heading -= 3
if (e.key === 'ArrowRight') st.heading += 3
if (e.key === 'ArrowUp') st.tilt += 1
if (e.key === 'ArrowDown') st.tilt -= 1
})
let last = performance.now()
setInterval(() => {
const now = performance.now()
if (sweep) st.heading += 4 * (now - last) / 1000 // 4°/s: slow enough to count as steady
last = now
const heading = ((st.heading % 360) + 360) % 360
const ev = new DeviceOrientationEvent('deviceorientationabsolute', {
alpha: (360 - heading) % 360, beta: 90 + st.tilt, gamma: 0, absolute: true,
})
window.dispatchEvent(ev)
}, 50)
}
+94
View File
@@ -0,0 +1,94 @@
// Saving and sharing export files. In the Flutter shell the native side does
// it (WebView has no downloads/Web Share); in a browser we use Web Share
// with files where supported, otherwise plain downloads.
import { t } from '../i18n'
export const EMBEDDED = typeof window !== 'undefined' && !!window.flutter_inappwebview
/** Call a handler of the Flutter shell; resolves undefined in a browser or on failure. */
export function nativeCall(name, ...args) {
if (!EMBEDDED || !window.flutter_inappwebview.callHandler) return Promise.resolve(undefined)
return window.flutter_inappwebview.callHandler(name, ...args).catch(() => undefined)
}
function toBlob(f) {
return f.data instanceof Blob ? f.data : new Blob([f.data], { type: f.mime })
}
function blobToBase64(blob) {
return new Promise((resolve, reject) => {
const r = new FileReader()
r.onload = () => resolve(String(r.result).split(',')[1] || '')
r.onerror = () => reject(r.error)
r.readAsDataURL(blob)
})
}
async function callNative(handler, files) {
const payload = await Promise.all(
files.map(async (f) => ({ name: f.name, mime: f.mime, base64: await blobToBase64(toBlob(f)) })),
)
return window.flutter_inappwebview.callHandler(handler, payload)
}
function download(f) {
const url = URL.createObjectURL(toBlob(f))
const a = document.createElement('a')
a.href = url
a.download = f.name
document.body.appendChild(a)
a.click()
a.remove()
setTimeout(() => URL.revokeObjectURL(url), 15000)
}
// Results are { ok, text }: ok = the files reached the user (not cancelled),
// text = a localized status line. The app shell answers with plain data
// ({saved: [names], platform} / {status}) so every message is translated here.
/** files: [{name, mime, data: Uint8Array|string|Blob}] */
export async function saveFiles(files) {
if (EMBEDDED) {
const res = await callNative('saveFiles', files)
const names = (res && Array.isArray(res.saved) && res.saved.length) ? res.saved : files.map((f) => f.name)
const key = res && res.platform === 'ios' ? 'files.savedIos' : 'files.savedAndroid'
return { ok: true, text: t(key, { count: names.length, name: names[0] }) }
}
for (let i = 0; i < files.length; i++) {
download(files[i])
// Browsers drop rapid consecutive downloads; space them out.
if (i < files.length - 1) await new Promise((r) => setTimeout(r, 400))
}
return { ok: true, text: t('files.downloaded', { count: files.length, name: files[0].name }) }
}
export async function shareFiles(files, title) {
if (EMBEDDED) {
const res = await callNative('shareFiles', files)
const cancelled = res && res.status === 'cancelled'
return { ok: !cancelled, text: t(cancelled ? 'files.shareCancelled' : 'files.shared') }
}
const fileObjs = files.map((f) => new File([toBlob(f)], f.name, { type: f.mime }))
if (navigator.canShare && navigator.canShare({ files: fileObjs })) {
try {
await navigator.share({ files: fileObjs, title })
return { ok: true, text: t('files.shared') }
} catch (e) {
if (e && e.name === 'AbortError') return { ok: false, text: t('files.shareCancelled') }
throw e
}
}
const saved = await saveFiles(files)
return { ok: true, text: `${saved.text} ${t('files.shareUnsupported')}` }
}
/** Read a user-picked file as text. */
export function readText(file) {
return new Promise((resolve, reject) => {
const r = new FileReader()
r.onload = () => resolve(String(r.result))
r.onerror = () => reject(r.error)
r.readAsText(file)
})
}
+55
View File
@@ -0,0 +1,55 @@
// Number formatting per docs/SPEC.md: degrees with one decimal, true minus
// sign "−" in the UI (files use ASCII "-"). Decimal separator follows the UI
// language; digits stay Latin everywhere.
import { formatNumber, t } from '../i18n'
const MINUS = '−'
function fixed(v, digits) {
return formatNumber(Math.abs(v), digits)
}
/** "+2.0", "−3.5", "0.0" (locale decimal separator) */
export function signed(v, digits = 1) {
const s = fixed(v, digits)
if (Number(Math.abs(v).toFixed(digits)) === 0) return s
return (v > 0 ? '+' : MINUS) + s
}
/** Plain number with UI minus sign. */
export function num(v, digits = 0) {
const s = fixed(v, digits)
return (v < 0 && Number(Math.abs(v).toFixed(digits)) !== 0 ? MINUS : '') + s
}
// Coordinates keep a "." and four decimals (they read like data), with the
// localized hemisphere letter. The trailing LRM keeps "47.5° ش · 19.0° ق"
// in order when the letter is right-to-left (Arabic).
const LRM = '\u200E'
export function latText(lat) {
return `${Math.abs(lat).toFixed(4)}° ${lat >= 0 ? t('compass.n') : t('compass.s')}${LRM}`
}
export function lonText(lon) {
return `${Math.abs(lon).toFixed(4)}° ${lon >= 0 ? t('compass.e') : t('compass.w')}${LRM}`
}
export function coordsText(loc) {
if (!loc) return t('common.noLocation')
const parts = [latText(loc.latDeg), lonText(loc.lonDeg)]
if (loc.elevM != null) parts.push(t('setup.elevation', { m: Math.round(loc.elevM) }))
return parts.join(' · ')
}
/** File-name-safe slug: "Kiskőrös dűlő" → "kiskoros-dulo". */
export function slug(name) {
const s = (name || '')
.normalize('NFD')
.replace(/[̀-ͯ]/g, '')
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
return s || 'horizon'
}
+46
View File
@@ -0,0 +1,46 @@
// Small JS helpers for 360-value horizon profiles (index = azimuth degree).
// The exported files are always produced by the Rust core; these are only
// for drawing.
export function sample(profile, az) {
const a = ((az % 360) + 360) % 360
const i0 = Math.floor(a)
const t = a - i0
const v0 = profile[i0 % 360]
const v1 = profile[(i0 + 1) % 360]
return v0 + (v1 - v0) * t
}
/** Same convention as the core: a feature at A moves to A + offset. */
export function rotate(profile, offsetDeg) {
if (!offsetDeg) return profile
return Array.from({ length: 360 }, (_, i) => sample(profile, i - offsetDeg))
}
export function maxAlt(profile) {
let m = -Infinity
for (const v of profile) m = Math.max(m, v)
return m
}
/** Runs of consecutive covered degrees: [[start, endExclusive], …] on 0..360 (no wrap merge). */
export function coveredRuns(coverage) {
const runs = []
let start = -1
for (let d = 0; d <= 360; d++) {
const on = d < 360 && (!coverage || coverage[d])
if (on && start < 0) start = d
if (!on && start >= 0) {
runs.push([start, d])
start = -1
}
}
return runs
}
export function coveredDegrees(coverage) {
if (!coverage) return 360
let n = 0
for (const c of coverage) if (c) n++
return n
}
+101
View File
@@ -0,0 +1,101 @@
// Persistence: site list + settings in localStorage, stitched strips (PNG
// blobs, a few MB each) in IndexedDB.
const SITES_KEY = 'sfz.sites.v1'
const SETTINGS_KEY = 'sfz.settings.v1'
const LEGACY_FOV_KEY = 'sfzenith_fov'
export const CELLS = 24
export function newSite(name) {
const now = new Date().toISOString()
return {
id: 's' + Date.now().toString(36) + Math.random().toString(36).slice(2, 7),
name,
createdAt: now,
updatedAt: now,
source: 'survey', // or 'import'
location: null, // {latDeg, lonDeg, elevM, accuracyM}
status: 'in-progress', // or 'complete'
frames: 0,
cells: Array(CELLS).fill(false),
profile: null, // 360 altitudes, measured frame
coverage: null, // 360 × 0/1
marginDeg: 2,
northOffsetDeg: 0,
edits: [],
exported: { nina: false, stellarium: false },
hasStrip: false,
}
}
export function loadSites() {
try {
const v = JSON.parse(localStorage.getItem(SITES_KEY) || '[]')
return Array.isArray(v) ? v : []
} catch {
return []
}
}
export function saveSites(sites) {
try {
localStorage.setItem(SITES_KEY, JSON.stringify(sites))
} catch (e) {
console.warn('Could not save sites', e)
}
}
export function loadSettings() {
let s = {}
try {
s = JSON.parse(localStorage.getItem(SETTINGS_KEY) || '{}') || {}
} catch {
s = {}
}
if (s.fovDeg === undefined) {
const legacy = parseFloat(localStorage.getItem(LEGACY_FOV_KEY))
s.fovDeg = legacy >= 20 && legacy <= 120 ? legacy : null
}
return { fovDeg: null, autoCapture: true, author: '', welcomed: false, ...s }
}
export function saveSettings(s) {
try {
localStorage.setItem(SETTINGS_KEY, JSON.stringify(s))
} catch (e) {
console.warn('Could not save settings', e)
}
}
// ---------- IndexedDB: strips ----------
let dbPromise = null
function db() {
if (!dbPromise) {
dbPromise = new Promise((resolve, reject) => {
const req = indexedDB.open('sfzenith', 1)
req.onupgradeneeded = () => req.result.createObjectStore('strips')
req.onsuccess = () => resolve(req.result)
req.onerror = () => reject(req.error)
})
}
return dbPromise
}
function tx(mode, fn) {
return db().then(
(d) =>
new Promise((resolve, reject) => {
const t = d.transaction('strips', mode)
const req = fn(t.objectStore('strips'))
t.oncomplete = () => resolve(req && req.result)
t.onerror = () => reject(t.error)
}),
)
}
export const saveStrip = (id, blob) => tx('readwrite', (s) => s.put(blob, id))
export const loadStrip = (id) => tx('readonly', (s) => s.get(id))
export const deleteStrip = (id) => tx('readwrite', (s) => s.delete(id))
+227
View File
@@ -0,0 +1,227 @@
// Capture session: the stitched equirectangular strip of one site, the frames
// taken in this run (for undo), and a cached wasm HorizonSurvey (sky mask +
// profile) built from the strip.
import { wasm } from './wasm'
import { loadStrip, saveStrip, CELLS } from './store'
import { readOrientation, screenAngle } from './camera'
import { t } from '../i18n'
// Strip: 360° × (+90 … −30°) at equal degrees per pixel.
export const STRIP_W = 3072
export const STRIP_H = 1024
export const STRIP_TOP = 90
export const STRIP_BOTTOM = -30
export const CELL_DEG = 360 / CELLS // 15°
export const TARGET_TILT = 10
export const HIGH_TILT = 35
const FRAME_MAX_SIDE = 800 // strip has ~8.5 px/deg; larger frames add nothing
let session = null
let surveyCache = null
function mkCanvas(w, h) {
const c = document.createElement('canvas')
c.width = w
c.height = h
return c
}
export function circularDiff(a, b) {
const d = Math.abs(a - b) % 360
return Math.min(d, 360 - d)
}
export function wrap180(d) {
const x = ((d % 360) + 360) % 360
return x > 180 ? x - 360 : x
}
export function cellOf(az) {
return Math.floor((((az % 360) + 360) % 360) / CELL_DEG) % CELLS
}
/** Open (or reuse) the session of a site; loads its saved strip. */
export async function openSession(site) {
if (session && session.siteId === site.id) return session
const canvas = mkCanvas(STRIP_W, STRIP_H)
canvas.getContext('2d', { willReadFrequently: true })
let base = null
if (site.hasStrip) {
const blob = await loadStrip(site.id).catch(() => null)
if (blob) {
const bmp = await createImageBitmap(blob)
base = mkCanvas(STRIP_W, STRIP_H)
base.getContext('2d').drawImage(bmp, 0, 0, STRIP_W, STRIP_H)
if (bmp.close) bmp.close()
}
}
session = {
siteId: site.id,
canvas,
base,
baseCells: [...(site.cells || Array(CELLS).fill(false))],
baseFrames: site.frames || 0,
captures: [],
version: 1,
dirty: false,
}
redraw(session)
return session
}
export function closeSession(siteId) {
if (session && (!siteId || session.siteId === siteId)) session = null
if (surveyCache && (!siteId || surveyCache.siteId === siteId)) {
surveyCache.survey.free()
surveyCache = null
}
}
export function sessionCells(s) {
const cells = [...s.baseCells]
for (const c of s.captures) cells[c.cell] = true
return cells
}
export function sessionFrames(s) {
return s.baseFrames + s.captures.length
}
function redraw(s) {
const ctx = s.canvas.getContext('2d')
ctx.clearRect(0, 0, STRIP_W, STRIP_H)
if (s.base) ctx.drawImage(s.base, 0, 0)
for (const c of s.captures) if (c.patch) drawPatch(ctx, c.patch)
}
function drawPatch(ctx, patch) {
ctx.drawImage(patch.canvas, patch.x, patch.y)
if (patch.x + patch.w > STRIP_W) ctx.drawImage(patch.canvas, patch.x - STRIP_W, patch.y)
}
function grabFrame(video) {
const scale = Math.min(1, FRAME_MAX_SIDE / Math.max(video.videoWidth, video.videoHeight))
const c = mkCanvas(Math.round(video.videoWidth * scale), Math.round(video.videoHeight * scale))
c.getContext('2d', { willReadFrequently: true }).drawImage(video, 0, 0, c.width, c.height)
return c
}
function project(cap, frame, hfov) {
const img = frame.getContext('2d', { willReadFrequently: true }).getImageData(0, 0, frame.width, frame.height)
const rgba = new Uint8Array(img.data.buffer, img.data.byteOffset, img.data.byteLength)
const patch = wasm().project_frame(
rgba, frame.width, frame.height,
cap.ori.alpha, cap.ori.beta, cap.ori.gamma, cap.screenAngle,
hfov, STRIP_W, STRIP_H, STRIP_BOTTOM, STRIP_TOP,
)
if (!patch) return null
const geom = { x: patch.x, y: patch.y, w: patch.w, h: patch.h }
const bytes = patch.take_data()
patch.free()
const pc = mkCanvas(geom.w, geom.h)
pc.getContext('2d').putImageData(
new ImageData(new Uint8ClampedArray(bytes.buffer, bytes.byteOffset, bytes.byteLength), geom.w, geom.h),
0, 0,
)
return { canvas: pc, ...geom }
}
/** Take a frame at the current orientation and stitch it into the strip. */
export function captureFrame(s, video, hfov, { high = false } = {}) {
const { heading, tilt, ori: raw } = readOrientation()
if (heading < 0) throw new Error(t('capture.err.noHeading'))
if (!video.videoWidth) throw new Error(t('capture.err.cameraNotReady'))
// Trust the raw orientation triple only when it agrees with the smoothed
// compass the user sees; otherwise synthesize it from heading/tilt.
const sAngle = screenAngle()
let ori = raw
if (ori) {
const azel = wasm().orientation_az_el(ori.alpha, ori.beta, ori.gamma, sAngle)
if (circularDiff(azel[0], heading) > 15 || Math.abs(azel[1] - tilt) > 15) ori = null
}
let capAngle = sAngle
if (!ori) {
ori = { alpha: (360 - heading) % 360, beta: 90 + tilt, gamma: 0 }
capAngle = 0
}
const frame = grabFrame(video)
const cap = { heading, tilt, ori, screenAngle: capAngle, cell: cellOf(heading), high, hfov }
cap.patch = project(cap, frame, hfov)
s.captures.push(cap)
if (cap.patch) drawPatch(s.canvas.getContext('2d'), cap.patch)
s.version++
s.dirty = true
return cap
}
/** Remove the last frame of this run. Frames from earlier runs are baked into the saved strip. */
export function undoLast(s) {
if (!s.captures.length) return false
s.captures.pop()
redraw(s)
s.version++
s.dirty = true
return true
}
/** Save the strip as PNG if it changed. Saves run one after another, so an
* older strip can never overwrite a newer one. Resolves true if it saved. */
export function persistSession(s) {
const run = async () => {
if (!s.dirty) return false
s.dirty = false
const blob = await new Promise((r) => s.canvas.toBlob(r, 'image/png'))
if (!blob) {
s.dirty = true
throw new Error(t('capture.err.encode'))
}
await saveStrip(s.siteId, blob)
return true
}
const p = (s.saving || Promise.resolve()).catch(() => {}).then(run)
s.saving = p
return p
}
/** wasm HorizonSurvey for the session's current strip (cached per version). */
export function horizonSurvey(s) {
if (surveyCache && surveyCache.siteId === s.siteId && surveyCache.version === s.version) {
return surveyCache.survey
}
if (surveyCache) surveyCache.survey.free()
const img = s.canvas.getContext('2d', { willReadFrequently: true }).getImageData(0, 0, STRIP_W, STRIP_H)
const rgba = new Uint8Array(img.data.buffer, img.data.byteOffset, img.data.byteLength)
const survey = new (wasm().HorizonSurvey)(rgba, STRIP_W, STRIP_H, STRIP_TOP, STRIP_BOTTOM)
surveyCache = { siteId: s.siteId, version: s.version, survey }
return survey
}
/** Review brush strokes ({mode, radiusDeg, points:[[az,alt]…]}) → flat dabs for the core. */
export function flattenEdits(strokes) {
const out = []
for (const st of strokes || []) {
for (const [az, alt] of st.points) out.push({ mode: st.mode, azDeg: az, altDeg: alt, radiusDeg: st.radiusDeg })
}
return out
}
/** Draw the strip between two altitudes into a canvas (scaled to fit). */
export function drawStripBand(s, target, topAlt, bottomAlt, x0Deg = 0, spanDeg = 360) {
const ctx = target.getContext('2d')
const pxDeg = STRIP_H / (STRIP_TOP - STRIP_BOTTOM)
const sy = (STRIP_TOP - topAlt) * pxDeg
const sh = (topAlt - bottomAlt) * pxDeg
const sx = (((x0Deg % 360) + 360) % 360) / 360 * STRIP_W
const sw = spanDeg / 360 * STRIP_W
const scaleX = target.width / sw
const first = Math.min(sw, STRIP_W - sx)
ctx.drawImage(s.canvas, sx, sy, first, sh, 0, 0, first * scaleX, target.height)
if (first < sw) {
ctx.drawImage(s.canvas, 0, sy, sw - first, sh, first * scaleX, 0, (sw - first) * scaleX, target.height)
}
}
+38
View File
@@ -0,0 +1,38 @@
// Single shared instance of the Rust/wasm module (wasm/pkg).
let mod = null
let loading = null
export function loadWasm() {
if (mod) return Promise.resolve(mod)
if (!loading) {
loading = import('../../../pkg/rust_panorama_wasm.js').then(async (m) => {
await m.default()
mod = m
return m
})
}
return loading
}
/** The loaded module; throws if loadWasm() has not finished yet. */
export function wasm() {
if (!mod) throw new Error('WASM module not loaded yet')
return mod
}
export function wasmReady() {
return !!mod
}
/** wasm-bindgen errors are often plain strings or JsValues: make them readable. */
export function errText(e) {
if (e == null) return 'unknown error'
if (typeof e === 'string') return e
if (e.message) return e.message
try {
const s = String(e)
return s === '[object Object]' ? JSON.stringify(e) : s
} catch {
return 'unknown error'
}
}
+16
View File
@@ -0,0 +1,16 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import '@fontsource/barlow/400.css'
import '@fontsource/barlow/500.css'
import '@fontsource/barlow/600.css'
import '@fontsource/barlow/700.css'
import '@fontsource/ibm-plex-mono/400.css'
import '@fontsource/ibm-plex-mono/500.css'
import './styles.css'
import App from './App.jsx'
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>,
)
+167
View File
@@ -0,0 +1,167 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { IconBack, IconCamera } from '../components/Icons'
import { getVideo, startCamera, stopCamera, startOrientation, orientationStarted, readOrientation } from '../lib/camera'
import { circularDiff } from '../lib/survey'
import { wasm, errText } from '../lib/wasm'
import { num } from '../lib/format'
import { t } from '../i18n'
// Live FOV calibration: compare the view against a reference frame while the
// user turns; finish by itself once the estimates agree.
const TICK_MS = 400
const MIN_DIFF = 2 // ° of rotation needed to measure
const MAX_DIFF = 30 // ° beyond which a new reference is taken
const KEEP = 12
const TARGET = 10
const MAX_SPREAD = 4 // ° spread of the middle half = converged
function frameToRgba(video, targetW = 640) {
const scale = Math.min(1, targetW / video.videoWidth)
const w = Math.round(video.videoWidth * scale)
const h = Math.round(video.videoHeight * scale)
const c = document.createElement('canvas')
c.width = w
c.height = h
const ctx = c.getContext('2d', { willReadFrequently: true })
ctx.drawImage(video, 0, 0, w, h)
const d = ctx.getImageData(0, 0, w, h).data
return { data: new Uint8Array(d.buffer, d.byteOffset, d.byteLength), w, h }
}
export default function Calibrate({ onSettingsChange, onBack }) {
const previewRef = useRef(null)
const refShot = useRef(null)
const estimates = useRef([])
const timer = useRef(null)
const [cam, setCam] = useState({ state: 'starting', error: '' })
const [phase, setPhase] = useState('ready') // ready | measuring | done
const [live, setLive] = useState(null)
const [progress, setProgress] = useState(0)
const [msg, setMsg] = useState(() => t('calib.intro'))
const boot = useCallback(async () => {
try {
if (!orientationStarted()) await startOrientation()
await startCamera()
setCam({ state: 'live', error: '' })
} catch (e) {
setCam({ state: 'error', error: errText(e) })
}
}, [])
useEffect(() => {
// boot() is async and only sets state after awaiting the devices.
// eslint-disable-next-line react-hooks/set-state-in-effect
boot()
return () => {
if (timer.current) clearInterval(timer.current)
stopCamera()
}
}, [boot])
useEffect(() => {
if (cam.state !== 'live') return
const video = getVideo()
let raf = 0
const loop = () => {
raf = requestAnimationFrame(loop)
const c = previewRef.current
if (!c || !video.videoWidth) return
if (c.width !== video.videoWidth) { c.width = video.videoWidth; c.height = video.videoHeight }
c.getContext('2d').drawImage(video, 0, 0)
}
raf = requestAnimationFrame(loop)
return () => cancelAnimationFrame(raf)
}, [cam.state])
const tick = useCallback(() => {
const video = getVideo()
const ref = refShot.current
if (!ref || !video.videoWidth) return
const { heading } = readOrientation()
if (heading < 0) return
const diff = circularDiff(ref.heading, heading)
if (diff < MIN_DIFF) { setMsg(t('calib.turn')); return }
if (diff > MAX_DIFF) {
refShot.current = { heading, ...frameToRgba(video) }
setMsg(t('calib.newRef'))
return
}
const cur = frameToRgba(video)
const est = wasm().calculate_fov(ref.data, ref.w, ref.h, cur.data, cur.w, cur.h, heading - ref.heading)
if (est <= 0) { setMsg(t('calib.noMatch')); return }
const list = estimates.current
list.push(est)
if (list.length > KEEP) list.shift()
const sorted = [...list].sort((a, b) => a - b)
const median = sorted[Math.floor(sorted.length / 2)]
setLive(median)
setProgress(Math.min(1, list.length / TARGET))
if (list.length >= TARGET) {
const lo = sorted[Math.floor(sorted.length * 0.25)]
const hi = sorted[Math.floor(sorted.length * 0.75)]
if (hi - lo <= MAX_SPREAD) {
clearInterval(timer.current)
timer.current = null
const fov = Math.round(median * 10) / 10
onSettingsChange({ fovDeg: fov })
setPhase('done')
setMsg(t('calib.done', { fov: num(fov, 1) }))
return
}
setMsg(t('calib.almost'))
return
}
setMsg(t('calib.measuring'))
}, [onSettingsChange])
const start = () => {
const video = getVideo()
const { heading } = readOrientation()
if (!video.videoWidth || heading < 0) { setMsg(t('calib.waiting')); return }
refShot.current = { heading, ...frameToRgba(video) }
estimates.current = []
setLive(null)
setProgress(0)
setPhase('measuring')
setMsg(t('calib.turnAuto'))
if (timer.current) clearInterval(timer.current)
timer.current = setInterval(tick, TICK_MS)
}
return (
<div className="capture">
<div className="cap-view">
<canvas ref={previewRef} className="cap-preview" />
<div className="cap-top">
<button className="icon-btn" aria-label={t('common.back')} onClick={onBack}><IconBack className="flip-rtl" /></button>
</div>
{cam.state !== 'live' && (
<div className="cap-start">
{cam.state === 'error' ? (
<>
<span>{cam.error}</span>
<button className="btn btn-primary" style={{ padding: '0 24px' }} onClick={() => { setCam({ state: 'starting', error: '' }); boot() }}><IconCamera /> {t('common.startCamera')}</button>
</>
) : <span className="muted">{t('common.startingCamera')}</span>}
</div>
)}
</div>
<div className="calib-panel">
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
<span style={{ fontSize: 17, fontWeight: 700 }}>{t('calib.title')}</span>
<span className="mono" style={{ fontSize: 20, color: 'var(--info)' }}>{live != null ? `≈ ${num(live, 1)}°` : '—'}</span>
</div>
<div className="calib-bar"><div style={{ width: `${Math.round(progress * 100)}%` }} /></div>
<span style={{ fontSize: 14, color: 'var(--text2)', minHeight: 40 }}>{msg}</span>
{phase === 'done' ? (
<button className="btn btn-primary" onClick={onBack}>{t('calib.doneButton')}</button>
) : (
<button className="btn btn-primary" onClick={start} disabled={cam.state !== 'live'}>
{phase === 'measuring' ? t('calib.restart') : t('calib.start')}
</button>
)}
</div>
</div>
)
}
+492
View File
@@ -0,0 +1,492 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { IconClose, IconUndo, IconChevronRight, IconCamera } from '../components/Icons'
import { CompassLabels } from '../components/Charts'
import {
getVideo, startCamera, stopCamera, startOrientation, orientationStarted, readOrientation, frameFov,
} from '../lib/camera'
import {
openSession, captureFrame, undoLast, persistSession, sessionCells, sessionFrames, horizonSurvey,
drawStripBand, circularDiff, wrap180, cellOf, CELL_DEG, TARGET_TILT, HIGH_TILT,
} from '../lib/survey'
import { CELLS } from '../lib/store'
import { num, signed } from '../lib/format'
import { wasmReady, errText } from '../lib/wasm'
import { EMBEDDED, nativeCall } from '../lib/files'
import { t } from '../i18n'
// Auto-shutter (docs/ARCHITECTURE.md): on target within these limits and
// steady for HOLD_MS.
const AZ_TOL = 2
const TILT_TOL = 5
const MAX_SPEED = 5 // °/s
const HOLD_MS = 300
const COOLDOWN_MS = 1200
const THUMB_TOP = 42
const THUMB_BOTTOM = -22
function cellTarget(c) {
return { az: c * CELL_DEG + CELL_DEG / 2, tilt: TARGET_TILT, cell: c, high: false }
}
/** Next frame to take: a pending higher shot, else the next empty cell clockwise. */
function nextTarget(cells, anchorCell, heading, high) {
if (high) return { az: high.az, tilt: HIGH_TILT, cell: cellOf(high.az), high: true }
if (cells.every(Boolean)) return null
let anchor = anchorCell
if (anchor == null) {
if (heading < 0) return null
const here = cellOf(heading)
if (!cells[here]) return cellTarget(here)
anchor = here
}
for (let k = 1; k <= CELLS; k++) {
const c = (anchor + k) % CELLS
if (!cells[c]) return cellTarget(c)
}
return null
}
export default function Capture({ site, settings, onSettingsChange, onSiteChange, onClose, onFinish, onRegisterBack }) {
const viewRef = useRef(null)
const previewRef = useRef(null)
const thumbRef = useRef(null)
const dotRef = useRef(null)
const leaderRef = useRef(null)
const horizonRef = useRef(null)
const horizonLabelRef = useRef(null)
const headingRef = useRef(null)
const tiltRef = useRef(null)
const coversRef = useRef(null)
const [session, setSession] = useState(null)
const [cam, setCam] = useState({ state: 'starting', error: '' })
const [hint, setHint] = useState(() => t('common.startingCamera'))
const [, setTick] = useState(0)
const [warn, setWarn] = useState(null) // {az}
const [high, setHigh] = useState(null) // {az}
const [flash, setFlash] = useState(false)
const [leaving, setLeaving] = useState(false)
const sessionRef = useRef(null)
const settingsRef = useRef(settings)
const highRef = useRef(null)
const targetCellRef = useRef(-1)
const lastShotRef = useRef(0)
const shootRef = useRef(() => {})
const onSiteChangeRef = useRef(onSiteChange)
useEffect(() => {
settingsRef.current = settings
highRef.current = high
onSiteChangeRef.current = onSiteChange
})
// ---------- session + camera lifecycle ----------
useEffect(() => {
let alive = true
openSession(site)
.then((s) => {
if (!alive) return
sessionRef.current = s
setSession(s)
})
.catch((e) => setCam({ state: 'error', error: t('capture.openError', { error: errText(e) }) }))
return () => { alive = false }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [site.id])
const boot = useCallback(async () => {
try {
if (!orientationStarted()) await startOrientation()
await startCamera()
setCam({ state: 'live', error: '' })
} catch (e) {
setCam({ state: 'error', error: errText(e) })
}
}, [])
useEffect(() => {
boot()
return () => stopCamera()
}, [boot])
// Keep the screen on while capturing (the app shell does it natively).
useEffect(() => {
if (EMBEDDED) {
nativeCall('keepAwake', true)
return () => { nativeCall('keepAwake', false) }
}
let lock = null
const request = async () => {
try {
if (navigator.wakeLock) lock = await navigator.wakeLock.request('screen')
} catch { /* not supported or denied */ }
}
request()
const onVis = () => { if (document.visibilityState === 'visible') request() }
document.addEventListener('visibilitychange', onVis)
return () => {
document.removeEventListener('visibilitychange', onVis)
if (lock) lock.release().catch(() => {})
}
}, [])
// ---------- progress strip ----------
const drawThumb = useCallback(() => {
const s = sessionRef.current
const c = thumbRef.current
if (!s || !c || !c.clientWidth) return
const dpr = window.devicePixelRatio || 1
const w = Math.round(c.clientWidth * dpr)
const h = Math.round(40 * dpr)
if (c.width !== w || c.height !== h) {
c.width = w
c.height = h
}
const ctx = c.getContext('2d')
ctx.fillStyle = '#1A2130'
ctx.fillRect(0, 0, w, h)
drawStripBand(s, c, THUMB_TOP, THUMB_BOTTOM)
ctx.strokeStyle = 'rgba(10, 13, 19, 0.6)'
ctx.lineWidth = dpr
for (let i = 1; i < CELLS; i++) {
const x = Math.round((i / CELLS) * w) + 0.5
ctx.beginPath()
ctx.moveTo(x, 0)
ctx.lineTo(x, h)
ctx.stroke()
}
const tc = targetCellRef.current
if (tc >= 0) {
ctx.strokeStyle = '#F5B544'
ctx.lineWidth = 2 * dpr
ctx.strokeRect((tc / CELLS) * w + dpr, dpr, w / CELLS - 2 * dpr, h - 2 * dpr)
}
}, [])
useEffect(() => { drawThumb() }, [session, drawThumb])
// ---------- capture actions ----------
const afterChange = useCallback((s) => {
setTick((t) => t + 1)
drawThumb()
onSiteChangeRef.current({ frames: sessionFrames(s), cells: sessionCells(s) })
persistSession(s)
.then((saved) => { if (saved) onSiteChangeRef.current({ hasStrip: true }) })
.catch((e) => setHint(t('capture.saveError', { error: errText(e) })))
}, [drawThumb])
const checkTopTouch = useCallback((s, cap) => {
if (cap.high) return
try {
const touch = horizonSurvey(s).top_touch()
const half = Math.floor(cap.hfov / 2)
const h0 = Math.round(cap.heading)
let best = null
let run = 0
let start = 0
for (let k = -half; k <= half; k++) {
if (touch[(h0 + k + 720) % 360]) {
if (!run) start = k
run++
if (run >= 2 && (!best || run > best.len)) best = { len: run, az: h0 + start + (run - 1) / 2 }
} else {
run = 0
}
}
if (best && sessionRef.current === s) setWarn({ az: ((Math.round(best.az) % 360) + 360) % 360 })
} catch (e) {
console.warn('top-touch check failed', e)
}
}, [])
const shoot = useCallback(() => {
const s = sessionRef.current
const video = getVideo()
if (!s || !video.videoWidth) return
try {
const { hfov } = frameFov(settingsRef.current.fovDeg, video.videoWidth, video.videoHeight)
const wasHigh = !!highRef.current
const cap = captureFrame(s, video, hfov, { high: wasHigh })
lastShotRef.current = performance.now()
if (wasHigh) setHigh(null)
setWarn(null)
if (EMBEDDED) nativeCall('haptic')
else if (navigator.vibrate) navigator.vibrate(15)
setFlash(true)
setTimeout(() => setFlash(false), 150)
afterChange(s)
setTimeout(() => checkTopTouch(s, cap), 80)
} catch (e) {
setHint(errText(e))
}
}, [afterChange, checkTopTouch])
useEffect(() => { shootRef.current = shoot }, [shoot])
const undo = () => {
const s = sessionRef.current
if (!s || !undoLast(s)) return
setWarn(null)
setHigh(null)
afterChange(s)
}
const leave = async (next) => {
const s = sessionRef.current
setLeaving(true)
try {
if (s) {
const saved = await persistSession(s)
const patch = { frames: sessionFrames(s), cells: sessionCells(s) }
if (saved || s.base) patch.hasStrip = true
if (s.base || s.captures.length) {
const hs = horizonSurvey(s)
const p = hs.profile()
if (p) {
patch.profile = Array.from(p, (v) => Math.round(v * 100) / 100)
patch.coverage = Array.from(hs.coverage())
}
}
onSiteChange(patch)
}
} catch (e) {
setLeaving(false)
setHint(t('capture.saveError', { error: errText(e) }))
return
}
stopCamera()
next()
}
// Android back button = close (saves first).
const leaveRef = useRef(null)
useEffect(() => { leaveRef.current = () => leave(onClose) })
useEffect(() => {
if (!onRegisterBack) return undefined
onRegisterBack(() => {
if (leaveRef.current) leaveRef.current()
return true
})
return () => onRegisterBack(null)
}, [onRegisterBack])
// ---------- live loop: preview, target dot, readouts, auto-shutter ----------
useEffect(() => {
if (cam.state !== 'live' || !session) return
const video = getVideo()
const hist = []
let raf = 0
let lastHint = ''
let readySince = 0
const say = (text) => {
if (text !== lastHint) {
lastHint = text
setHint(text)
}
}
const show = (el, on) => { if (el) el.style.display = on ? '' : 'none' }
const loop = () => {
raf = requestAnimationFrame(loop)
const view = viewRef.current
const pv = previewRef.current
if (!view || !pv || !video.videoWidth) return
if (pv.width !== video.videoWidth || pv.height !== video.videoHeight) {
pv.width = video.videoWidth
pv.height = video.videoHeight
}
pv.getContext('2d').drawImage(video, 0, 0)
if (!wasmReady()) return
const { heading, tilt } = readOrientation()
const W = view.clientWidth
const H = view.clientHeight
const { hfov, vfov } = frameFov(settingsRef.current.fovDeg, video.videoWidth, video.videoHeight)
const scale = Math.max(W / video.videoWidth, H / video.videoHeight)
const ppd = (video.videoWidth * scale) / hfov
const cx = W / 2
const cy = H / 2
if (heading < 0) {
headingRef.current.textContent = '--'
show(dotRef.current, false)
show(leaderRef.current, false)
say(t('capture.hint.compass'))
return
}
headingRef.current.textContent = `${Math.round(heading) % 360}°`
tiltRef.current.textContent = `${signed(tilt, 1)}°`
coversRef.current.textContent = `${num(tilt - vfov / 2)}…${signed(tilt + vfov / 2, 0)}°`
const hy = cy + tilt * ppd
const hl = horizonRef.current
hl.setAttribute('y1', hy)
hl.setAttribute('y2', hy)
hl.setAttribute('x2', W)
horizonLabelRef.current.setAttribute('x', W - 8)
horizonLabelRef.current.setAttribute('y', hy - 6)
show(hl, hy > 0 && hy < H)
show(horizonLabelRef.current, hy > 20 && hy < H)
const s = sessionRef.current
const cells = sessionCells(s)
let lastCell = null
for (let i = s.captures.length - 1; i >= 0; i--) {
if (!s.captures[i].high) { lastCell = s.captures[i].cell; break }
}
const target = nextTarget(cells, lastCell, heading, highRef.current)
const tc = target ? target.cell : -1
if (tc !== targetCellRef.current) {
targetCellRef.current = tc
drawThumb()
}
const now = performance.now()
hist.push({ t: now, heading, tilt })
while (hist.length && now - hist[0].t > 350) hist.shift()
const ref = hist[0]
const dt = (now - ref.t) / 1000
const speed = dt > 0.1 ? Math.max(circularDiff(heading, ref.heading), Math.abs(tilt - ref.tilt)) / dt : 0
if (!target) {
show(dotRef.current, false)
show(leaderRef.current, false)
tiltRef.current.className = 'v'
say(t('capture.hint.done'))
return
}
const dAz = wrap180(target.az - heading)
const dTilt = target.tilt - tilt
const x = Math.min(W - 16, Math.max(16, cx + dAz * ppd))
const y = Math.min(H - 16, Math.max(16, cy - dTilt * ppd))
const dot = dotRef.current
dot.setAttribute('cx', x)
dot.setAttribute('cy', y)
show(dot, true)
const dist = Math.hypot(x - cx, y - cy)
const leader = leaderRef.current
if (dist > 42) {
leader.setAttribute('x1', cx + ((x - cx) / dist) * 31)
leader.setAttribute('y1', cy + ((y - cy) / dist) * 31)
leader.setAttribute('x2', x - ((x - cx) / dist) * 12)
leader.setAttribute('y2', y - ((y - cy) / dist) * 12)
show(leader, true)
} else {
show(leader, false)
}
const inAz = Math.abs(dAz) < AZ_TOL
const inTilt = Math.abs(dTilt) < TILT_TOL
const steady = speed < MAX_SPEED
tiltRef.current.className = inTilt ? 'v ok' : 'v'
const auto = settingsRef.current.autoCapture
if (!inAz) {
say(target.high
? t('capture.hint.higher')
: auto ? t(dAz > 0 ? 'capture.hint.turnRight' : 'capture.hint.turnLeft') : t('capture.hint.manual'))
} else if (!inTilt) {
say(t(dTilt > 0 ? 'capture.hint.tiltUp' : 'capture.hint.tiltDown'))
} else if (!steady) {
say(t('capture.hint.hold'))
} else {
say(auto ? t('capture.hint.hold') : t('capture.hint.tap'))
}
const ready = inAz && inTilt && steady
if (!ready) readySince = 0
else if (!readySince) readySince = now
if (ready && auto && now - readySince >= HOLD_MS && now - lastShotRef.current > COOLDOWN_MS) {
readySince = 0
shootRef.current()
}
}
raf = requestAnimationFrame(loop)
return () => cancelAnimationFrame(raf)
}, [cam.state, session, drawThumb])
// ---------- render ----------
const cells = session ? sessionCells(session) : site.cells || []
const done = cells.filter(Boolean).length
const canUndo = !!(session && session.captures.length)
const live = cam.state === 'live' && !!session
return (
<div className="capture">
<div className="cap-view" ref={viewRef}>
<canvas ref={previewRef} className="cap-preview" />
<svg className="cap-overlay" aria-hidden="true">
<line ref={horizonRef} x1="0" y1="-10" x2="0" y2="-10" stroke="#FFFFFF" strokeOpacity="0.3" strokeDasharray="2 6" />
<text ref={horizonLabelRef} textAnchor="end" fontFamily="IBM Plex Mono, ui-monospace, monospace" fontSize="11" fill="#FFFFFF" fillOpacity="0.75">0°</text>
<circle cx="50%" cy="50%" r="30" fill="none" stroke="#FFFFFF" strokeWidth="2.5" />
<line ref={leaderRef} stroke="#FFFFFF" strokeOpacity="0.7" strokeWidth="1.5" strokeDasharray="3 4" style={{ display: 'none' }} />
<circle ref={dotRef} r="11" fill="#F5B544" stroke="#07090D" strokeWidth="2" style={{ display: 'none' }} />
</svg>
<div className="cap-top">
<button className="icon-btn" aria-label={t('capture.close')} onClick={() => leave(onClose)} disabled={leaving}><IconClose /></button>
<div className="cap-title">
<span className="n">{site.name}</span>
<span className="f">{done >= CELLS ? t('capture.allFrames', { count: CELLS }) : t('capture.frameOf', { n: done + 1, total: CELLS })}</span>
</div>
<button className="icon-btn" aria-label={t('capture.undo')} onClick={undo} disabled={!canUndo}><IconUndo /></button>
</div>
<div className="cap-strip">
<canvas ref={thumbRef} role="img" aria-label={t('capture.progress')} />
<CompassLabels />
</div>
{live && <div className="cap-hint"><span>{hint}</span></div>}
{warn && live && (
<div className="cap-warn">
<span>{t('capture.topTouch', { az: warn.az })}</span>
<button onClick={() => { setHigh({ az: warn.az }); setWarn(null) }}>{t('capture.addHigher')}</button>
</div>
)}
{!live && (
<div className="cap-start">
{cam.state === 'error' ? (
<>
<span style={{ fontSize: 15 }}>{cam.error}</span>
<button className="btn btn-primary" style={{ padding: '0 24px' }} onClick={() => { setCam({ state: 'starting', error: '' }); boot() }}>
<IconCamera /> {t('common.startCamera')}
</button>
</>
) : (
<span className="muted">{t('common.startingCamera')}</span>
)}
</div>
)}
</div>
<div className="cap-panel">
<div className="readouts">
<div><span className="k">{t('capture.heading')}</span><span className="v" ref={headingRef}>--</span></div>
<div><span className="k">{t('capture.tilt')}</span><span className="v" ref={tiltRef}>--</span></div>
<div><span className="k">{t('capture.covers')}</span><span className="v small" ref={coversRef}>--</span></div>
</div>
<div className="controls">
<div style={{ display: 'flex' }}>
<button className={settings.autoCapture ? 'auto-btn on' : 'auto-btn'} aria-pressed={settings.autoCapture}
onClick={() => onSettingsChange({ autoCapture: !settings.autoCapture })}>
{settings.autoCapture ? t('capture.autoOn') : t('capture.autoOff')}
</button>
</div>
<button className={flash ? 'shutter flash' : 'shutter'} aria-label={t('capture.shutter')} onClick={() => shootRef.current()} disabled={!live}>
<span />
</button>
<button className="finish-btn" onClick={() => leave(onFinish)} disabled={leaving || (!canUndo && !site.hasStrip)}>
{t('capture.finish')} <IconChevronRight size={16} className="flip-rtl" />
</button>
</div>
</div>
</div>
)
}
+175
View File
@@ -0,0 +1,175 @@
import { useEffect, useMemo, useState } from 'react'
import { IconBack, IconDownload, IconShare } from '../components/Icons'
import { openSession, horizonSurvey, flattenEdits, STRIP_BOTTOM } from '../lib/survey'
import { coveredDegrees } from '../lib/profile'
import { signed, slug } from '../lib/format'
import { saveFiles, shareFiles } from '../lib/files'
import { loadWasm, errText } from '../lib/wasm'
import { APP_NAME } from '../lib/app'
import { t } from '../i18n'
const FORMATS = [
{ id: 'nina', ext: '.hrz' },
{ id: 'pano', ext: '.zip' },
{ id: 'poly', ext: '.zip' },
]
export default function Export({ site, settings, onSiteChange, onBack }) {
const imported = site.source === 'import'
const canPano = !imported && site.hasStrip
const complete = site.coverage ? coveredDegrees(site.coverage) >= 360 : false
const [on, setOn] = useState({ nina: true, pano: canPano && complete, poly: false })
const [tab, setTab] = useState('hrz')
const [m, setM] = useState(null)
const [busy, setBusy] = useState('')
const [status, setStatus] = useState({ text: '', error: false })
useEffect(() => { loadWasm().then(setM).catch((e) => setStatus({ text: errText(e), error: true })) }, [])
const margin = site.marginDeg ?? 2
const north = site.northOffsetDeg || 0
const profile = useMemo(() => Float64Array.from(site.profile || []), [site.profile])
const meta = useMemo(() => {
const out = { name: site.name, author: settings.author.trim() || 'Unknown', appName: APP_NAME }
if (site.location) {
out.location = { latDeg: site.location.latDeg, lonDeg: site.location.lonDeg }
if (site.location.elevM != null) out.location.elevM = site.location.elevM
}
return JSON.stringify(out)
}, [site.name, site.location, settings.author])
const preview = useMemo(() => {
if (!m || profile.length !== 360) return null
try {
const hrz = m.export_hrz(profile, margin, north)
const opts = JSON.parse(m.stellarium_fitted_options(profile, STRIP_BOTTOM))
opts.northOffsetDeg = north
const ini = on.pano || !on.poly
? m.landscape_ini(meta, 'spherical', opts.topDeg, opts.bottomDeg)
: m.landscape_ini(meta, 'polygonal', 0, 0)
return { hrz, ini, opts }
} catch (e) {
return { error: errText(e) }
}
}, [m, profile, margin, north, meta, on.pano, on.poly])
const count = FORMATS.filter((f) => on[f.id]).length
const build = async () => {
const base = slug(site.name)
const files = []
if (on.nina) files.push({ name: `${base}.hrz`, mime: 'text/plain', data: preview.hrz })
if (on.pano) {
const s = await openSession(site)
const hs = horizonSurvey(s)
hs.set_edits(JSON.stringify(flattenEdits(site.edits)))
const zip = hs.export_spherical(meta, JSON.stringify(preview.opts))
files.push({ name: `${base}-stellarium.zip`, mime: 'application/zip', data: zip })
}
if (on.poly) {
files.push({ name: `${base}-outline.zip`, mime: 'application/zip', data: m.export_stellarium_polygonal(profile, meta, north) })
}
return files
}
const run = async (kind) => {
if (!preview || preview.error || !count) return
setStatus({ text: '', error: false })
setBusy(on.pano ? t('export.rendering') : t('export.preparing'))
await new Promise((r) => setTimeout(r, 30)) // let the busy label paint
try {
const files = await build()
setBusy(kind === 'share' ? t('export.sharing') : t('export.saving'))
const res = kind === 'share' ? await shareFiles(files, site.name) : await saveFiles(files)
if (res.ok) {
onSiteChange({
exported: {
nina: (site.exported && site.exported.nina) || on.nina,
stellarium: (site.exported && site.exported.stellarium) || on.pano || on.poly,
},
})
}
setStatus({ text: res.text, error: false })
} catch (e) {
setStatus({ text: errText(e), error: true })
} finally {
setBusy('')
}
}
const hrzLines = preview && preview.hrz ? preview.hrz.trimEnd().split('\n') : []
return (
<div className="screen">
<div className="screen-body">
<div className="title-row">
<button className="icon-btn back" aria-label={t('export.back')} onClick={onBack}><IconBack className="flip-rtl" /></button>
<div className="title-stack">
<h1>{t('export.title')}</h1>
<span className="sub">{t('export.summary', { name: site.name, margin: signed(margin), north: signed(north) })}</span>
</div>
</div>
<div style={{ marginTop: 16, display: 'flex', flexDirection: 'column', gap: 8 }}>
{FORMATS.map((f) => {
const disabled = f.id === 'pano' && !canPano
const checked = !!on[f.id] && !disabled
return (
<label key={f.id} className={`format-card${checked ? ' on' : ''}${disabled ? ' disabled' : ''}`}>
<input type="checkbox" checked={checked} disabled={disabled}
onChange={() => setOn((o) => ({ ...o, [f.id]: !o[f.id] }))} />
<span style={{ display: 'flex', flexDirection: 'column', gap: 3, minWidth: 0 }}>
<span style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
<span className="t">{t(`export.${f.id}Title`)}</span>
<span className="ext">{f.ext}</span>
</span>
<span className="d">
{disabled ? t('export.panoUnavailable') : t(`export.${f.id}Sub`)}
{f.id === 'pano' && checked && !complete ? ` · ${t('export.panoGaps')}` : ''}
</span>
</span>
</label>
)
})}
</div>
<div style={{ marginTop: 18, display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
<span className="overline">{t('export.preview')}</span>
<div className="segmented small">
<button className={tab === 'hrz' ? 'on' : ''} onClick={() => setTab('hrz')}>.hrz</button>
<button className={tab === 'ini' ? 'on' : ''} onClick={() => setTab('ini')}>landscape.ini</button>
</div>
</div>
<div className="code-box">
{!preview ? t('export.loading') : preview.error ? preview.error : tab === 'ini' ? preview.ini.trimEnd() : (
<>
{[...hrzLines.slice(0, 5), '⋮', ...hrzLines.slice(-2)].join('\n')}
<div className="foot" dir="auto">{t('export.lines', { count: hrzLines.length - 1, margin: signed(margin, 0) })}</div>
</>
)}
</div>
<p style={{ margin: '12px 0 0', fontSize: 13, lineHeight: 1.4, color: 'var(--muted)' }}>
{t('export.help')}
</p>
{(busy || status.text) && (
<div className={status.error ? 'notice error' : 'notice'} style={{ marginTop: 12 }}>
{busy || status.text}
</div>
)}
</div>
<div className="screen-actions two">
<button className="btn btn-surface" onClick={() => run('save')} disabled={!!busy || !count || !preview || !!preview.error}>
<IconDownload /> {t('export.save')}
</button>
<button className="btn btn-primary" style={{ fontSize: 16 }} onClick={() => run('share')} disabled={!!busy || !count || !preview || !!preview.error}>
<IconShare /> {t('export.share', { count })}
</button>
</div>
</div>
)
}
+408
View File
@@ -0,0 +1,408 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { IconBack, IconChevronRight, IconTrash } from '../components/Icons'
import { ProfileChart } from '../components/Charts'
import { openSession, horizonSurvey, flattenEdits, STRIP_W, STRIP_H, STRIP_TOP, STRIP_BOTTOM } from '../lib/survey'
import { rotate, sample, maxAlt, coveredDegrees } from '../lib/profile'
import { signed } from '../lib/format'
import { errText } from '../lib/wasm'
import { t } from '../i18n'
const VIEW_SPAN_AZ = 90
const VIEW_SPAN_ALT = 54
const BRUSH_DEG = 2.5
const OVERVIEW_TOP = 45
const OVERVIEW_BOTTOM = -20
const SKY = 1
const GROUND = 2
/** Strip pixels with sky replaced by a checkerboard (= transparent in Stellarium). */
function buildComposite(stripCanvas, mask) {
const src = stripCanvas.getContext('2d', { willReadFrequently: true }).getImageData(0, 0, STRIP_W, STRIP_H)
const out = new ImageData(STRIP_W, STRIP_H)
const s = src.data
const d = out.data
for (let y = 0; y < STRIP_H; y++) {
const cy = (y >> 4) & 1
for (let x = 0; x < STRIP_W; x++) {
const i = y * STRIP_W + x
const p = i * 4
const m = mask[i]
if (m === GROUND) {
d[p] = s[p]; d[p + 1] = s[p + 1]; d[p + 2] = s[p + 2]
} else if (m === SKY) {
const light = ((x >> 4) & 1) ^ cy
d[p] = light ? 0x27 : 0x1a; d[p + 1] = light ? 0x30 : 0x21; d[p + 2] = light ? 0x42 : 0x30
} else {
d[p] = 0x0a; d[p + 1] = 0x0d; d[p + 2] = 0x13
}
d[p + 3] = 255
}
}
const c = document.createElement('canvas')
c.width = STRIP_W
c.height = STRIP_H
c.getContext('2d').putImageData(out, 0, 0)
return c
}
const pxPerDegY = STRIP_H / (STRIP_TOP - STRIP_BOTTOM)
/** Draw [az0, az0+span] × [top, top−spanAlt] of the composite into a canvas. */
function drawWindow(ctx, comp, w, h, az0, spanAz, top, spanAlt) {
const sx = ((((az0 % 360) + 360) % 360) / 360) * STRIP_W
const sw = (spanAz / 360) * STRIP_W
const sy = (STRIP_TOP - top) * pxPerDegY
const sh = spanAlt * pxPerDegY
const first = Math.min(sw, STRIP_W - sx)
const k = w / sw
ctx.drawImage(comp, sx, sy, first, sh, 0, 0, first * k, h)
if (first < sw) ctx.drawImage(comp, 0, sy, sw - first, sh, first * k, 0, (sw - first) * k, h)
}
function azLabel(az) {
const a = ((Math.round(az) % 360) + 360) % 360
const key = { 0: 'compass.n', 90: 'compass.e', 180: 'compass.s', 270: 'compass.w' }[a]
const name = key && t(key)
return name ? `${name} ${a}°` : `${a}°`
}
function PanoramaView({ profile, comp, tool, onStroke }) {
const zoomRef = useRef(null)
const overRef = useRef(null)
const strokeRef = useRef(null)
const dragRef = useRef(null)
const cursorRef = useRef(null)
const [view, setView] = useState(() => {
let a = 0
let best = -Infinity
for (let d = 0; d < 360; d++) if (profile[d] > best) { best = profile[d]; a = d }
const top = Math.min(90, Math.max(40, Math.ceil(maxAlt(profile) + 10)))
return { az0: a - VIEW_SPAN_AZ / 2, top }
})
const draw = useCallback(() => {
const c = zoomRef.current
if (!c || !comp) return
const dpr = window.devicePixelRatio || 1
const w = Math.round(c.clientWidth * dpr)
const h = Math.round(c.clientHeight * dpr)
if (c.width !== w || c.height !== h) { c.width = w; c.height = h }
const ctx = c.getContext('2d')
ctx.imageSmoothingEnabled = true
drawWindow(ctx, comp, w, h, view.az0, VIEW_SPAN_AZ, view.top, VIEW_SPAN_ALT)
// Edge line
ctx.strokeStyle = '#F5B544'
ctx.lineWidth = 2 * dpr
ctx.lineJoin = 'round'
ctx.beginPath()
for (let x = 0; x <= w; x += 2) {
const alt = sample(profile, view.az0 + (x / w) * VIEW_SPAN_AZ)
const y = ((view.top - alt) / VIEW_SPAN_ALT) * h
if (x === 0) ctx.moveTo(x, y)
else ctx.lineTo(x, y)
}
ctx.stroke()
// Stroke in progress
const st = strokeRef.current
if (st) {
ctx.fillStyle = st.mode === 'sky' ? 'rgba(108,195,230,0.35)' : 'rgba(58,68,54,0.75)'
const r = (st.radiusDeg / VIEW_SPAN_AZ) * w
for (const [az, alt] of st.points) {
let dx = (((az - view.az0) % 360) + 360) % 360
const x = (dx / VIEW_SPAN_AZ) * w
const y = ((view.top - alt) / VIEW_SPAN_ALT) * h
ctx.beginPath()
ctx.ellipse(x, y, r, (st.radiusDeg / VIEW_SPAN_ALT) * h, 0, 0, Math.PI * 2)
ctx.fill()
}
}
// Brush cursor
const cur = cursorRef.current
if (cur && tool !== 'auto') {
ctx.strokeStyle = '#FFFFFF'
ctx.lineWidth = 1.5 * dpr
ctx.setLineDash([3 * dpr, 3 * dpr])
ctx.beginPath()
ctx.ellipse(cur.x * dpr, cur.y * dpr, (BRUSH_DEG / VIEW_SPAN_AZ) * w, (BRUSH_DEG / VIEW_SPAN_ALT) * h, 0, 0, Math.PI * 2)
ctx.stroke()
ctx.setLineDash([])
}
}, [comp, profile, view, tool])
const drawOverview = useCallback(() => {
const c = overRef.current
if (!c || !comp) return
const dpr = window.devicePixelRatio || 1
const w = Math.round(c.clientWidth * dpr)
const h = Math.round(40 * dpr)
if (c.width !== w || c.height !== h) { c.width = w; c.height = h }
const ctx = c.getContext('2d')
ctx.fillStyle = '#1A2130'
ctx.fillRect(0, 0, w, h)
drawWindow(ctx, comp, w, h, 0, 360, OVERVIEW_TOP, OVERVIEW_TOP - OVERVIEW_BOTTOM)
ctx.strokeStyle = '#F5B544'
ctx.lineWidth = 1.2 * dpr
ctx.beginPath()
for (let d = 0; d <= 360; d++) {
const x = (d / 360) * w
const y = ((OVERVIEW_TOP - profile[d % 360]) / (OVERVIEW_TOP - OVERVIEW_BOTTOM)) * h
if (d === 0) ctx.moveTo(x, y)
else ctx.lineTo(x, y)
}
ctx.stroke()
ctx.strokeStyle = '#E8ECF2'
ctx.lineWidth = 2 * dpr
const a0 = ((view.az0 % 360) + 360) % 360
const vw = (VIEW_SPAN_AZ / 360) * w
for (const off of [0, -w]) {
const x = (a0 / 360) * w + off
if (x + vw > 0 && x < w) ctx.strokeRect(x + dpr, dpr, vw - 2 * dpr, h - 2 * dpr)
}
}, [comp, profile, view])
useEffect(() => { draw() }, [draw])
useEffect(() => { drawOverview() }, [drawOverview])
useEffect(() => {
const onResize = () => { draw(); drawOverview() }
window.addEventListener('resize', onResize)
return () => window.removeEventListener('resize', onResize)
}, [draw, drawOverview])
const toDeg = (e) => {
const r = zoomRef.current.getBoundingClientRect()
const fx = (e.clientX - r.left) / r.width
const fy = (e.clientY - r.top) / r.height
return {
az: (((view.az0 + fx * VIEW_SPAN_AZ) % 360) + 360) % 360,
alt: view.top - fy * VIEW_SPAN_ALT,
x: e.clientX - r.left,
y: e.clientY - r.top,
}
}
const onDown = (e) => {
e.currentTarget.setPointerCapture(e.pointerId)
const p = toDeg(e)
cursorRef.current = p
if (tool === 'auto') {
dragRef.current = { x: e.clientX, y: e.clientY, az0: view.az0, top: view.top }
} else {
strokeRef.current = { mode: tool, radiusDeg: BRUSH_DEG, points: [[p.az, p.alt]] }
draw()
}
}
const onMove = (e) => {
const p = toDeg(e)
cursorRef.current = p
const drag = dragRef.current
if (drag) {
const r = zoomRef.current.getBoundingClientRect()
const dAz = ((e.clientX - drag.x) / r.width) * VIEW_SPAN_AZ
const dAlt = ((e.clientY - drag.y) / r.height) * VIEW_SPAN_ALT
setView({
az0: drag.az0 - dAz,
top: Math.min(90, Math.max(STRIP_BOTTOM + VIEW_SPAN_ALT, drag.top + dAlt)),
})
return
}
const st = strokeRef.current
if (st) {
const [la, lalt] = st.points[st.points.length - 1]
let dAz = Math.abs(p.az - la)
if (dAz > 180) dAz = 360 - dAz
if (Math.hypot(dAz, p.alt - lalt) >= BRUSH_DEG / 2) st.points.push([p.az, p.alt])
}
draw()
}
const onUp = () => {
dragRef.current = null
const st = strokeRef.current
strokeRef.current = null
if (st) onStroke(st)
else draw()
}
const onLeave = () => {
cursorRef.current = null
draw()
}
const overviewPick = (e) => {
if (e.type === 'pointermove' && !e.buttons) return
const r = overRef.current.getBoundingClientRect()
const az = ((e.clientX - r.left) / r.width) * 360
setView((v) => ({ ...v, az0: az - VIEW_SPAN_AZ / 2 }))
}
const left = azLabel(view.az0)
const mid = azLabel(view.az0 + VIEW_SPAN_AZ / 2)
const right = azLabel(view.az0 + VIEW_SPAN_AZ)
return (
<>
<div className="pano-zoom">
<canvas ref={zoomRef} role="img" aria-label={t('review.zoomLabel')}
onPointerDown={onDown} onPointerMove={onMove} onPointerUp={onUp} onPointerCancel={onUp} onPointerLeave={onLeave}
style={{ cursor: tool === 'auto' ? 'grab' : 'none' }} />
<div style={{ position: 'absolute', left: 6, right: 6, bottom: 4, display: 'flex', justifyContent: 'space-between', fontFamily: 'var(--font-num)', fontSize: 10, color: 'var(--text2)', pointerEvents: 'none', textShadow: '0 0 3px #000' }}>
<span>{left}</span><span>{mid}</span><span>{right}</span>
</div>
</div>
<div style={{ marginTop: 8, display: 'flex', flexDirection: 'column', gap: 8 }}>
<div className="pano-overview" onPointerDown={overviewPick} onPointerMove={overviewPick}>
<canvas ref={overRef} role="img" aria-label={t('review.overviewLabel')} />
</div>
<span style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 13, color: 'var(--muted)' }}>
<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><rect width="14" height="14" fill="#1A2130" /><rect width="7" height="7" fill="#3A4558" /><rect x="7" y="7" width="7" height="7" fill="#3A4558" /></svg>
{t('review.transparentSky')}
<span style={{ flex: 1 }} />
<span>{tool === 'auto' ? t('review.dragHint') : t('review.paintHint')}</span>
</span>
</div>
</>
)
}
export default function Review({ site, onSiteChange, onBack, onExport, onDelete }) {
const imported = site.source === 'import'
const [tab, setTab] = useState('profile')
const [tool, setTool] = useState('auto')
const [state, setState] = useState(() => ({
loading: !imported && site.hasStrip,
error: '',
profile: site.profile,
coverage: site.coverage,
comp: null,
}))
const [confirmDelete, setConfirmDelete] = useState(false)
const sessionRef = useRef(null)
const siteRef = useRef(site)
useEffect(() => { siteRef.current = site })
// Detect sky on the stitched strip, apply the saved brush edits.
const recompute = useCallback((strokes, { save = true } = {}) => {
const s = sessionRef.current
const hs = horizonSurvey(s)
hs.set_edits(JSON.stringify(flattenEdits(strokes)))
const p = hs.profile()
const profile = p ? Array.from(p, (v) => Math.round(v * 100) / 100) : null
const coverage = Array.from(hs.coverage())
const comp = buildComposite(s.canvas, hs.mask())
setState({ loading: false, error: '', profile, coverage, comp })
if (save) onSiteChange({ profile, coverage, edits: strokes })
}, [onSiteChange])
useEffect(() => {
if (imported || !site.hasStrip) return
let alive = true
openSession(site)
.then((s) => new Promise((r) => setTimeout(() => r(s), 30))) // let "Detecting…" paint
.then((s) => {
if (!alive) return
sessionRef.current = s
recompute(siteRef.current.edits || [], { save: true })
})
.catch((e) => alive && setState((st) => ({ ...st, loading: false, error: errText(e) })))
return () => { alive = false }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [site.id])
const strokes = site.edits || []
const addStroke = (st) => recompute([...strokes, st])
const undoStroke = () => recompute(strokes.slice(0, -1))
const clearStrokes = () => recompute([])
const north = site.northOffsetDeg || 0
const margin = site.marginDeg ?? 2
const shown = useMemo(() => (state.profile ? rotate(state.profile, north) : null), [state.profile, north])
const covered = state.coverage ? coveredDegrees(state.coverage) : imported ? 360 : 0
const subtitle = imported
? t('review.imported')
: covered >= 360
? t('review.stitchedFull', { count: site.frames })
: t('review.stitchedPartial', { count: site.frames, deg: covered })
const setNorth = (v) => onSiteChange({ northOffsetDeg: Math.round(v * 2) / 2 })
return (
<div className="screen">
<div className="screen-body">
<div className="title-row">
<button className="icon-btn back" aria-label={t('common.back')} onClick={onBack}><IconBack className="flip-rtl" /></button>
<div className="title-stack">
<h1>{t('review.title')}</h1>
<span className="sub">{subtitle}</span>
</div>
{confirmDelete ? (
<button className="icon-btn confirm" onClick={onDelete}>{t('review.deleteConfirm')}</button>
) : (
<button className="icon-btn danger" aria-label={t('review.delete')} onClick={() => setConfirmDelete(true)}><IconTrash /></button>
)}
</div>
<div className="segmented" style={{ marginTop: 12, gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' }}>
<button className={tab === 'profile' ? 'on' : ''} onClick={() => setTab('profile')}>{t('review.tabNina')}</button>
<button className={tab === 'pano' ? 'on' : ''} onClick={() => setTab('pano')} disabled={imported}>{t('review.tabPano')}</button>
</div>
{state.error && <div className="notice error" style={{ marginTop: 12 }}>{state.error}</div>}
{state.loading ? (
<div className="busy">{t('review.detecting')}</div>
) : !shown ? (
<div className="busy">{t('review.noHorizon')}</div>
) : tab === 'profile' ? (
<>
<div style={{ marginTop: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
<ProfileChart profile={shown} marginDeg={margin} />
<div className="legend">
<span><span style={{ width: 16, height: 0, borderTop: '2px solid var(--accent)' }} />{t('review.legendEdge')}</span>
<span><span style={{ width: 16, height: 0, borderTop: '2px dashed var(--info)' }} />{t('review.legendHrz')}</span>
</div>
</div>
<div style={{ marginTop: 16, display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
<label htmlFor="margin" style={{ fontSize: 15, fontWeight: 600 }}>{t('review.margin')}</label>
<span className="mono" style={{ fontSize: 15, color: 'var(--info)' }}>{signed(margin)}°</span>
</div>
<input id="margin" className="slider" type="range" min="0" max="5" step="0.5" value={margin}
onChange={(e) => onSiteChange({ marginDeg: Number(e.target.value) })} />
<span style={{ fontSize: 13, color: 'var(--muted)' }}>{t('review.marginHint')}</span>
</div>
</>
) : (
<>
<PanoramaView profile={state.profile} comp={state.comp} tool={tool} onStroke={addStroke} />
<div className="segmented" style={{ marginTop: 14, gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' }}>
<button className={tool === 'auto' ? 'on' : ''} onClick={() => setTool('auto')}>{t('review.toolAuto')}</button>
<button className={tool === 'sky' ? 'on' : ''} onClick={() => setTool('sky')}>{t('review.toolSky')}</button>
<button className={tool === 'ground' ? 'on' : ''} onClick={() => setTool('ground')}>{t('review.toolGround')}</button>
</div>
{strokes.length > 0 && (
<div style={{ marginTop: 10, display: 'flex', gap: 20, fontSize: 14 }}>
<span className="muted">{t('review.edits', { count: strokes.length })}</span>
<button className="link-btn" onClick={undoStroke}>{t('review.undoEdit')}</button>
<button className="link-btn" onClick={clearStrokes}>{t('review.clearEdits')}</button>
</div>
)}
</>
)}
</div>
<div className="screen-actions">
<div className="north-row">
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1 }}>
<span style={{ fontSize: 15, fontWeight: 600 }}>{t('review.north')}</span>
<span style={{ fontSize: 13, color: 'var(--muted)' }}>{t('review.northHint')}</span>
</div>
<span className="val">{signed(north)}°</span>
<button className="step-btn" aria-label={t('review.rotateLeft')} onClick={() => setNorth(north - 0.5)}>−</button>
<button className="step-btn" aria-label={t('review.rotateRight')} onClick={() => setNorth(north + 0.5)}>+</button>
</div>
<button className="btn btn-primary" onClick={onExport} disabled={!state.profile || state.loading}>
{t('review.export')} <IconChevronRight className="flip-rtl" />
</button>
</div>
</div>
)
}
+71
View File
@@ -0,0 +1,71 @@
import { NightBackdrop } from './Welcome'
import { IconBack } from '../components/Icons'
import { defaultFovFor } from '../lib/camera'
import { APP_NAME } from '../lib/app'
import { num } from '../lib/format'
import { t, LOCALES, systemLocale, localeName } from '../i18n'
// Typical phone portrait frame (9:16) when nothing is calibrated yet.
const PORTRAIT_GUESS = defaultFovFor(9, 16)
export default function Settings({ settings, onSettingsChange, onBack, onCalibrate }) {
const fov = settings.fovDeg
const adjust = (d) => {
const base = fov != null ? fov : PORTRAIT_GUESS
onSettingsChange({ fovDeg: Math.round(Math.min(120, Math.max(20, base + d)) * 10) / 10 })
}
return (
<div className="screen with-backdrop">
<NightBackdrop />
<div className="screen-body">
<div className="title-row">
{onBack && <button className="icon-btn back" aria-label={t('common.back')} onClick={onBack}><IconBack className="flip-rtl" /></button>}
<h1>{t('settings.title')}</h1>
</div>
<div style={{ marginTop: 20, display: 'flex', flexDirection: 'column', gap: 8 }}>
<span className="overline">{t('settings.camera')}</span>
<div className="row-card">
<div className="grow">
<span className="strong">{t('settings.fov')}</span>
<span className="small">
{fov != null
? t('settings.fovValue', { fov: num(fov, 1) })
: t('settings.fovAssumed', { fov: num(PORTRAIT_GUESS, 0) })}
</span>
</div>
<button className="step-btn" aria-label={t('settings.narrower')} onClick={() => adjust(-1)}>−</button>
<button className="step-btn" aria-label={t('settings.wider')} onClick={() => adjust(1)}>+</button>
</div>
<div style={{ display: 'flex', gap: 10 }}>
<button className="btn btn-secondary" style={{ flex: 1 }} onClick={onCalibrate}>{t('settings.calibrate')}</button>
{fov != null && (
<button className="btn btn-secondary" style={{ padding: '0 16px' }} onClick={() => onSettingsChange({ fovDeg: null })}>{t('settings.reset')}</button>
)}
</div>
<span style={{ fontSize: 13, color: 'var(--muted)' }}>{t('settings.fovHint')}</span>
</div>
<div style={{ marginTop: 28, display: 'flex', flexDirection: 'column', gap: 8 }}>
<label className="overline" htmlFor="language">{t('settings.language')}</label>
<select id="language" className="text-input select" value={settings.language || ''}
onChange={(e) => onSettingsChange({ language: e.target.value })}>
<option value="">{t('settings.systemLanguage', { name: localeName(systemLocale()) })}</option>
{LOCALES.map((l) => <option key={l.code} value={l.code}>{l.name}</option>)}
</select>
</div>
<div style={{ marginTop: 28, display: 'flex', flexDirection: 'column', gap: 8 }}>
<label className="overline" htmlFor="author">{t('settings.author')}</label>
<input id="author" className="text-input" value={settings.author} placeholder={t('settings.authorPlaceholder')}
onChange={(e) => onSettingsChange({ author: e.target.value })} autoComplete="name" dir="auto" />
</div>
<div style={{ marginTop: 28, fontSize: 13, color: 'var(--faint)' }}>
{t('settings.about', { app: APP_NAME })}
</div>
</div>
</div>
)
}
+139
View File
@@ -0,0 +1,139 @@
import { useCallback, useEffect, useState } from 'react'
import { IconBack, IconPin, IconCompass, IconChevronRight } from '../components/Icons'
import { latText, lonText } from '../lib/format'
import { startCamera, startOrientation } from '../lib/camera'
import { errText } from '../lib/wasm'
import { t } from '../i18n'
function useLocation() {
const [state, setState] = useState(() => (navigator.geolocation
? { status: 'locating', loc: null, error: '' }
: { status: 'error', loc: null, error: t('setup.noGeo') }))
const locate = useCallback(() => {
if (!navigator.geolocation) return
navigator.geolocation.getCurrentPosition(
(p) => setState({
status: 'ok',
error: '',
loc: {
latDeg: p.coords.latitude,
lonDeg: p.coords.longitude,
elevM: p.coords.altitude,
accuracyM: p.coords.accuracy,
},
}),
() => setState({ status: 'error', loc: null, error: t('setup.geoUnavailable') }),
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 60000 },
)
}, [])
useEffect(() => { locate() }, [locate])
const refresh = () => {
if (!navigator.geolocation) return
setState((s) => ({ ...s, status: 'locating', error: '' }))
locate()
}
return [state, refresh]
}
export default function Setup({ suggestedName, onBack, onStart }) {
const [name, setName] = useState(suggestedName)
const [location, refresh] = useLocation()
const [starting, setStarting] = useState(false)
const [error, setError] = useState('')
const start = async () => {
setError('')
setStarting(true)
// Sensors first and synchronously from the tap: iOS only asks inside a gesture.
const ori = startOrientation()
try {
await ori
} catch (e) {
setStarting(false)
setError(t('setup.sensorsError', { error: errText(e) }))
return
}
try {
await startCamera()
} catch (e) {
setStarting(false)
setError(t('setup.cameraError', { error: errText(e) }))
return
}
onStart({ name: name.trim() || suggestedName, location: location.loc })
}
const loc = location.loc
return (
<div className="screen">
<div className="screen-body">
<div className="title-row">
<button className="icon-btn back" aria-label={t('common.back')} onClick={onBack}><IconBack className="flip-rtl" /></button>
<h1>{t('setup.title')}</h1>
</div>
<div style={{ marginTop: 16, display: 'flex', flexDirection: 'column', gap: 22 }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
<label htmlFor="site-name" className="overline">{t('setup.siteName')}</label>
<input id="site-name" className="text-input" value={name} maxLength={60}
onChange={(e) => setName(e.target.value)} autoComplete="off" dir="auto" />
<div className="row-card">
<IconPin style={{ color: 'var(--info)', flex: 'none' }} />
<div className="grow">
{loc ? (
<>
<span className="mono" dir="ltr" style={{ fontSize: 13 }}>{latText(loc.latDeg)} · {lonText(loc.lonDeg)}</span>
<span className="small">
{loc.elevM != null ? t('setup.elevation', { m: Math.round(loc.elevM) }) : t('setup.altitudeUnknown')} · {t('setup.gps', { m: Math.round(loc.accuracyM) })}
</span>
</>
) : (
<>
<span className="strong">{location.status === 'locating' ? t('setup.locating') : t('common.noLocation')}</span>
<span className="small">{location.error || t('setup.locationHint')}</span>
</>
)}
</div>
<button className="btn-small" onClick={refresh} disabled={location.status === 'locating'}>{t('setup.refresh')}</button>
</div>
<div className="row-card">
<IconCompass style={{ color: 'var(--info)', flex: 'none' }} />
<div className="grow">
<span className="strong">{t('setup.northTitle')}</span>
<span className="small">{t('setup.northHint')}</span>
</div>
</div>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<span className="overline">{t('setup.howTo')}</span>
<svg viewBox="0 0 350 120" width="100%" role="img" style={{ display: 'block' }}
aria-label={t('setup.illustration')}>
<ellipse cx="175" cy="66" rx="150" ry="34" fill="none" stroke="#263042" strokeWidth="22" />
<path d="M25 66 A150 34 0 0 0 325 66" fill="none" stroke="#F5B544" strokeOpacity="0.35" strokeWidth="22" />
<path d="M296 44 l14 8 -16 4" fill="none" stroke="#F5B544" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
<rect x="163" y="40" width="24" height="44" rx="5" fill="#0A0D13" stroke="#E8ECF2" strokeWidth="2" />
<text x="338" y="20" textAnchor="end" fontFamily="IBM Plex Mono, ui-monospace, monospace" fontSize="10" fill="#93A0B4">{t('setup.skyNotNeeded')}</text>
</svg>
<ol className="how-list">
<li>{t('setup.step1')}</li>
<li>{t('setup.step2')}</li>
<li>{t('setup.step3')}</li>
</ol>
</div>
{error && <div className="notice error">{error}</div>}
</div>
</div>
<div className="screen-actions">
<button className="btn btn-primary" onClick={start} disabled={starting}>
{starting ? t('common.startingCamera') : t('setup.start')}
{!starting && <IconChevronRight className="flip-rtl" />}
</button>
</div>
</div>
)
}
+141
View File
@@ -0,0 +1,141 @@
import { NightBackdrop } from './Welcome'
import { useRef, useState } from 'react'
import { Sparkline, CompassLabels } from '../components/Charts'
import { IconSettings, IconChevronRight, IconPlus, IconImport, IconCheck } from '../components/Icons'
import { coordsText } from '../lib/format'
import { coveredDegrees } from '../lib/profile'
import { readText, EMBEDDED } from '../lib/files'
import { loadWasm, errText } from '../lib/wasm'
import { t } from '../i18n'
import { APP_NAME } from '../lib/app'
function SiteCard({ site, onOpen }) {
const inProgress = site.status !== 'complete'
const covered = site.coverage ? coveredDegrees(site.coverage) : site.source === 'import' ? 360 : 0
const cellDeg = Math.round((site.cells || []).filter(Boolean).length * 15)
const shownDeg = site.coverage ? covered : cellDeg
return (
<button className="site-card" onClick={() => onOpen(site)}>
<div className="head">
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, minWidth: 0 }}>
<span className="name">{site.name}</span>
<span className="coords">{coordsText(site.location)}</span>
</div>
{inProgress ? (
<span className="badge-amber">{t('sites.inProgress')}</span>
) : (
<IconChevronRight size={20} width={1.8} style={{ color: 'var(--muted)', marginTop: 4, flex: 'none' }} />
)}
</div>
{site.profile ? (
<Sparkline profile={site.profile} coverage={site.coverage} />
) : (
<div style={{ height: 64, borderRadius: 8, border: '1px dashed #263042', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 13, color: 'var(--faint)' }}>
{t('sites.noHorizon')}
</div>
)}
{inProgress ? (
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, width: '100%' }}>
<div className="progress"><div style={{ width: `${(shownDeg / 360) * 100}%` }} /></div>
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14, color: 'var(--muted)' }}>
<span>{t('sites.covered', { deg: shownDeg })}</span>
<span style={{ color: 'var(--accent)', fontWeight: 600 }}>{t('sites.continue')}</span>
</div>
</div>
) : (
<>
<CompassLabels style={{ marginTop: -6, width: '100%' }} />
<div className="footer" style={{ width: '100%' }}>
<span>
{site.source === 'import'
? t('sites.imported')
: covered >= 360
? t('sites.framesFull', { count: site.frames })
: t('sites.framesPartial', { count: site.frames, deg: covered })}
</span>
<span style={{ flex: 1 }} />
{site.exported?.nina && <span className="chip"><IconCheck style={{ color: 'var(--info)' }} />NINA</span>}
{site.exported?.stellarium && <span className="chip"><IconCheck style={{ color: 'var(--info)' }} />Stellarium</span>}
</div>
</>
)}
</button>
)
}
export default function Sites({ sites, onNew, onOpen, onSettings, onImport }) {
const fileRef = useRef(null)
const [error, setError] = useState('')
const pickFile = async (e) => {
const file = e.target.files && e.target.files[0]
e.target.value = ''
if (!file) return
setError('')
try {
const m = await loadWasm()
const text = await readText(file)
const profile = Array.from(m.parse_hrz(text))
onImport(file.name.replace(/\.(hrz|txt)$/i, ''), profile)
} catch (err) {
setError(t('sites.importError', { file: file.name, error: errText(err) }))
}
}
const sorted = [...sites].sort((a, b) => (b.updatedAt || '').localeCompare(a.updatedAt || ''))
return (
<div className="screen with-backdrop">
<NightBackdrop />
<div className="screen-body" style={{ paddingTop: 'calc(var(--safe-top) + 32px)' }}>
<div className="home-header">
<div>
<h1>{APP_NAME}</h1>
<p>{t('sites.subtitle')}</p>
</div>
{EMBEDDED ? (
// In the app, New survey and Settings live in the native tab bar.
<button className="icon-btn round" aria-label={t('sites.import')} title={t('sites.import')}
onClick={() => fileRef.current && fileRef.current.click()}>
<IconImport size={20} />
</button>
) : (
<button className="icon-btn round" aria-label={t('sites.settings')} onClick={onSettings}>
<IconSettings />
</button>
)}
</div>
<div className="overline" style={{ marginTop: 28 }}>{t('sites.count', { count: sites.length })}</div>
{error && <div className="notice error" style={{ marginTop: 12 }}>{error}</div>}
{sorted.length === 0 ? (
<div className="empty">
<span style={{ fontSize: 17, color: 'var(--text)', fontWeight: 600 }}>{t('sites.emptyTitle')}</span>
<span>{t('sites.emptyHint')}</span>
{EMBEDDED && <span>{t('sites.emptyHintApp', { tab: t('tab.new') })}</span>}
</div>
) : (
<div className="site-list">
{sorted.map((s) => <SiteCard key={s.id} site={s} onOpen={onOpen} />)}
</div>
)}
</div>
{!EMBEDDED && <div className="screen-actions">
<button className="btn btn-primary" onClick={onNew}>
<IconPlus />
{t('sites.newSurvey')}
</button>
<button className="btn btn-secondary" onClick={() => fileRef.current && fileRef.current.click()}>
<IconImport />
{t('sites.import')}
</button>
</div>}
<input ref={fileRef} type="file" accept=".hrz,.txt,text/plain" hidden onChange={pickFile} />
</div>
)
}
+158
View File
@@ -0,0 +1,158 @@
import { useMemo } from 'react'
import AppIcon from '../components/AppIcon'
import { IconChevronRight } from '../components/Icons'
import { t } from '../i18n'
import { APP_NAME } from '../lib/app'
// First-run screen (design: "0 · Welcome"): a night garden with house, trees
// and telescope; a dashed amber line traces the horizon over the rooftops.
const TINTS = ['#FFFFFF', '#DCE4F0', '#E8ECF2', '#FFE9C7', '#CFE0FF']
const BRIGHT = [[58, 330, '#FFFFFF'], [322, 86, '#CFE0FF'], [262, 300, '#FFE9C7'], [36, 66, '#FFFFFF'], [356, 348, '#DCE4F0']]
const MILKY = 0.12
/** Same seeded star field as the design source. */
function makeStars(count = 150) {
let seed = 20261023
const rnd = () => {
seed = (seed * 16807) % 2147483647
return seed / 2147483647
}
const stars = []
let guard = 0
while (stars.length < count && guard < count * 10) {
guard++
const x = rnd() * 390
const y = rnd() * 600
const b = rnd()
const horizonY = x < 155 ? 500 : x < 240 ? 440 : x < 330 ? 520 : 460
if (y > horizonY) continue
if (x > 95 && x < 295 && y > 96 && y < 280 && b > 0.5) continue // keep the title area calm
const big = b > 0.93
stars.push({
x, y,
r: big ? 1.3 + rnd() * 0.6 : 0.35 + b * 0.8,
o: 0.35 + b * 0.6,
c: TINTS[Math.floor(rnd() * TINTS.length)],
})
}
return stars
}
export function NightScene() {
const stars = useMemo(() => makeStars(), [])
return (
<svg viewBox="0 0 390 844" preserveAspectRatio="xMidYMax slice" role="img"
aria-label={t('welcome.sceneLabel')}
style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', display: 'block' }}>
<defs>
<linearGradient id="wl-night" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stopColor="#03050A" />
<stop offset="0.55" stopColor="#0A1222" />
<stop offset="0.75" stopColor="#16233A" />
</linearGradient>
<filter id="wl-soft" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="22" /></filter>
<filter id="wl-glow" x="-200%" y="-200%" width="500%" height="500%"><feGaussianBlur stdDeviation="2.2" /></filter>
</defs>
<rect x="0" y="-400" width="390" height="1244" fill="url(#wl-night)" />
<rect x="0" y="-400" width="390" height="400" fill="#03050A" />
<ellipse cx="210" cy="300" rx="70" ry="330" transform="rotate(32 210 300)" fill="#A9BCE0" fillOpacity={MILKY} filter="url(#wl-soft)" />
<ellipse cx="230" cy="320" rx="30" ry="260" transform="rotate(32 230 320)" fill="#C9D6EE" fillOpacity={MILKY * 0.6} filter="url(#wl-soft)" />
{stars.map((s, i) => (
<circle key={i} cx={s.x.toFixed(1)} cy={s.y.toFixed(1)} r={s.r.toFixed(2)} fill={s.c} fillOpacity={s.o.toFixed(2)} />
))}
{BRIGHT.map(([x, y, c]) => (
<g key={`${x}-${y}`}>
<circle cx={x} cy={y} r="4.5" fill={c} fillOpacity="0.55" filter="url(#wl-glow)" />
<line x1={x - 8} y1={y} x2={x + 8} y2={y} stroke={c} strokeOpacity="0.55" strokeWidth="0.8" />
<line x1={x} y1={y - 8} x2={x} y2={y + 8} stroke={c} strokeOpacity="0.55" strokeWidth="0.8" />
<circle cx={x} cy={y} r="1.6" fill="#FFFFFF" />
</g>
))}
<path d="M0 600 C25 586 45 594 70 582 C95 570 120 590 150 584 C180 578 200 596 230 592 C260 588 285 600 315 596 C345 592 370 604 390 598 L390 844 L0 844 Z" fill="#0C1320" />
<g fill="#080C15">
<path d="M300 528 L314 560 L307 560 L321 594 L279 594 L293 560 L286 560 Z" />
<path d="M345 470 L365 520 L355 520 L376 566 L363 566 L386 618 L304 618 L327 566 L314 566 L335 520 L325 520 Z" />
<rect x="341" y="612" width="8" height="30" />
<circle cx="180" cy="500" r="38" />
<circle cx="155" cy="527" r="28" />
<circle cx="207" cy="524" r="30" />
<circle cx="182" cy="468" r="25" />
<circle cx="160" cy="490" r="20" />
<circle cx="202" cy="488" r="20" />
<rect x="176" y="540" width="9" height="110" />
<rect x="20" y="560" width="122" height="100" />
<path d="M8 564 L80 505 L152 564 Z" />
<rect x="110" y="514" width="14" height="34" />
</g>
<rect x="40" y="590" width="22" height="22" fill="#F5B544" fillOpacity="0.85" />
<line x1="51" y1="590" x2="51" y2="612" stroke="#080C15" strokeWidth="2" />
<line x1="40" y1="601" x2="62" y2="601" stroke="#080C15" strokeWidth="2" />
<rect x="100" y="590" width="22" height="22" fill="#F5B544" fillOpacity="0.18" />
<path d="M0 652 C100 640 250 646 390 636 L390 844 L0 844 Z" fill="#05070C" />
<polyline points="0,598 8,564 80,505 152,564 154,536 158,510 166,478 176,446 192,444 204,466 222,496 236,520 242,560 262,590 286,560 300,528 314,560 322,594 330,560 345,470 365,520 386,606 390,600"
fill="none" stroke="#F5B544" strokeWidth="1.6" strokeDasharray="5 4" strokeLinejoin="round" strokeOpacity="0.9" />
<g fill="#F5B544">
{[[80, 505], [152, 564], [184, 443], [242, 560], [300, 528], [345, 470]].map(([x, y]) => <circle key={x} cx={x} cy={y} r="2.6" />)}
</g>
<g>
<line x1="252" y1="662" x2="222" y2="772" stroke="#1A2436" strokeWidth="5" strokeLinecap="round" />
<line x1="255" y1="662" x2="258" y2="782" stroke="#1A2436" strokeWidth="5" strokeLinecap="round" />
<line x1="258" y1="662" x2="292" y2="770" stroke="#1A2436" strokeWidth="5" strokeLinecap="round" />
<line x1="252" y1="652" x2="230" y2="684" stroke="#1A2436" strokeWidth="3" strokeLinecap="round" />
<g stroke="#3A4A66" strokeWidth="1" strokeLinejoin="round" fill="#121A28">
<circle cx="228" cy="688" r="7" />
<rect x="245" y="646" width="20" height="18" rx="3" />
<g transform="rotate(-50 262 640)">
<rect x="207" y="630" width="104" height="20" rx="3" />
<rect x="296" y="627" width="26" height="26" rx="2" />
<rect x="196" y="634" width="14" height="12" rx="2" />
</g>
</g>
</g>
</svg>
)
}
/** The night scene dimmed behind the main screens (Sites, Settings). */
export function NightBackdrop() {
return (
<div className="night-backdrop" aria-hidden="true">
<NightScene />
<div className="night-backdrop-dim" />
</div>
)
}
export default function Welcome({ onStart }) {
return (
<div className="screen" style={{ background: '#04060B' }}>
<NightScene />
<div style={{
position: 'absolute', left: 0, right: 0, top: 'calc(var(--safe-top) + 64px)',
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14, textAlign: 'center', padding: '0 20px',
}}>
<AppIcon size={64} border />
<h1 style={{ margin: 0, fontSize: 44, fontWeight: 700, letterSpacing: '-0.01em', lineHeight: 1.1 }}>{APP_NAME}</h1>
<p style={{ margin: 0, maxWidth: 280, fontSize: 17, lineHeight: 1.4, color: 'var(--text2)' }}>
{t('welcome.tagline')}
</p>
</div>
<div style={{
position: 'absolute', left: 20, right: 20, bottom: 'calc(var(--safe-bottom) + 24px)',
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14,
}}>
<span className="overline" style={{ textTransform: 'none' }}>{t('welcome.formats')}</span>
<button className="btn btn-primary" style={{ alignSelf: 'stretch' }} onClick={onStart}>
{t('welcome.start')} <IconChevronRight className="flip-rtl" />
</button>
</div>
</div>
)
}
+394
View File
@@ -0,0 +1,394 @@
/* Design tokens: docs/design/tokens.json */
:root {
--bg: #0A0D13;
--surface: #121722;
--surface2: #1A2130;
--border: #232C3B;
--border-strong: #263042;
--grid: #1E2634;
--text: #E8ECF2;
--text2: #C9D2DE;
--muted: #93A0B4;
--faint: #7F8CA1;
--accent: #F5B544;
--accent-hover: #FFD07A;
--on-accent: #1A1204;
--info: #6CC3E6;
--info-bg: #12303C;
--warn-bg: #1E1A10;
--warn-border: #4A3A16;
--badge-amber-bg: #2A2312;
--danger: #F27A54;
--scrim: rgba(10, 13, 19, 0.72);
--checker-a: #1A2130;
--checker-b: #273042;
--font-ui: 'Barlow', system-ui, sans-serif;
--font-num: 'IBM Plex Mono', ui-monospace, monospace;
--screen-x: 20px;
--safe-top: env(safe-area-inset-top, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #root {
margin: 0;
height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font-ui);
font-size: 15px;
line-height: 1.4;
-webkit-tap-highlight-color: transparent;
overscroll-behavior: none;
}
button, input { font-family: inherit; color: inherit; }
/* App-like touch: no accidental text selection, long-press callouts or double-tap zoom. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, a, label, canvas { touch-action: manipulation; }
input, textarea, .code-box { -webkit-user-select: text; user-select: text; }
/* ---------- Right-to-left (Arabic) ----------
The layout mirrors, but data does not: azimuth always grows left to right
on charts, strips and the panorama, and numbers / file previews stay LTR. */
[dir='rtl'] .flip-rtl { transform: scaleX(-1); }
svg, canvas, .compass-labels, .cap-strip, .pano-zoom, .pano-overview, .code-box { direction: ltr; }
.code-box { text-align: left; }
.mono, .readouts .v, .north-row .val, .ext, .segmented.small button { unicode-bidi: isolate; direction: ltr; }
select.text-input {
-webkit-appearance: none; appearance: none; cursor: pointer;
background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
background-size: 6px 6px; background-repeat: no-repeat;
padding-inline-end: 40px;
}
[dir='rtl'] select.text-input { background-position: 16px 50%, 22px 50%; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
.mono { font-family: var(--font-num); }
.muted { color: var(--muted); }
.overline {
font-family: var(--font-num);
font-size: 12px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--muted);
}
/* ---------- Screen scaffold ---------- */
.screen {
position: relative;
height: 100dvh;
max-width: 480px;
margin: 0 auto;
display: flex;
flex-direction: column;
overflow: hidden;
}
.screen-body {
flex: 1;
overflow-y: auto;
padding: calc(var(--safe-top) + 24px) var(--screen-x) 16px;
}
.screen-actions {
padding: 10px var(--screen-x) calc(var(--safe-bottom) + 24px);
display: flex;
flex-direction: column;
gap: 10px;
}
.screen-actions.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.title-row .sub { font-size: 13px; color: var(--muted); }
.title-stack { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.icon-btn {
width: 44px; height: 44px; flex: none;
display: flex; align-items: center; justify-content: center;
background: none; border: none; padding: 0; color: var(--text);
}
.icon-btn.back { margin-inline-start: -10px; }
.icon-btn.round {
border-radius: 22px;
border: 1px solid var(--border-strong);
background: var(--surface);
}
.icon-btn.danger { color: var(--danger); }
.icon-btn.confirm {
width: auto; padding: 0 12px; border-radius: 10px;
background: #3A1A12; color: var(--danger); font-weight: 600; font-size: 14px;
}
/* ---------- Buttons ---------- */
.btn {
display: flex; align-items: center; justify-content: center; gap: 10px;
border-radius: 16px; font-weight: 700; font-size: 17px;
border: none; text-decoration: none;
}
.btn-primary { height: 56px; background: var(--accent); color: var(--on-accent); }
.btn-primary:not(:disabled):active { background: var(--accent-hover); }
.btn-secondary {
height: 48px; border-radius: 14px; font-size: 15px; font-weight: 600;
border: 1px solid var(--border-strong); background: transparent; color: var(--text);
}
.btn-surface {
height: 56px; font-size: 16px; font-weight: 600;
border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.btn-small {
height: 44px; padding: 0 12px; border-radius: 10px;
border: 1px solid var(--border-strong); background: var(--surface2);
font-size: 14px; font-weight: 600;
}
.link-btn {
background: none; border: none; padding: 0;
color: var(--accent); font-weight: 600; font-size: 14px;
}
/* ---------- Segmented control ---------- */
.segmented {
display: grid; gap: 4px; padding: 4px;
border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.segmented button {
height: 40px; min-width: 0; border-radius: 10px; border: none;
font-size: 14px; font-weight: 600; background: transparent; color: var(--text);
}
.segmented button.on { background: var(--text); color: var(--bg); }
.segmented.small { display: flex; padding: 3px; border-radius: 10px; }
.segmented.small button {
height: 32px; padding: 0 10px; border-radius: 8px;
font-family: var(--font-num); font-size: 12px; font-weight: 400; color: var(--text2);
}
.segmented.small button.on { color: var(--bg); }
/* ---------- Cards & rows ---------- */
.card {
background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.row-card {
display: flex; align-items: center; gap: 10px;
background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
padding: 10px 10px 10px 14px; min-height: 64px;
}
.row-card .grow { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-card .strong { font-size: 15px; font-weight: 600; }
.row-card .small { font-size: 13px; color: var(--muted); }
.text-input {
height: 48px; width: 100%;
border-radius: 12px; border: 1px solid var(--border-strong);
background: var(--surface); font-size: 17px; padding: 0 14px;
}
.text-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.notice {
font-size: 13px; line-height: 1.35; padding: 10px 12px; border-radius: 12px;
background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--text);
}
.notice.error { background: #2A1410; border-color: #5A2A1E; }
.chip {
display: inline-flex; align-items: center; gap: 4px;
font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px;
background: var(--surface2); color: var(--text2);
}
.badge-amber {
font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px;
background: var(--badge-amber-bg); color: var(--accent); white-space: nowrap;
}
/* ---------- Night backdrop (Sites, Settings) ---------- */
.night-backdrop { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: #04060B; }
.night-backdrop svg { opacity: 0.75; }
/* Darker at the top behind the title and in the middle behind the cards. */
.night-backdrop-dim {
position: absolute; inset: 0;
background: linear-gradient(to bottom,
rgba(4, 6, 11, 0.70) 0%, rgba(4, 6, 11, 0.35) 30%, rgba(4, 6, 11, 0.25) 60%, rgba(4, 6, 11, 0.10) 100%);
}
.screen.with-backdrop .screen-body,
.screen.with-backdrop .screen-actions { position: relative; z-index: 1; }
/* Keep text and outline buttons readable over the illustration. */
.screen.with-backdrop .screen-body { text-shadow: 0 1px 3px rgba(4, 6, 11, 0.9); }
.screen.with-backdrop .btn-secondary { background: rgba(18, 23, 34, 0.88); }
/* ---------- Sites ---------- */
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-header h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.home-header p { margin: 4px 0 0; color: var(--muted); }
.site-list { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.site-card {
display: flex; flex-direction: column; gap: 12px; text-align: left;
width: 100%; background: var(--surface); border: 1px solid var(--border);
border-radius: 18px; padding: 16px; color: var(--text);
}
.site-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.site-card .name { font-size: 19px; font-weight: 600; line-height: 1.25; }
.site-card .coords { font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.site-card .footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.compass-labels {
display: flex; justify-content: space-between;
font-family: var(--font-num); font-size: 11px; color: var(--faint);
}
.progress { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.empty {
margin-top: 40px; text-align: center; color: var(--muted);
display: flex; flex-direction: column; gap: 6px; align-items: center;
}
/* ---------- Setup ---------- */
.how-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.35; }
/* ---------- Capture ---------- */
.capture { height: 100dvh; display: flex; flex-direction: column; background: var(--bg); max-width: 480px; margin: 0 auto; }
.cap-view { position: relative; flex: 1; overflow: hidden; background: #000; }
.cap-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cap-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cap-top {
position: absolute; left: 12px; right: 12px; top: calc(var(--safe-top) + 12px);
display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.cap-top .icon-btn { border-radius: 22px; background: var(--scrim); }
.cap-title {
display: flex; flex-direction: column; align-items: center; gap: 2px;
background: var(--scrim); border-radius: 14px; padding: 6px 14px; min-width: 0;
}
.cap-title .n { font-size: 15px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-title .f { font-family: var(--font-num); font-size: 11px; color: var(--text2); }
.cap-strip {
position: absolute; left: 20px; right: 20px; top: calc(var(--safe-top) + 68px);
display: flex; flex-direction: column; gap: 4px;
background: var(--scrim); border-radius: 12px; padding: 8px;
}
.cap-strip canvas { width: 100%; height: 40px; display: block; border-radius: 4px; }
.cap-strip .compass-labels { font-size: 10px; color: var(--text2); }
.cap-hint {
position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 156px);
display: flex; justify-content: center; pointer-events: none;
}
.cap-hint span { background: var(--scrim); border-radius: 10px; padding: 7px 12px; font-size: 14px; }
.cap-warn {
position: absolute; left: 20px; right: 20px; bottom: 16px;
display: flex; align-items: center; gap: 10px;
background: rgba(30, 26, 16, 0.92); border: 1px solid var(--warn-border);
border-radius: 12px; padding: 8px 8px 8px 12px;
}
.cap-warn span { flex: 1; font-size: 13px; line-height: 1.3; }
.cap-warn button {
height: 44px; padding: 0 12px; border-radius: 10px; border: none;
background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700;
}
.cap-start {
position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
align-items: center; justify-content: center; padding: 24px; text-align: center;
background: rgba(10, 13, 19, 0.85);
}
.cap-panel {
flex: none; padding: 14px 20px calc(var(--safe-bottom) + 24px);
border-top: 1px solid var(--surface2); display: flex; flex-direction: column; gap: 14px;
}
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.readouts > div { display: flex; flex-direction: column; gap: 2px; }
.readouts .k { font-family: var(--font-num); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.readouts .v { font-family: var(--font-num); font-size: 20px; font-weight: 500; line-height: 26px; }
.readouts .v.small { font-size: 15px; }
.readouts .v.ok { color: var(--info); }
.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; }
.auto-btn {
height: 48px; padding: 0 14px; border-radius: 14px; font-size: 15px; font-weight: 600;
border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.auto-btn.on { border-color: var(--info); background: var(--info-bg); color: var(--info); }
.shutter {
width: 80px; height: 80px; border-radius: 40px; border: 4px solid var(--accent);
background: transparent; padding: 5px; display: flex; justify-self: center;
}
.shutter span { flex: 1; border-radius: 34px; background: var(--accent); }
.shutter:not(:disabled):active span { background: var(--accent-hover); }
.shutter.flash span { background: #fff; }
.finish-btn {
justify-self: end; height: 48px; padding: 0 16px; border-radius: 14px;
border: 1px solid var(--border-strong); background: var(--surface);
display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600;
}
/* ---------- Review ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend > span { display: flex; align-items: center; gap: 6px; }
.slider { width: 100%; height: 28px; accent-color: var(--info); margin: 0; }
.pano-zoom {
margin-top: 12px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
touch-action: none; position: relative;
}
.pano-zoom canvas { display: block; width: 100%; aspect-ratio: 350 / 210; }
.pano-overview { touch-action: none; }
.pano-overview canvas { display: block; width: 100%; height: 40px; border-radius: 6px; }
.north-row {
display: flex; align-items: center; gap: 10px;
background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
padding: 10px 10px 10px 14px;
}
.north-row .val { font-family: var(--font-num); font-size: 16px; min-width: 56px; text-align: right; }
.step-btn {
width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong);
background: var(--surface2); font-size: 20px; padding: 0;
}
.busy { display: flex; align-items: center; justify-content: center; min-height: 160px; color: var(--muted); }
/* ---------- Export ---------- */
.format-card {
display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.format-card.on { background: var(--surface2); border-color: var(--accent); }
.format-card.disabled { opacity: 0.5; cursor: default; }
.format-card input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.format-card .t { font-size: 16px; font-weight: 600; }
.format-card .ext {
font-family: var(--font-num); font-size: 11px; padding: 2px 6px; border-radius: 6px;
background: var(--surface2); color: var(--text2);
}
.format-card.on .ext { background: var(--bg); }
.format-card .d { font-size: 13px; line-height: 1.35; color: var(--muted); }
.code-box {
margin-top: 8px; height: 196px; overflow: auto; border-radius: 14px;
background: #06080C; border: 1px solid var(--surface2); padding: 12px 14px;
font-family: var(--font-num); font-size: 12px; line-height: 1.55; color: var(--text2);
white-space: pre;
}
.code-box .foot { margin-top: 4px; color: var(--faint); }
/* ---------- Calibrate / settings ---------- */
.calib-panel { flex: none; padding: 16px 20px calc(var(--safe-bottom) + 24px); display: flex; flex-direction: column; gap: 12px; }
.calib-bar { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.calib-bar > div { height: 100%; background: var(--info); transition: width 0.3s; }
.fatal {
position: fixed; left: 12px; right: 12px; top: calc(var(--safe-top) + 8px); z-index: 100;
padding: 10px 12px; border-radius: 12px; background: #2A1410; border: 1px solid #5A2A1E;
font-size: 13px; color: var(--text);
}
+11
View File
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import basicSsl from '@vitejs/plugin-basic-ssl'
export default defineConfig({
plugins: [react(), basicSsl()],
server: {
fs: { allow: ['..'] },
host: '0.0.0.0',
},
})