A second flavor of openGym (VITE_MOBILE=1) that runs entirely on the phone: no account, no server, no sync. State is mirrored into a file in the app's private storage (survives WebView storage eviction), the workout-day reminder is a native local notification scheduled on planned weekdays, and backups export through the OS share sheet. Exercise media loads from the same CDN as the demo build. npm run build:mobile, then Android Studio / Xcode — see docs/MOBILE.md. NOTICE.md gains an AGPL §7 app-store exception.
15 lines
487 B
React
15 lines
487 B
React
import { StrictMode } from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import App from './App.jsx'
|
|
import { MOBILE } from './lib/mobile.js'
|
|
import './index.css'
|
|
|
|
createRoot(document.getElementById('root')).render(
|
|
<StrictMode><App /></StrictMode>
|
|
)
|
|
|
|
// Not in the mobile build: the native shell already serves everything from disk.
|
|
if (!MOBILE && 'serviceWorker' in navigator && location.protocol === 'https:') {
|
|
navigator.serviceWorker.register('sw.js').catch(() => {})
|
|
}
|