Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9248d0645 | ||
|
|
0d6f853775 | ||
|
|
841018451d | ||
|
|
15d3176a0b | ||
|
|
67e55bc931 | ||
|
|
8d3265732e | ||
|
|
15eab9f75c | ||
|
|
ca6d0c1a51 | ||
|
|
edac1da85c | ||
|
|
48ee4615d1 | ||
|
|
631a3d4666 |
No files matched your search
@@ -0,0 +1,122 @@
|
||||
name: Netlify
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: netlify-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Site
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mapfile -t packages < .github/apt/web-packages.txt
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y "${packages[@]}" tcl
|
||||
|
||||
- name: Set Up Emscripten
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
|
||||
"$HOME/emsdk/emsdk" install latest
|
||||
"$HOME/emsdk/emsdk" activate latest
|
||||
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
|
||||
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
|
||||
echo "$HOME/emsdk" >> "$GITHUB_PATH"
|
||||
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Build Site
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make site
|
||||
test -f build/site/index.html
|
||||
test -f build/site/build/web/index.html
|
||||
test -f build/site/build/web/index.js
|
||||
test -f build/site/build/web/index.wasm
|
||||
|
||||
- name: Upload Site Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: inbe-site
|
||||
path: build/site
|
||||
if-no-files-found: error
|
||||
|
||||
deploy-preview:
|
||||
name: Deploy Preview
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
steps:
|
||||
- name: Download Site Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: inbe-site
|
||||
path: build/site
|
||||
|
||||
- name: Install Netlify CLI
|
||||
run: npm install --global netlify-cli
|
||||
|
||||
- name: Deploy Preview To Netlify
|
||||
run: |
|
||||
set -euo pipefail
|
||||
auth_token="$(printf '%s' "$NETLIFY_AUTH_TOKEN" | tr -d '\r\n')"
|
||||
site_id="$(printf '%s' "$NETLIFY_SITE_ID" | tr -d '\r\n')"
|
||||
netlify deploy \
|
||||
--dir build/site \
|
||||
--alias "pr-${{ github.event.pull_request.number }}" \
|
||||
--message "Preview ${{ github.event.pull_request.number }}" \
|
||||
--auth "$auth_token" \
|
||||
--site "$site_id"
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
|
||||
deploy-production:
|
||||
name: Deploy Production
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||
|
||||
steps:
|
||||
- name: Download Site Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: inbe-site
|
||||
path: build/site
|
||||
|
||||
- name: Install Netlify CLI
|
||||
run: npm install --global netlify-cli
|
||||
|
||||
- name: Deploy Production To Netlify
|
||||
run: |
|
||||
set -euo pipefail
|
||||
auth_token="$(printf '%s' "$NETLIFY_AUTH_TOKEN" | tr -d '\r\n')"
|
||||
site_id="$(printf '%s' "$NETLIFY_SITE_ID" | tr -d '\r\n')"
|
||||
netlify deploy \
|
||||
--dir build/site \
|
||||
--prod \
|
||||
--message "Production ${{ github.sha }}" \
|
||||
--auth "$auth_token" \
|
||||
--site "$site_id"
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
@@ -295,7 +295,7 @@ jobs:
|
||||
path: |
|
||||
vendor-builds/windows
|
||||
vendor-builds/sqlite
|
||||
key: windows-vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile', 'vendor/raylib/src/**', 'vendor/curl/**', 'vendor/sqlite/**') }}
|
||||
key: windows-vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile', 'vendor/flint/vendor/raylib/src/**', 'vendor/curl/**', 'vendor/sqlite/**') }}
|
||||
restore-keys: |
|
||||
windows-vendor-${{ runner.os }}-${{ runner.arch }}-
|
||||
|
||||
@@ -371,7 +371,7 @@ jobs:
|
||||
path: |
|
||||
droid/app/.cxx
|
||||
droid/app/build/intermediates/cxx
|
||||
key: android-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('droid/app/src/main/cpp/CMakeLists.txt', 'droid/app/build.gradle', 'src/**/*.c', 'src/**/*.h', 'flint/src/**/*.c', 'flint/include/**/*.h', 'vendor/raylib/src/**') }}
|
||||
key: android-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('droid/app/src/main/cpp/CMakeLists.txt', 'droid/app/build.gradle', 'src/**/*.c', 'src/**/*.h', 'flint/src/**/*.c', 'flint/include/**/*.h', 'vendor/flint/vendor/raylib/src/**') }}
|
||||
restore-keys: |
|
||||
android-native-${{ runner.os }}-${{ runner.arch }}-
|
||||
|
||||
@@ -518,16 +518,22 @@ jobs:
|
||||
merge-multiple: true
|
||||
|
||||
- name: Install Butler
|
||||
uses: AnimMouse/setup-butler@v1
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Check Butler
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y unzip
|
||||
butler -V
|
||||
curl -fsSL \
|
||||
https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default \
|
||||
-o "$RUNNER_TEMP/butler.zip"
|
||||
mkdir -p "$RUNNER_TEMP/butler"
|
||||
unzip -q "$RUNNER_TEMP/butler.zip" -d "$RUNNER_TEMP/butler"
|
||||
chmod +x "$RUNNER_TEMP/butler/butler"
|
||||
echo "$RUNNER_TEMP/butler" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Check Butler
|
||||
run: |
|
||||
set -euo pipefail
|
||||
butler version
|
||||
|
||||
- name: Publish Release Builds to itch.io
|
||||
run: |
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
[submodule "vendor/raylib"]
|
||||
path = vendor/raylib
|
||||
url = https://github.com/raysan5/raylib.git
|
||||
[submodule "vendor/rini"]
|
||||
path = vendor/rini
|
||||
url = https://github.com/raysan5/rini.git
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
# Changelog
|
||||
## [1.6.2] - 2026-06-27
|
||||
## Changed
|
||||
- Improve sun salutation
|
||||
|
||||
## [1.6.1] - 2026-06-27
|
||||
## Changed
|
||||
- Improved notification in session
|
||||
- Standardized settings screen1
|
||||
|
||||
## [1.6.0] - 2026-06-26
|
||||
### Added
|
||||
- Sun Salutation practice with Yoga habit sync support.
|
||||
|
||||
### Changed
|
||||
- Improve sync reliability and review handling.
|
||||
|
||||
## [1.5.9] - 2026-06-26
|
||||
### Fixed
|
||||
- Android session notification and wakelock for screen-locked playback
|
||||
|
||||
## [1.5.8] - 2026-06-25
|
||||
### Fixed
|
||||
- Background play for meditation practice
|
||||
|
||||
@@ -61,7 +61,8 @@ CHROME_WEB_STORE_DIR := $(BUILD_DIST_DIR)/chrome-web-store
|
||||
VERSION_FILE := src/core/version.h
|
||||
APP_VERSION := $(shell sed -n 's/^#define INBE_VERSION_STRING "\([^"]*\)".*/\1/p' $(VERSION_FILE) 2>/dev/null)
|
||||
|
||||
RAYLIB_DIR := vendor/raylib/src
|
||||
FLINT_DIR := vendor/flint
|
||||
RAYLIB_DIR = $(FLINT_DIR)/vendor/raylib/src
|
||||
RAYLIB_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)/raylib
|
||||
RAYLIB_A := $(RAYLIB_BUILD_DIR)/libraylib.a
|
||||
WIN64_ARCH := x86_64
|
||||
@@ -94,7 +95,6 @@ WEB_RAYLIB_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/raylib
|
||||
WEB_RAYLIB_A := $(WEB_RAYLIB_BUILD_DIR)/libraylib.web.a
|
||||
RAYLIB_SOURCES := $(shell find $(RAYLIB_DIR) -type f \( -name '*.c' -o -name '*.h' \))
|
||||
|
||||
FLINT_DIR := vendor/flint
|
||||
FLINT_ICON_FILES := $(wildcard $(FLINT_DIR)/icons/*.png)
|
||||
FLINT_ICON_ASSETS_C := $(FLINT_DIR)/src/flint_icon_assets.c
|
||||
FLINT_ICON_STAMP := $(BUILD_OBJ_DIR)/flint-icons.sha256
|
||||
@@ -159,6 +159,8 @@ APP_SRCS := \
|
||||
src/practices/meditation/meditation_session.c \
|
||||
src/practices/meditation/meditation_manual.c \
|
||||
src/practices/meditation/meditation_config.c \
|
||||
src/practices/sun_salutation/sun_salutation_practice.c \
|
||||
src/practices/sun_salutation/sun_salutation_session.c \
|
||||
src/screens/habits_screen.c \
|
||||
src/screens/statistics_screen.c \
|
||||
src/screens/habits/edit.c \
|
||||
@@ -178,12 +180,13 @@ APP_SRCS := \
|
||||
src/screens/manual_screen.c \
|
||||
src/screens/settings/settings_screen.c \
|
||||
src/screens/settings/settings_device.c \
|
||||
src/screens/settings/settings_session.c \
|
||||
src/screens/settings/settings_theme.c \
|
||||
src/screens/settings/settings_data.c \
|
||||
src/screens/settings/settings_sync_account.c
|
||||
|
||||
LOCALE_FILES := $(wildcard locales/*.txt)
|
||||
IMAGE_FILES := assets/practices/whm/1.jpg assets/practices/whm/2.jpg assets/practices/meditation/1.jpg
|
||||
IMAGE_FILES := assets/practices/whm/1.jpg assets/practices/whm/2.jpg assets/practices/meditation/1.jpg $(wildcard assets/practices/sunsalutation/pos_*.png)
|
||||
SOUND_FILES := $(wildcard assets/sounds/*.ogg)
|
||||
FONT_OUTPUTS := assets/fonts/locales.png assets/fonts/locales.dat
|
||||
OTFCHOP_DIR ?= $(FLINT_DIR)/tools/otfchop
|
||||
@@ -193,7 +196,7 @@ EMBEDDED_ASSETS_C := $(BUILD_OBJ_DIR)/$(APP_NAME)_embedded_assets.c
|
||||
EMBEDDED_ASSET_FILES := $(LOCALE_FILES) $(IMAGE_FILES) $(SOUND_FILES) $(FONT_OUTPUTS)
|
||||
SRC := $(APP_SRCS) $(EMBEDDED_ASSETS_C)
|
||||
|
||||
APP_INCLUDE := -Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party
|
||||
APP_INCLUDE := -Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/practices/sun_salutation -Isrc/storage -Isrc/platform/android -Isrc/third_party
|
||||
APP_RAYLIB_CONFIG := $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT_PNG=0 -DSUPPORT_FILEFORMAT_JPG=0 -DSUPPORT_FILEFORMAT_OGG=0 -DSUPPORT_FILEFORMAT_MP3=%,$(RAY_RAYLIB_CONFIG)) -DSUPPORT_MODULE_RAUDIO=1 -DSUPPORT_FILEFORMAT_JPG=1 -DSUPPORT_FILEFORMAT_OGG=1 -DSUPPORT_FILEFORMAT_MP3=0
|
||||
CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_EMBEDDED_ONLY=1 $(FLINT_RUNTIME_ASSET_CFLAGS)
|
||||
WINDOWS_CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_EMBEDDED_ONLY=1
|
||||
@@ -244,7 +247,7 @@ UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
|
||||
UNPACKAGED_AUDIO_FILES := $(shell find $(UNPACKAGED_AUDIO_DIR) -type f 2>/dev/null)
|
||||
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
|
||||
|
||||
.PHONY: all native run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-debug-fast android-release android-bundle android-install android-install-fast android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web chrome-web-store
|
||||
.PHONY: all native run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-debug-fast android-release android-bundle android-install android-install-fast android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web site chrome-web-store
|
||||
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle click
|
||||
|
||||
all: native
|
||||
@@ -334,7 +337,7 @@ test: $(TESTS)
|
||||
|
||||
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/screens/habits_screen.h src/screens/habits/habits.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/raylib/src $(FLINT_INCLUDE) $(SQLITE_INCLUDE) \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -I$(RAYLIB_DIR) $(FLINT_INCLUDE) $(SQLITE_INCLUDE) \
|
||||
-o $@ \
|
||||
tests/storage_import_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/third_party/miniz.c $(SQLITE_SRC) \
|
||||
-Wl,--gc-sections -lm -lpthread -ldl
|
||||
@@ -346,20 +349,20 @@ $(LOCALE_KEYS_TEST): tests/locale_keys_test.c $(LOCALE_FILES) | $(TEST_BIN_DIR)
|
||||
|
||||
$(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sync_client.h $(CURL_PROTOCOL_CHECK) | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -Wno-unused-function -std=c99 -D_DEFAULT_SOURCE -DINBE_SYNC_CLIENT_TESTS -ffunction-sections -fdata-sections \
|
||||
-Isrc/storage -Isrc -Isrc/core -Ivendor/flint/include -Ivendor/raylib/src $(FLINT_CURL_CFLAGS) -o $@ \
|
||||
-Isrc/storage -Isrc -Isrc/core $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(FLINT_CURL_CFLAGS) -o $@ \
|
||||
tests/sync_url_test.c src/storage/sync_client.c \
|
||||
-Wl,--gc-sections $(FLINT_CURL_LDLIBS)
|
||||
|
||||
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/flint/include -Ivendor/raylib/src $(SQLITE_INCLUDE) \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
|
||||
-o $@ \
|
||||
tests/sync_account_test.c src/storage/sync_account.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
|
||||
-Wl,--gc-sections -lm -lpthread -ldl
|
||||
|
||||
$(SYNC_REVIEW_TEST): tests/sync_review_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/flint/include -Ivendor/raylib/src $(SQLITE_INCLUDE) \
|
||||
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
|
||||
-o $@ \
|
||||
tests/sync_review_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
|
||||
-Wl,--gc-sections -lm -lpthread -ldl
|
||||
@@ -371,7 +374,7 @@ $(FONT_LOCALE_TEST): tests/font_locale_test.c $(FONT_OUTPUTS) | $(TEST_BIN_DIR)
|
||||
|
||||
$(GUIDE_OVERLAY_TEST): tests/guide_overlay_test.c vendor/flint/src/ui/guide.c vendor/flint/include/flint_ui.h | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE \
|
||||
-Ivendor/flint/include -Ivendor/raylib/src \
|
||||
$(FLINT_INCLUDE) -I$(RAYLIB_DIR) \
|
||||
-o $@ \
|
||||
tests/guide_overlay_test.c
|
||||
|
||||
@@ -1031,6 +1034,9 @@ web:
|
||||
rm -f $(WEB_DIST_ZIP)
|
||||
cd $(WEB_DIST_DIR) && zip -9 -r $(abspath $(WEB_DIST_ZIP)) .
|
||||
|
||||
site: web
|
||||
tclsh site/build.tcl
|
||||
|
||||
chrome-web-store: $(CHROME_WEB_STORE_ZIP)
|
||||
|
||||
$(CHROME_WEB_STORE_ZIP): $(WEB_TARGET) $(CHROME_WEB_STORE_MANIFEST) $(CHROME_WEB_STORE_WORKER) $(CHROME_WEB_STORE_ICONS) | $(CHROME_WEB_STORE_DIR)
|
||||
|
||||
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 941 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 907 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 934 B |
|
After Width: | Height: | Size: 961 B |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -35,8 +35,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 35
|
||||
versionCode 54
|
||||
versionName "1.5.8"
|
||||
versionCode 58
|
||||
versionName "1.6.2"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
<application
|
||||
android:hasCode="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@@ -32,5 +34,10 @@
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<service
|
||||
android:name="xyz.waozi.inbe.SessionForegroundService"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="mediaPlayback" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -11,8 +11,8 @@ endif()
|
||||
|
||||
set(REPO_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../../..")
|
||||
set(SRC_DIR "${REPO_ROOT}/src")
|
||||
set(RAYLIB_DIR "${REPO_ROOT}/vendor/raylib/src")
|
||||
set(FLINT_DIR "${REPO_ROOT}/vendor/flint")
|
||||
set(RAYLIB_DIR "${FLINT_DIR}/vendor/raylib/src")
|
||||
set(SQLITE_DIR "${REPO_ROOT}/vendor/sqlite")
|
||||
set(SQLITE_BUILD_DIR "${CMAKE_BINARY_DIR}/sqlite")
|
||||
set(SQLITE_AMALGAMATION_C "${SQLITE_BUILD_DIR}/sqlite3.c")
|
||||
@@ -31,6 +31,14 @@ set(INBE_EMBEDDED_INPUTS
|
||||
assets/practices/whm/1.jpg
|
||||
assets/practices/whm/2.jpg
|
||||
assets/practices/meditation/1.jpg
|
||||
assets/practices/sunsalutation/pos_0001.png
|
||||
assets/practices/sunsalutation/pos_0002.png
|
||||
assets/practices/sunsalutation/pos_0003.png
|
||||
assets/practices/sunsalutation/pos_0004.png
|
||||
assets/practices/sunsalutation/pos_0005.png
|
||||
assets/practices/sunsalutation/pos_0006.png
|
||||
assets/practices/sunsalutation/pos_0007.png
|
||||
assets/practices/sunsalutation/pos_0008.png
|
||||
assets/fonts/locales.png
|
||||
assets/fonts/locales.dat
|
||||
${INBE_SOUND_ASSETS}
|
||||
@@ -110,6 +118,8 @@ add_library(main SHARED
|
||||
"${SRC_DIR}/practices/meditation/meditation_session.c"
|
||||
"${SRC_DIR}/practices/meditation/meditation_manual.c"
|
||||
"${SRC_DIR}/practices/meditation/meditation_config.c"
|
||||
"${SRC_DIR}/practices/sun_salutation/sun_salutation_practice.c"
|
||||
"${SRC_DIR}/practices/sun_salutation/sun_salutation_session.c"
|
||||
"${SRC_DIR}/screens/habits_screen.c"
|
||||
"${SRC_DIR}/screens/statistics_screen.c"
|
||||
"${SRC_DIR}/screens/habits/edit.c"
|
||||
@@ -133,6 +143,7 @@ add_library(main SHARED
|
||||
"${SRC_DIR}/screens/manual_screen.c"
|
||||
"${SRC_DIR}/screens/settings/settings_screen.c"
|
||||
"${SRC_DIR}/screens/settings/settings_device.c"
|
||||
"${SRC_DIR}/screens/settings/settings_session.c"
|
||||
"${SRC_DIR}/screens/settings/settings_theme.c"
|
||||
"${SRC_DIR}/screens/settings/settings_data.c"
|
||||
"${SRC_DIR}/screens/settings/settings_sync_account.c"
|
||||
@@ -153,6 +164,7 @@ target_include_directories(main PRIVATE
|
||||
"${SRC_DIR}/practices"
|
||||
"${SRC_DIR}/practices/whm"
|
||||
"${SRC_DIR}/practices/meditation"
|
||||
"${SRC_DIR}/practices/sun_salutation"
|
||||
"${SRC_DIR}/storage"
|
||||
"${SRC_DIR}/platform/android"
|
||||
"${SRC_DIR}/third_party"
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.graphics.Insets;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.view.DisplayCutout;
|
||||
@@ -53,11 +52,11 @@ public class MainActivity extends NativeActivity {
|
||||
// [status_bar, nav_bar, cutout_left, cutout_top, cutout_right, cutout_bottom]
|
||||
private final int[] cachedInsets = new int[6];
|
||||
private boolean insetsInitialized = false;
|
||||
private PowerManager.WakeLock wakeLock = null;
|
||||
private boolean activityPaused = false;
|
||||
private boolean windowFocused = true;
|
||||
private boolean backgroundExecutionActive = false;
|
||||
private boolean autoPausedForLifecycle = false;
|
||||
private boolean notificationPermissionRequestInFlight = false;
|
||||
private int lastDeleteRepeatCount = -1;
|
||||
|
||||
private native void nativeSetInsets(int status, int nav,
|
||||
@@ -79,14 +78,17 @@ public class MainActivity extends NativeActivity {
|
||||
private native void nativeTextInputEnter();
|
||||
private native void nativeInvalidateGraphicsResources();
|
||||
|
||||
private void requestDownloadNotificationPermissionIfNeeded() {
|
||||
private void requestNotificationPermissionIfNeeded() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED &&
|
||||
!notificationPermissionRequestInFlight) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED &&
|
||||
!notificationPermissionRequestInFlight) {
|
||||
notificationPermissionRequestInFlight = true;
|
||||
requestPermissions(new String[] { Manifest.permission.POST_NOTIFICATIONS },
|
||||
REQUEST_POST_NOTIFICATIONS);
|
||||
}
|
||||
@@ -95,8 +97,19 @@ public class MainActivity extends NativeActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == REQUEST_POST_NOTIFICATIONS) {
|
||||
notificationPermissionRequestInFlight = false;
|
||||
boolean granted = grantResults.length > 0 &&
|
||||
grantResults[0] == PackageManager.PERMISSION_GRANTED;
|
||||
Log.d(TAG, "Notification permission result: granted=" + granted);
|
||||
}
|
||||
}
|
||||
|
||||
private NotificationManager getDownloadNotificationManager() {
|
||||
requestDownloadNotificationPermissionIfNeeded();
|
||||
requestNotificationPermissionIfNeeded();
|
||||
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (manager != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
@@ -592,31 +605,27 @@ public class MainActivity extends NativeActivity {
|
||||
}
|
||||
|
||||
public void acquireWakeLock() {
|
||||
Log.d(TAG, "acquireWakeLock called - wakeLock=" + wakeLock);
|
||||
if (wakeLock == null) {
|
||||
Log.d(TAG, "Creating new PARTIAL_WAKE_LOCK");
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
wakeLock = pm.newWakeLock(
|
||||
PowerManager.PARTIAL_WAKE_LOCK,
|
||||
"inbe:meditation_session"
|
||||
);
|
||||
wakeLock.acquire();
|
||||
Log.d(TAG, "Wake lock acquired successfully - held=" + wakeLock.isHeld());
|
||||
Log.d(TAG, "Starting session foreground service");
|
||||
requestNotificationPermissionIfNeeded();
|
||||
Intent intent = new Intent(this, SessionForegroundService.class);
|
||||
intent.setAction(SessionForegroundService.ACTION_START);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForegroundService(intent);
|
||||
} else {
|
||||
Log.d(TAG, "Wake lock already exists - held=" + wakeLock.isHeld());
|
||||
startService(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public void releaseWakeLock() {
|
||||
Log.d(TAG, "releaseWakeLock called - wakeLock=" + wakeLock);
|
||||
if (wakeLock != null && wakeLock.isHeld()) {
|
||||
Log.d(TAG, "Releasing wake lock - was held=" + wakeLock.isHeld());
|
||||
wakeLock.release();
|
||||
Log.d(TAG, "Wake lock released successfully");
|
||||
wakeLock = null;
|
||||
} else {
|
||||
Log.d(TAG, "Wake lock not held - wakeLock=" + wakeLock + " isHeld=" + (wakeLock != null ? wakeLock.isHeld() : "null"));
|
||||
}
|
||||
Log.d(TAG, "Stopping session foreground service");
|
||||
Intent intent = new Intent(this, SessionForegroundService.class);
|
||||
intent.setAction(SessionForegroundService.ACTION_STOP);
|
||||
stopService(intent);
|
||||
}
|
||||
|
||||
public void updateSessionNotification(final String statusText) {
|
||||
if (statusText == null || statusText.isEmpty()) return;
|
||||
SessionForegroundService.updateStatus(statusText);
|
||||
}
|
||||
|
||||
public void keepScreenOn() {
|
||||
@@ -654,6 +663,7 @@ public class MainActivity extends NativeActivity {
|
||||
|
||||
// Notify native code that activity is ready for wake lock
|
||||
nativeWakeLockReady();
|
||||
requestNotificationPermissionIfNeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
package xyz.waozi.inbe;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ServiceInfo;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
|
||||
public class SessionForegroundService extends Service {
|
||||
public static final String ACTION_START = "xyz.waozi.inbe.action.START_SESSION_FOREGROUND";
|
||||
public static final String ACTION_STOP = "xyz.waozi.inbe.action.STOP_SESSION_FOREGROUND";
|
||||
private static final String TAG = "InbeSessionService";
|
||||
private static final String CHANNEL_ID = "active_session";
|
||||
private static final int NOTIFICATION_ID = 3001;
|
||||
private static String currentStatusText = "";
|
||||
private static SessionForegroundService activeService = null;
|
||||
|
||||
private PowerManager.WakeLock wakeLock = null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
activeService = this;
|
||||
ensureNotificationChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
String action = intent != null ? intent.getAction() : ACTION_START;
|
||||
|
||||
if (ACTION_STOP.equals(action)) {
|
||||
stopSession();
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
startSession();
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
releaseWakeLock();
|
||||
stopForegroundCompat();
|
||||
if (activeService == this) {
|
||||
activeService = null;
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void startSession() {
|
||||
Notification notification = buildNotification();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
startForeground(
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
|
||||
);
|
||||
} else {
|
||||
startForeground(NOTIFICATION_ID, notification);
|
||||
}
|
||||
acquireWakeLock();
|
||||
Log.d(TAG, "Session foreground service started");
|
||||
}
|
||||
|
||||
private void stopSession() {
|
||||
releaseWakeLock();
|
||||
stopForegroundCompat();
|
||||
stopSelf();
|
||||
Log.d(TAG, "Session foreground service stopped");
|
||||
}
|
||||
|
||||
public static void updateStatus(String statusText) {
|
||||
if (statusText != null && !statusText.isEmpty()) {
|
||||
currentStatusText = statusText;
|
||||
}
|
||||
|
||||
SessionForegroundService service = activeService;
|
||||
if (service == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationManager manager =
|
||||
(NotificationManager)service.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (manager != null) {
|
||||
manager.notify(NOTIFICATION_ID, service.buildNotification());
|
||||
}
|
||||
}
|
||||
|
||||
private void stopForegroundCompat() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
stopForeground(STOP_FOREGROUND_REMOVE);
|
||||
} else {
|
||||
stopForeground(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void acquireWakeLock() {
|
||||
if (wakeLock != null && wakeLock.isHeld()) {
|
||||
return;
|
||||
}
|
||||
|
||||
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
|
||||
if (pm == null) {
|
||||
Log.e(TAG, "PowerManager unavailable; cannot acquire wakelock");
|
||||
return;
|
||||
}
|
||||
|
||||
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "inbe:active_session");
|
||||
wakeLock.setReferenceCounted(false);
|
||||
wakeLock.acquire();
|
||||
Log.d(TAG, "Session wakelock acquired");
|
||||
}
|
||||
|
||||
private void releaseWakeLock() {
|
||||
if (wakeLock != null && wakeLock.isHeld()) {
|
||||
wakeLock.release();
|
||||
Log.d(TAG, "Session wakelock released");
|
||||
}
|
||||
wakeLock = null;
|
||||
}
|
||||
|
||||
private Notification buildNotification() {
|
||||
Intent launchIntent = new Intent(this, MainActivity.class);
|
||||
launchIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
int pendingFlags = PendingIntent.FLAG_UPDATE_CURRENT;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
pendingFlags |= PendingIntent.FLAG_IMMUTABLE;
|
||||
}
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, pendingFlags);
|
||||
|
||||
Notification.Builder builder = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||
? new Notification.Builder(this, CHANNEL_ID)
|
||||
: new Notification.Builder(this);
|
||||
|
||||
CharSequence title = getApplicationInfo().loadLabel(getPackageManager());
|
||||
builder.setSmallIcon(android.R.drawable.ic_media_play)
|
||||
.setContentTitle(title)
|
||||
.setContentText(currentStatusText)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true)
|
||||
.setShowWhen(false);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setCategory(Notification.CATEGORY_TRANSPORT)
|
||||
.setVisibility(Notification.VISIBILITY_PUBLIC);
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private void ensureNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationManager manager =
|
||||
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (manager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
CHANNEL_ID,
|
||||
getApplicationInfo().loadLabel(getPackageManager()),
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Fixed
|
||||
---
|
||||
- Android session notification and wakelock for screen-locked playback
|
||||
@@ -0,0 +1,6 @@
|
||||
Added
|
||||
---
|
||||
- Sun Salutation practice with Yoga habit sync support.
|
||||
Changed
|
||||
---
|
||||
- Improve sync reliability and review handling.
|
||||
@@ -0,0 +1,2 @@
|
||||
- Improved notification in session
|
||||
- Standardized settings screen1
|
||||
@@ -0,0 +1 @@
|
||||
- Improve sun salutation
|
||||
@@ -37,6 +37,63 @@ Wim Hofovo dýchání
|
||||
[exercise_meditation]
|
||||
Meditace
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Pracuje se
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Opakovani
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Pocatecni tempo
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Koncove tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Nahled tempa
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
Prvni opakovani zacina pomaleji a tempo se pak postupne zvysuje.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Krok 1: hora
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Krok 2: pozdrav vzhuru
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Krok 3: predklon ve stoje
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Krok 4: polovicni zdvih
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Krok 5: prkno
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Krok 6: nizke prkno
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Krok 7: pes hlavou vzhuru
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Krok 8: pes hlavou dolu
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Krok 9: polovicni zdvih
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Krok 10: predklon ve stoje
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Krok 11: pozdrav vzhuru
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Krok 12: hora
|
||||
---
|
||||
[meditation_title]
|
||||
Meditace
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Kruh
|
||||
Hlasitost
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Zobrazit ovládání hlasitosti v sezeních
|
||||
Zobrazit ovladani hlasitosti
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Obnovit výchozí
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Relace je aktivni
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Nadech a vydech: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Zadrz: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Nadech: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Dalsi kolo
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Wim-Hof-Atmung
|
||||
[exercise_meditation]
|
||||
Meditation
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
In Arbeit
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Wiederholungen
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Starttempo
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Endtempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Tempo-Vorschau
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
Die erste Wiederholung beginnt langsamer, danach wird das Tempo schrittweise schneller.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Schritt 1: Berghaltung
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Schritt 2: Gestreckte Berghaltung
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Schritt 3: Vorbeuge im Stand
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Schritt 4: Halbe Vorbeuge
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Schritt 5: Planke
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Schritt 6: Tiefe Planke
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Schritt 7: Heraufschauender Hund
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Schritt 8: Herabschauender Hund
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Schritt 9: Halbe Vorbeuge
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Schritt 10: Vorbeuge im Stand
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Schritt 11: Gestreckte Berghaltung
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Schritt 12: Berghaltung
|
||||
---
|
||||
[meditation_title]
|
||||
Meditation
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Kreis
|
||||
Lautstärke
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Lautstärkeregler in Sitzungen anzeigen
|
||||
Lautstaerkeregler anzeigen
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Auf Standard zurücksetzen
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sitzung aktiv
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Ein und aus: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Halten: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Einatmen: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Naechste Runde
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Wim Hof Breathing
|
||||
[exercise_meditation]
|
||||
Meditation
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Work in progress
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Repetitions
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Start tempo
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
End tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Tempo preview
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
First repetition starts slower, then the pace gradually increases.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Step 1: Mountain pose
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Step 2: Upward salute
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Step 3: Standing forward fold
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Step 4: Half lift
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Step 5: Plank
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Step 6: Low plank
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Step 7: Upward-facing dog
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Step 8: Downward-facing dog
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Step 9: Half lift
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Step 10: Standing forward fold
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Step 11: Upward salute
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Step 12: Mountain pose
|
||||
---
|
||||
[meditation_title]
|
||||
Meditation
|
||||
---
|
||||
@@ -326,7 +383,7 @@ Circle
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Show volume control in sessions
|
||||
Show volume control
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Reset to defaults
|
||||
@@ -866,3 +923,21 @@ Fade
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
---
|
||||
[notification_session_active]
|
||||
Session active
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Starting: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
In & out: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Hold: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Breath in: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Next round
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Respiración Wim Hof
|
||||
[exercise_meditation]
|
||||
Meditación
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Trabajo en curso
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Repeticiones
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Tempo inicial
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Tempo final
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Vista previa del tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
La primera repeticion empieza mas lenta y luego el ritmo aumenta gradualmente.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Paso 1: postura de la montana
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Paso 2: saludo hacia arriba
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Paso 3: flexion hacia delante
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Paso 4: media elevacion
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Paso 5: plancha
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Paso 6: plancha baja
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Paso 7: perro boca arriba
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Paso 8: perro boca abajo
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Paso 9: media elevacion
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Paso 10: flexion hacia delante
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Paso 11: saludo hacia arriba
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Paso 12: postura de la montana
|
||||
---
|
||||
[meditation_title]
|
||||
Meditación
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Circulo
|
||||
Volumen
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Mostrar control de volumen en las sesiones
|
||||
Mostrar control de volumen
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Restablecer valores predeterminados
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesion activa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Inhala y exhala: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Retencion: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Inhala: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Siguiente ronda
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Respiration Wim Hof
|
||||
[exercise_meditation]
|
||||
Méditation
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Travail en cours
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Repetitions
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Tempo initial
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Tempo final
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Apercu du tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
La premiere repetition commence plus lentement, puis le rythme augmente progressivement.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Etape 1 : posture de la montagne
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Etape 2 : salut vers le haut
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Etape 3 : flexion avant debout
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Etape 4 : demi-flexion
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Etape 5 : planche
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Etape 6 : planche basse
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Etape 7 : chien tete en haut
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Etape 8 : chien tete en bas
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Etape 9 : demi-flexion
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Etape 10 : flexion avant debout
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Etape 11 : salut vers le haut
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Etape 12 : posture de la montagne
|
||||
---
|
||||
[meditation_title]
|
||||
Méditation
|
||||
---
|
||||
@@ -269,7 +326,7 @@ Cercle
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Afficher le contrôle du volume pendant les séances
|
||||
Afficher le controle du volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Réinitialiser
|
||||
@@ -863,3 +920,21 @@ None
|
||||
Fade
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
---
|
||||
[notification_session_active]
|
||||
Session active
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Demarrage : %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Inspirez et expirez : %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Retention : %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Inspirez : %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Tour suivant
|
||||
@@ -37,6 +37,63 @@ Pernapasan Wim Hof
|
||||
[exercise_meditation]
|
||||
Meditasi
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Sedang dikerjakan
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Pengulangan
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Tempo awal
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Tempo akhir
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Pratinjau tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
Pengulangan pertama dimulai lebih lambat, lalu tempo meningkat bertahap.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Langkah 1: pose gunung
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Langkah 2: salam ke atas
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Langkah 3: lipatan depan berdiri
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Langkah 4: setengah angkat
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Langkah 5: plank
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Langkah 6: plank rendah
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Langkah 7: anjing menghadap atas
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Langkah 8: anjing menghadap bawah
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Langkah 9: setengah angkat
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Langkah 10: lipatan depan berdiri
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Langkah 11: salam ke atas
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Langkah 12: pose gunung
|
||||
---
|
||||
[meditation_title]
|
||||
Meditasi
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Lingkaran
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Tampilkan kontrol volume di sesi
|
||||
Tampilkan kontrol volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Reset ke default
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesi aktif
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Mulai: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Tarik dan hembus: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Tahan: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Tarik napas: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Ronde berikutnya
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Respirazione Wim Hof
|
||||
[exercise_meditation]
|
||||
Meditazione
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Lavoro in corso
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Ripetizioni
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Tempo iniziale
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Tempo finale
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Anteprima del tempo
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
La prima ripetizione inizia piu lenta, poi il ritmo aumenta gradualmente.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Passo 1: posizione della montagna
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Passo 2: saluto verso l'alto
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Passo 3: piegamento in avanti
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Passo 4: mezzo sollevamento
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Passo 5: plank
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Passo 6: plank basso
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Passo 7: cane a testa in su
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Passo 8: cane a testa in giu
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Passo 9: mezzo sollevamento
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Passo 10: piegamento in avanti
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Passo 11: saluto verso l'alto
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Passo 12: posizione della montagna
|
||||
---
|
||||
[meditation_title]
|
||||
Meditazione
|
||||
---
|
||||
@@ -320,7 +377,7 @@ Cerchio
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Mostra il controllo volume nelle sessioni
|
||||
Mostra il controllo volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Ripristina predefiniti
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessione attiva
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Avvio: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Dentro e fuori: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Trattieni: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Inspira: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Round successivo
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@
|
||||
[exercise_meditation]
|
||||
瞑想
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
作業中
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
反復回数
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
開始テンポ
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
終了テンポ
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
テンポのプレビュー
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
最初の反復はゆっくり始まり、その後少しずつ速くなります。
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
ステップ1: 山のポーズ
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
ステップ2: 上向きの礼拝
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
ステップ3: 立位前屈
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
ステップ4: 半分の前屈
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
ステップ5: プランク
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
ステップ6: ロープランク
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
ステップ7: 上向きの犬のポーズ
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
ステップ8: 下向きの犬のポーズ
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
ステップ9: 半分の前屈
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
ステップ10: 立位前屈
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
ステップ11: 上向きの礼拝
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
ステップ12: 山のポーズ
|
||||
---
|
||||
[meditation_title]
|
||||
瞑想
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Double tap screen to breathe
|
||||
音量
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
セッション中に音量コントロールを表示
|
||||
音量コントロールを表示
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
デフォルトに戻す
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
セッション中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
開始: %d秒
|
||||
---
|
||||
[notification_breathing_count]
|
||||
吸って吐く: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
ホールド: %d秒
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
吸う: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
次のラウンド
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Inner Breeze
|
||||
[exercise_meditation]
|
||||
명상
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
작업 중
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
반복 횟수
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
시작 템포
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
종료 템포
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
템포 미리보기
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
첫 반복은 더 천천히 시작하고 이후 템포가 점차 빨라집니다.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
1단계: 산 자세
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
2단계: 위로 올리는 인사
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
3단계: 선 전굴
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
4단계: 반 들어올리기
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
5단계: 플랭크
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
6단계: 낮은 플랭크
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
7단계: 업독
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
8단계: 다운독
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
9단계: 반 들어올리기
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
10단계: 선 전굴
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
11단계: 위로 올리는 인사
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
12단계: 산 자세
|
||||
---
|
||||
[meditation_title]
|
||||
명상
|
||||
---
|
||||
@@ -320,7 +377,7 @@ Double tap screen to breathe
|
||||
음량
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
세션에서 볼륨 조절 표시
|
||||
볼륨 조절 표시
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
기본값으로 재설정
|
||||
@@ -862,3 +919,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
세션 진행 중
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
시작: %d초
|
||||
---
|
||||
[notification_breathing_count]
|
||||
들이쉬고 내쉬기: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
홀드: %d초
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
들이쉬기: %d초
|
||||
---
|
||||
[notification_next_round]
|
||||
다음 라운드
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Respiração Wim Hof
|
||||
[exercise_meditation]
|
||||
Meditação
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
Trabalho em andamento
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Repeticoes
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Ritmo inicial
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Ritmo final
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Previa do ritmo
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
A primeira repeticao comeca mais lenta e o ritmo aumenta gradualmente.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Passo 1: postura da montanha
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Passo 2: saudacao para cima
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Passo 3: flexao para a frente
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Passo 4: meia elevacao
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Passo 5: prancha
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Passo 6: prancha baixa
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Passo 7: cao olhando para cima
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Passo 8: cao olhando para baixo
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Passo 9: meia elevacao
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Passo 10: flexao para a frente
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Passo 11: saudacao para cima
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Passo 12: postura da montanha
|
||||
---
|
||||
[meditation_title]
|
||||
Meditação
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Circulo
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Mostrar controle de volume nas sessões
|
||||
Mostrar controle de volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Restaurar padrões
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessao ativa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Inspire e expire: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Segure: %ds
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Inspire: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Proxima rodada
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Inner Breeze
|
||||
[exercise_meditation]
|
||||
Медитация
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
В работе
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
Повторения
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
Начальный темп
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
Конечный темп
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
Предпросмотр темпа
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
Первое повторение начинается медленнее, затем темп постепенно растет.
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
Шаг 1: поза горы
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
Шаг 2: вытяжение вверх
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
Шаг 3: наклон вперед стоя
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
Шаг 4: половинный подъем
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
Шаг 5: планка
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
Шаг 6: низкая планка
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
Шаг 7: собака мордой вверх
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
Шаг 8: собака мордой вниз
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
Шаг 9: половинный подъем
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
Шаг 10: наклон вперед стоя
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
Шаг 11: вытяжение вверх
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
Шаг 12: поза горы
|
||||
---
|
||||
[meditation_title]
|
||||
Медитация
|
||||
---
|
||||
@@ -323,7 +380,7 @@ Double tap screen to breathe
|
||||
Громкость
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Показывать регулятор громкости в сеансах
|
||||
Показывать регулятор громкости
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Сбросить настройки
|
||||
@@ -863,3 +920,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Сессия активна
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Старт: %dс
|
||||
---
|
||||
[notification_breathing_count]
|
||||
Вдох и выдох: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
Задержка: %dс
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
Вдох: %dс
|
||||
---
|
||||
[notification_next_round]
|
||||
Следующий раунд
|
||||
---
|
||||
---
|
||||
@@ -37,6 +37,63 @@ Wim Hof 呼吸
|
||||
[exercise_meditation]
|
||||
冥想
|
||||
---
|
||||
[exercise_sun_salutation]
|
||||
Sun Salutation
|
||||
---
|
||||
[sun_salutation_work_in_progress]
|
||||
进行中
|
||||
---
|
||||
[sun_salutation_repetitions_label]
|
||||
重复次数
|
||||
---
|
||||
[sun_salutation_start_speed_label]
|
||||
开始节奏
|
||||
---
|
||||
[sun_salutation_end_speed_label]
|
||||
结束节奏
|
||||
---
|
||||
[sun_salutation_tempo_preview_label]
|
||||
节奏预览
|
||||
---
|
||||
[sun_salutation_tempo_preview_hint]
|
||||
第一轮会慢一些开始,然后节奏逐渐加快。
|
||||
---
|
||||
[sun_salutation_step_1]
|
||||
第1步:山式
|
||||
---
|
||||
[sun_salutation_step_2]
|
||||
第2步:上举礼
|
||||
---
|
||||
[sun_salutation_step_3]
|
||||
第3步:站立前屈
|
||||
---
|
||||
[sun_salutation_step_4]
|
||||
第4步:半前屈
|
||||
---
|
||||
[sun_salutation_step_5]
|
||||
第5步:平板式
|
||||
---
|
||||
[sun_salutation_step_6]
|
||||
第6步:低平板式
|
||||
---
|
||||
[sun_salutation_step_7]
|
||||
第7步:上犬式
|
||||
---
|
||||
[sun_salutation_step_8]
|
||||
第8步:下犬式
|
||||
---
|
||||
[sun_salutation_step_9]
|
||||
第9步:半前屈
|
||||
---
|
||||
[sun_salutation_step_10]
|
||||
第10步:站立前屈
|
||||
---
|
||||
[sun_salutation_step_11]
|
||||
第11步:上举礼
|
||||
---
|
||||
[sun_salutation_step_12]
|
||||
第12步:山式
|
||||
---
|
||||
[meditation_title]
|
||||
冥想
|
||||
---
|
||||
@@ -266,7 +323,7 @@ Double tap screen to breathe
|
||||
音量
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
在会话中显示音量控制
|
||||
显示音量控制
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
恢复默认
|
||||
@@ -861,3 +918,22 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
练习进行中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
开始: %d秒
|
||||
---
|
||||
[notification_breathing_count]
|
||||
吸气和呼气: %d
|
||||
---
|
||||
[notification_hold_seconds]
|
||||
屏息: %d秒
|
||||
---
|
||||
[notification_breath_in_seconds]
|
||||
吸气: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
下一轮
|
||||
---
|
||||
---
|
||||
@@ -0,0 +1,240 @@
|
||||
#!/usr/bin/env tclsh
|
||||
|
||||
set script_dir [file dirname [file normalize [info script]]]
|
||||
set root_dir [file dirname $script_dir]
|
||||
set out_dir [file join $root_dir build site]
|
||||
set web_dir [file join $root_dir build dist web]
|
||||
|
||||
proc read_file {path} {
|
||||
set fh [open $path r]
|
||||
fconfigure $fh -encoding utf-8
|
||||
set data [read $fh]
|
||||
close $fh
|
||||
return $data
|
||||
}
|
||||
|
||||
proc write_file {path data} {
|
||||
file mkdir [file dirname $path]
|
||||
set fh [open $path w]
|
||||
fconfigure $fh -encoding utf-8
|
||||
puts -nonewline $fh $data
|
||||
close $fh
|
||||
}
|
||||
|
||||
proc app_version {} {
|
||||
global root_dir
|
||||
set path [file join $root_dir src core version.h]
|
||||
foreach line [split [read_file $path] "\n"] {
|
||||
if {[regexp {^#define INBE_VERSION_STRING "([^"]+)"} $line -> version]} {
|
||||
return $version
|
||||
}
|
||||
}
|
||||
error "could not read app version from $path"
|
||||
}
|
||||
|
||||
proc expand_text {text version} {
|
||||
return [string map [list "\${version}" $version] $text]
|
||||
}
|
||||
|
||||
proc copy_path {src dst} {
|
||||
if {![file exists $src]} {
|
||||
error "required path missing: $src"
|
||||
}
|
||||
file mkdir [file dirname $dst]
|
||||
file copy -force $src $dst
|
||||
}
|
||||
|
||||
proc copy_template_path {src dst version} {
|
||||
set ext [string tolower [file extension $src]]
|
||||
if {$ext in {.html .htm .txt .xml .json .css .js}} {
|
||||
write_file $dst [expand_text [read_file $src] $version]
|
||||
} else {
|
||||
copy_path $src $dst
|
||||
}
|
||||
}
|
||||
|
||||
proc copy_dir_template {src dst version} {
|
||||
if {![file isdirectory $src]} {
|
||||
error "required directory missing: $src"
|
||||
}
|
||||
foreach item [glob -nocomplain -directory $src *] {
|
||||
set target [file join $dst [file tail $item]]
|
||||
if {[file isdirectory $item]} {
|
||||
copy_dir_template $item $target $version
|
||||
} else {
|
||||
copy_template_path $item $target $version
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc copy_dir_contents {src dst} {
|
||||
if {![file isdirectory $src]} {
|
||||
error "required directory missing: $src"
|
||||
}
|
||||
file mkdir $dst
|
||||
foreach item [glob -nocomplain -directory $src *] {
|
||||
file copy -force $item $dst
|
||||
}
|
||||
}
|
||||
|
||||
proc web_app_csp_html {html} {
|
||||
set csp "default-src 'self' data: blob:; connect-src 'self' https://api.waozi.xyz wss://api.waozi.xyz; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://telegram.org; style-src 'self' 'unsafe-inline'; worker-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob:; frame-src https:; img-src data: https:; media-src https:; object-src 'none'"
|
||||
set meta "<meta http-equiv=\"Content-Security-Policy\" content=\"$csp\">"
|
||||
set version [clock seconds]
|
||||
regsub -all {src="index\.js(\?v=[0-9A-Za-z._-]+)?\"} $html "src=\"index.js?v=$version\"" html
|
||||
if {[regsub {<meta http-equiv="Content-Security-Policy"[^>]*>} $html $meta html]} {
|
||||
return $html
|
||||
}
|
||||
if {[regsub {(<meta charset="[^"]+"[^>]*>)} $html "\\1\n $meta" html]} {
|
||||
return $html
|
||||
}
|
||||
regsub {</head>} $html " $meta\n </head>" html
|
||||
return $html
|
||||
}
|
||||
|
||||
proc telegram_web_app_html {html} {
|
||||
set viewport "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no, viewport-fit=cover\">"
|
||||
if {![regsub {<meta name="viewport"[^>]*>} $html $viewport html]} {
|
||||
regsub {</head>} $html "\t$viewport\n</head>" html
|
||||
}
|
||||
|
||||
set css {
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
overscroll-behavior: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--tg-theme-bg-color, #181818);
|
||||
color: var(--tg-theme-text-color, #ffffff);
|
||||
}
|
||||
|
||||
canvas,
|
||||
canvas.emscripten {
|
||||
display: block;
|
||||
width: 100vw !important;
|
||||
height: 100vh !important;
|
||||
height: 100dvh !important;
|
||||
touch-action: none;
|
||||
}
|
||||
}
|
||||
if {![regsub {</style>} $html "$css\n </style>" html]} {
|
||||
regsub {</head>} $html "<style>$css\n </style>\n</head>" html
|
||||
}
|
||||
|
||||
set script {
|
||||
<script src="https://telegram.org/js/telegram-web-app.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var tg = window.Telegram && window.Telegram.WebApp;
|
||||
if (tg) {
|
||||
tg.ready();
|
||||
tg.expand();
|
||||
if (tg.disableVerticalSwipes) tg.disableVerticalSwipes();
|
||||
if (tg.setBackgroundColor) {
|
||||
tg.setBackgroundColor((tg.themeParams && tg.themeParams.bg_color) || '#181818');
|
||||
}
|
||||
if (tg.setHeaderColor) {
|
||||
tg.setHeaderColor((tg.themeParams && tg.themeParams.bg_color) || '#181818');
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('touchmove', function(event) {
|
||||
event.preventDefault();
|
||||
}, { passive: false });
|
||||
|
||||
document.addEventListener('gesturestart', function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
set script_tag [string first "<script>" $html]
|
||||
if {$script_tag >= 0} {
|
||||
set before [string range $html 0 [expr {$script_tag - 1}]]
|
||||
set after [string range $html $script_tag end]
|
||||
set html "$before$script\n $after"
|
||||
} else {
|
||||
regsub {</body>} $html "$script\n </body>" html
|
||||
}
|
||||
return $html
|
||||
}
|
||||
|
||||
proc require_output {path} {
|
||||
global out_dir
|
||||
if {![file exists [file join $out_dir $path]]} {
|
||||
error "required output missing: $path"
|
||||
}
|
||||
}
|
||||
|
||||
proc main {} {
|
||||
global root_dir script_dir out_dir web_dir
|
||||
set version [app_version]
|
||||
|
||||
file delete -force $out_dir
|
||||
file mkdir $out_dir
|
||||
copy_dir_contents [file join $script_dir css] [file join $out_dir css]
|
||||
copy_path [file join $script_dir themes inbe.css] [file join $out_dir theme.css]
|
||||
write_file [file join $out_dir style.css] "@import url('/css/base.css');\n@import url('/css/components.css');\n@import url('/theme.css');\n"
|
||||
copy_dir_template [file join $script_dir static] $out_dir $version
|
||||
write_file [file join $out_dir index.html] [expand_text [read_file [file join $script_dir index.html]] $version]
|
||||
|
||||
foreach pair {
|
||||
{web-assets web-assets}
|
||||
{site-icons site-icons}
|
||||
} {
|
||||
lassign $pair src dst
|
||||
copy_dir_contents [file join $root_dir $src] [file join $out_dir $dst]
|
||||
}
|
||||
|
||||
copy_dir_contents $web_dir [file join $out_dir build web]
|
||||
set web_index [file join $out_dir build web index.html]
|
||||
write_file $web_index [web_app_csp_html [read_file $web_index]]
|
||||
|
||||
copy_dir_contents [file join $out_dir build web] [file join $out_dir build telegram]
|
||||
set telegram_index [file join $out_dir build telegram index.html]
|
||||
write_file $telegram_index [telegram_web_app_html [read_file $telegram_index]]
|
||||
|
||||
foreach path {
|
||||
index.html
|
||||
privacy.html
|
||||
delete-account.html
|
||||
delete-account/index.html
|
||||
legacy-converter.html
|
||||
manifest.json
|
||||
robots.txt
|
||||
sitemap.xml
|
||||
og.jpg
|
||||
web-assets/dl/inbe-meditation-audio-v1.zip
|
||||
web-assets/icons/inbe.png
|
||||
web-assets/icons/github.png
|
||||
web-assets/icons/itch.png
|
||||
build/web/index.html
|
||||
build/web/index.js
|
||||
build/web/index.wasm
|
||||
build/telegram/index.html
|
||||
build/telegram/index.js
|
||||
build/telegram/index.wasm
|
||||
site-icons/favicon-32x32.png
|
||||
css/base.css
|
||||
css/components.css
|
||||
theme.css
|
||||
} {
|
||||
require_output $path
|
||||
}
|
||||
puts "built Inbe site at $out_dir"
|
||||
}
|
||||
|
||||
if {[catch {main} message]} {
|
||||
puts stderr "Error: $message"
|
||||
exit 1
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
@font-face {
|
||||
font-family: departure;
|
||||
src: url('/assets/DepartureMono-Regular.otf');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--page-bg: #000000;
|
||||
--page-tile: url('/icons/tile.png');
|
||||
--page-tile-opacity: 0.32;
|
||||
--panel-bg: #ffffea;
|
||||
--dark: #557777;
|
||||
--shadow: #000000;
|
||||
--light: #ffffff;
|
||||
--button-bg: #d9d9d9;
|
||||
--button-highlight: #ffffff;
|
||||
--button-inset: #ffffff;
|
||||
--link: #1133aa;
|
||||
--link-hover: #0044cc;
|
||||
--ink: #172020;
|
||||
--muted: color-mix(in srgb, var(--dark) 74%, #ffffff);
|
||||
--panel-shadow: rgba(0, 0, 0, 0.34);
|
||||
--font-main: departure, monospace;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--page-bg);
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
color: var(--ink);
|
||||
cursor: url('/cursors/arrow.png') 0 0, auto;
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
background-image: var(--page-tile);
|
||||
background-repeat: repeat;
|
||||
background-size: 128px 128px;
|
||||
image-rendering: pixelated;
|
||||
opacity: var(--page-tile-opacity);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
line-height: 1.52;
|
||||
margin: 24px auto;
|
||||
padding: 28px;
|
||||
font-family: var(--font-main);
|
||||
font-size: 16px;
|
||||
background-color: var(--panel-bg);
|
||||
max-width: 960px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid var(--dark);
|
||||
box-shadow:
|
||||
inset 1px 1px 0 0 var(--button-highlight),
|
||||
4px 4px 0 0 var(--panel-shadow);
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 56px;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
color: var(--dark);
|
||||
line-height: 1.15;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 12px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
p {
|
||||
max-width: 68ch;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
|
||||
a {
|
||||
font-family: var(--font-main);
|
||||
color: var(--link);
|
||||
text-decoration: none;
|
||||
cursor: url('/cursors/sight.png') 0 0, pointer;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--link-hover);
|
||||
}
|
||||
|
||||
a:active {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
}
|
||||
|
||||
button,
|
||||
.tk-button {
|
||||
display: inline-block;
|
||||
color: #000000;
|
||||
font-family: var(--font-main);
|
||||
font-size: 14px;
|
||||
padding: 6px 12px;
|
||||
cursor: url('/cursors/sight.png') 0 0, pointer;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
background-color: var(--button-bg);
|
||||
border: 2px solid var(--button-highlight);
|
||||
border-right-color: var(--dark);
|
||||
border-bottom-color: var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
transition: background-color 0.12s ease, transform 0.08s ease;
|
||||
}
|
||||
|
||||
button:active,
|
||||
.tk-button:active {
|
||||
border-color: var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--button-highlight),
|
||||
inset 1px 1px 0 0 var(--shadow);
|
||||
}
|
||||
|
||||
button:hover,
|
||||
.tk-button:hover {
|
||||
background-color: var(--button-highlight);
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="file"] {
|
||||
font-family: var(--font-main);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
padding: 6px 8px;
|
||||
outline: none;
|
||||
border: 2px solid var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
box-shadow:
|
||||
inset 1px 1px 0 0 var(--shadow),
|
||||
1px 1px 0 0 var(--button-highlight);
|
||||
cursor: url('/cursors/reading.png') 8 8, text;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
footer p {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.content {
|
||||
padding: 16px;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,464 @@
|
||||
.hero {
|
||||
text-align: center;
|
||||
padding: 8px 0 4px;
|
||||
}
|
||||
|
||||
.hero img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.hero .tk-img {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.version {
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
color: var(--dark);
|
||||
margin: 8px 0 16px;
|
||||
padding: 2px 8px;
|
||||
background: var(--button-bg);
|
||||
border: 1px solid var(--dark);
|
||||
border-radius: 999px;
|
||||
opacity: 0.86;
|
||||
}
|
||||
|
||||
.minor-link {
|
||||
text-align: center;
|
||||
margin-top: 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.tk-img {
|
||||
border: 1px solid var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
inset 1px 1px 0 0 var(--shadow),
|
||||
1px 1px 0 0 var(--button-highlight);
|
||||
}
|
||||
|
||||
.pfp-img {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin: 0 auto 32px;
|
||||
display: block;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
|
||||
.section-icon {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
gap: 16px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.project-card {
|
||||
width: 320px;
|
||||
height: 320px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
text-align: left;
|
||||
padding: 24px;
|
||||
background: var(--card-bg, #d8d8c8);
|
||||
border: 2px solid;
|
||||
border-color: var(--button-highlight) var(--dark) var(--dark) var(--button-highlight);
|
||||
border-radius: 6px;
|
||||
box-shadow: 2px 2px 0 var(--shadow), inset 1px 1px 0 var(--button-inset);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
box-sizing: border-box;
|
||||
transition: background-color 0.12s ease, transform 0.08s ease, box-shadow 0.08s ease;
|
||||
}
|
||||
|
||||
.project-card img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.project-card h2 {
|
||||
margin: 0 0 12px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.project-card p {
|
||||
margin: 0;
|
||||
flex-grow: 1;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.project-card:hover {
|
||||
background: var(--card-hover-bg, #e0e0d0);
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.project-card:active {
|
||||
background: var(--card-active-bg, #c8c8b8);
|
||||
transform: translate(1px, 1px);
|
||||
box-shadow: 1px 1px 0 var(--shadow), inset 1px 1px 0 var(--button-inset);
|
||||
}
|
||||
|
||||
.platform-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.platform-btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
padding: 14px 10px;
|
||||
background-color: var(--button-bg);
|
||||
border: 2px solid var(--button-highlight);
|
||||
border-right-color: var(--dark);
|
||||
border-bottom-color: var(--dark);
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
text-decoration: none;
|
||||
color: var(--dark);
|
||||
border-radius: 6px;
|
||||
transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
|
||||
width: 108px;
|
||||
min-height: 82px;
|
||||
box-sizing: border-box;
|
||||
cursor: url('/cursors/sight.png') 0 0, pointer;
|
||||
}
|
||||
|
||||
.platform-btn img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.platform-btn span {
|
||||
font-family: var(--font-main);
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.platform-btn:active {
|
||||
border-color: var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--button-highlight),
|
||||
inset 1px 1px 0 0 var(--shadow);
|
||||
transform: translate(1px, 1px);
|
||||
}
|
||||
|
||||
.platform-btn.web:hover {
|
||||
background-color: var(--hover-web, #ddeeff);
|
||||
}
|
||||
|
||||
.platform-btn.android:hover {
|
||||
background-color: var(--hover-android, #ddffdd);
|
||||
}
|
||||
|
||||
.platform-btn.windows:hover {
|
||||
background-color: var(--hover-windows, #ffdddd);
|
||||
}
|
||||
|
||||
.platform-btn.linux:hover {
|
||||
background-color: var(--hover-linux, #ffffdd);
|
||||
}
|
||||
|
||||
.platform-section {
|
||||
margin: 0 0 28px;
|
||||
padding: 14px;
|
||||
background: color-mix(in srgb, var(--panel-bg) 86%, var(--button-highlight));
|
||||
border: 1px solid var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
2px 2px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
}
|
||||
|
||||
.platform-section + .platform-section {
|
||||
margin-top: 22px;
|
||||
}
|
||||
|
||||
.platform-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.platform-header img {
|
||||
flex: 0 0 48px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.platform-header p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.platform-header strong {
|
||||
display: block;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.downloads-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.download-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 42px;
|
||||
padding: 8px 10px;
|
||||
background-color: var(--button-bg);
|
||||
border: 2px solid var(--button-highlight);
|
||||
border-right-color: var(--dark);
|
||||
border-bottom-color: var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
color: var(--dark);
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
box-sizing: border-box;
|
||||
transition: transform 0.08s ease, background-color 0.12s ease, box-shadow 0.08s ease;
|
||||
}
|
||||
|
||||
.download-item:hover {
|
||||
background-color: var(--button-highlight);
|
||||
}
|
||||
|
||||
.download-item:active {
|
||||
border-color: var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--button-highlight),
|
||||
inset 1px 1px 0 0 var(--shadow);
|
||||
transform: translate(1px, 1px);
|
||||
}
|
||||
|
||||
.features-section,
|
||||
.about-section,
|
||||
.info-section,
|
||||
.migration-section {
|
||||
margin: 28px 0;
|
||||
}
|
||||
|
||||
.features-section h2,
|
||||
.about-section h2,
|
||||
.migration-section h2 {
|
||||
margin-bottom: 16px;
|
||||
color: var(--dark);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.features-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.feature-item {
|
||||
padding: 14px;
|
||||
background-color: var(--panel-bg);
|
||||
border: 2px solid var(--button-highlight);
|
||||
border-right-color: var(--dark);
|
||||
border-bottom-color: var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
2px 2px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
font-family: var(--font-main);
|
||||
}
|
||||
|
||||
.feature-item h3 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 15px;
|
||||
color: var(--dark);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.feature-item p,
|
||||
.about-section p,
|
||||
.migration-section p {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.about-section p,
|
||||
.migration-section p {
|
||||
margin: 12px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.benefits-list {
|
||||
padding-left: 20px;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.benefits-list li {
|
||||
margin-bottom: 6px;
|
||||
line-height: 1.4;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.safety-note {
|
||||
font-size: 12px;
|
||||
opacity: 0.72;
|
||||
margin-top: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dropdown summary {
|
||||
cursor: url('/cursors/sight.png') 0 0, pointer;
|
||||
font-weight: bold;
|
||||
padding: 8px 12px;
|
||||
background-color: var(--button-bg);
|
||||
border: 2px solid var(--button-highlight);
|
||||
border-right-color: var(--dark);
|
||||
border-bottom-color: var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
font-family: var(--font-main);
|
||||
}
|
||||
|
||||
.dropdown[open] summary {
|
||||
border-color: var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--button-highlight),
|
||||
inset 1px 1px 0 0 var(--shadow);
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
padding: 12px;
|
||||
background-color: var(--panel-bg);
|
||||
border: 2px solid var(--dark);
|
||||
border-right-color: var(--button-highlight);
|
||||
border-bottom-color: var(--button-highlight);
|
||||
margin-top: 8px;
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
1px 1px 0 0 var(--shadow),
|
||||
inset 1px 1px 0 0 var(--button-inset);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.dropdown-content p {
|
||||
margin: 0 0 12px;
|
||||
font-size: 13px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.dropdown-links {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.dropdown-links a {
|
||||
color: var(--link);
|
||||
text-decoration: none;
|
||||
padding: 6px 12px;
|
||||
background-color: var(--button-bg);
|
||||
border: 1px solid var(--dark);
|
||||
border-radius: 6px;
|
||||
font-family: var(--font-main);
|
||||
font-size: 13px;
|
||||
cursor: url('/cursors/sight.png') 0 0, pointer;
|
||||
}
|
||||
|
||||
.dropdown-links a:hover {
|
||||
background-color: var(--button-highlight);
|
||||
}
|
||||
|
||||
.converter-panel {
|
||||
margin: 24px 0;
|
||||
padding: 16px;
|
||||
background-color: var(--tool-panel-bg, var(--panel-bg));
|
||||
border: 2px solid var(--dark);
|
||||
border-radius: 6px;
|
||||
box-shadow:
|
||||
inset 1px 1px 0 0 var(--light),
|
||||
1px 1px 0 0 var(--button-highlight);
|
||||
}
|
||||
|
||||
.converter-panel label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.converter-status {
|
||||
margin: 16px 0 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.converter-status.error {
|
||||
color: #9b1c1c;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.platform-buttons {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.platform-btn {
|
||||
width: calc(50% - 5px);
|
||||
min-width: 0;
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.features-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.platform-header {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.downloads-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inner Breeze - Breathing, Meditation, and Habits</title>
|
||||
<meta name="description" content="Inner Breeze is a free, open-source breathing and meditation app with Wim Hof breathing, meditation timers, optional background music, habit tracking, themes, and local-first history.">
|
||||
<link rel="canonical" href="https://inbe.waozi.xyz/">
|
||||
<link href="/css/base.css" rel="stylesheet">
|
||||
<link href="/css/components.css" rel="stylesheet">
|
||||
<link href="/theme.css" rel="stylesheet">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/site-icons/favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" href="/site-icons/apple-touch-icon.png">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://inbe.waozi.xyz/">
|
||||
<meta property="og:title" content="Inner Breeze">
|
||||
<meta property="og:description" content="Breathing, meditation sessions, habit tracking, themes, and local-first progress history.">
|
||||
<meta property="og:image" content="https://inbe.waozi.xyz/og.jpg">
|
||||
<meta property="og:site_name" content="Inner Breeze">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Inner Breeze">
|
||||
<meta name="twitter:description" content="Breathing, meditation sessions, habit tracking, themes, and local-first progress history.">
|
||||
<meta name="twitter:image" content="https://inbe.waozi.xyz/og.jpg">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<main id="main-content">
|
||||
<section class="hero" aria-label="App introduction and download options">
|
||||
<img class="tk-img" src="/web-assets/icons/inbe.png" width="128" alt="Inner Breeze app logo">
|
||||
<h1>Inner Breeze</h1>
|
||||
<p>calm breathing, meditation sessions, and habit tracking</p>
|
||||
<p class="version">${version}</p>
|
||||
<nav aria-label="Platform downloads" class="platform-buttons">
|
||||
<a href="/build/web/index.html" class="platform-btn web">
|
||||
<img src="/web-assets/icons/wasm.png" alt="">
|
||||
<span>Run Web</span>
|
||||
</a>
|
||||
<a href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-${version}.apk" class="platform-btn android" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/droid.png" alt="">
|
||||
<span>Android</span>
|
||||
</a>
|
||||
<a href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-windows.zip" class="platform-btn windows" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/win.png" alt="">
|
||||
<span>Windows</span>
|
||||
</a>
|
||||
<a href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-linux-x86_64.AppImage" class="platform-btn linux" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/tux.png" alt="">
|
||||
<span>Linux</span>
|
||||
</a>
|
||||
</nav>
|
||||
<nav aria-label="App store downloads" class="platform-buttons">
|
||||
<a href="https://play.google.com/store/apps/details?id=xyz.waozi.inbe" class="platform-btn android" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/playstore.png" alt="">
|
||||
<span>Play Store</span>
|
||||
</a>
|
||||
<a href="https://f-droid.org/packages/xyz.waozi.inbe/" class="platform-btn android" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/fdroid.png" alt="">
|
||||
<span>F-Droid</span>
|
||||
</a>
|
||||
<a href="https://waozi.itch.io/inbe" class="platform-btn web" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/itch.png" alt="">
|
||||
<span>itch.io</span>
|
||||
</a>
|
||||
</nav>
|
||||
</section>
|
||||
|
||||
<section class="features-section">
|
||||
<h2>Features</h2>
|
||||
<div class="features-grid">
|
||||
<div class="feature-item"><h3>Guided Breathing</h3><p>Wim Hof style rounds with clear breath cues, retention timing, and session flow.</p></div>
|
||||
<div class="feature-item"><h3>Meditation Timer</h3><p>Simple 5 minute to 2 hour meditation sessions with a gong and optional background music.</p></div>
|
||||
<div class="feature-item"><h3>Habit Tracking</h3><p>A focused calendar view helps you keep one practice selected and mark completed days.</p></div>
|
||||
<div class="feature-item"><h3>Local History</h3><p>Session data stays on your device, with import and export tools for your own backups.</p></div>
|
||||
<div class="feature-item"><h3>Touch Friendly</h3><p>Designed for phones, tablets, desktop, and the web with consistent controls.</p></div>
|
||||
<div class="feature-item"><h3>Free and Open Source</h3><p>No accounts, no ads, no tracking, and source code available under the MIT license.</p></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="migration-section">
|
||||
<h2>Migrating from inbe-legacy?</h2>
|
||||
<p>Use the web converter to turn an inbe-legacy JSON export into the ZIP format used by current Inner Breeze imports.</p>
|
||||
<p><a href="/legacy-converter.html">Open legacy data converter</a></p>
|
||||
</section>
|
||||
|
||||
<section class="about-section">
|
||||
<h2>Practice Safely</h2>
|
||||
<p>Inner Breeze includes intense breathing exercises and calmer meditation sessions. Choose the practice that fits the moment, stay seated or lying down, and keep the session gentle when you need rest.</p>
|
||||
<ul class="benefits-list">
|
||||
<li>Reduced stress and anxiety</li>
|
||||
<li>Improved focus and mental clarity</li>
|
||||
<li>Better sleep quality</li>
|
||||
<li>Enhanced cold tolerance</li>
|
||||
<li>Increased energy levels</li>
|
||||
</ul>
|
||||
<p class="safety-note"><em>Always practice breathing exercises in a safe environment. Never practice while driving, swimming, or in situations where loss of consciousness could be dangerous.</em></p>
|
||||
</section>
|
||||
|
||||
<section class="info-section">
|
||||
<nav aria-label="Source code" class="platform-buttons">
|
||||
<a href="https://github.com/waozixyz/inbe" class="platform-btn web" target="_blank" rel="noopener">
|
||||
<img src="/web-assets/icons/github.png" alt="">
|
||||
<span>GitHub</span>
|
||||
</a>
|
||||
</nav>
|
||||
<details class="dropdown">
|
||||
<summary>Privacy & Donations</summary>
|
||||
<div class="dropdown-content">
|
||||
<p><strong>Privacy:</strong> Inner Breeze is local-first. Session history, habits, and preferences stay on your device unless you choose to connect optional sync. Sync uses a public-key account identifier and sends only the app data needed to mirror your account on the selected server. No analytics, no tracking, and no sale of personal data.</p>
|
||||
<p><strong>Remote account deletion:</strong> Default sync-server accounts can be deleted at <a href="/delete-account">Delete Sync Account</a> using the exported <code>inbe-sync.key</code>, which includes the sync public ID. The exported key is used only to prove ownership and complete deletion.</p>
|
||||
<p><strong>Free & Open Source:</strong> This app is completely free with no ads, in-app purchases, or premium features. Development is supported by voluntary donations. Donations are processed outside the sync account system and are not app data.</p>
|
||||
<nav aria-label="Donation options" class="dropdown-links"><a href="https://trocador.app/en/anonpay/?ticker_to=xmr&network_to=Mainnet&address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&donation=True&simple_mode=True&amount=0.1&name=Inner+Breeze&[email protected]&ticker_from=xmr&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff" target="_blank" rel="noopener">Donate via Crypto</a></nav>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
</main>
|
||||
<footer><p>© 2026 <a href="https://waozi.xyz">Waozi</a> | <a href="/privacy.html">Privacy Policy</a></p></footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,189 @@
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
||||
// which is able to be used/called before the WASM is loaded.
|
||||
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
||||
// That way, this module can't be used before the WASM is finished loading.
|
||||
|
||||
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
||||
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
||||
// Instead, we want to return the previously loaded module
|
||||
|
||||
// TODO: Make this not declare a global if used in the browser
|
||||
var initSqlJsPromise = undefined;
|
||||
|
||||
var initSqlJs = function (moduleConfig) {
|
||||
|
||||
if (initSqlJsPromise){
|
||||
return initSqlJsPromise;
|
||||
}
|
||||
// If we're here, we've never called this function before
|
||||
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
|
||||
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
||||
// properties to it, like `preRun`, `postRun`, etc
|
||||
// We are using that to get notified when the WASM has finished loading.
|
||||
// Only then will we return our promise
|
||||
|
||||
// If they passed in a moduleConfig object, use that
|
||||
// Otherwise, initialize Module to the empty object
|
||||
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
||||
|
||||
// EMCC only allows for a single onAbort function (not an array of functions)
|
||||
// So if the user defined their own onAbort function, we remember it and call it
|
||||
var originalOnAbortFunction = Module['onAbort'];
|
||||
Module['onAbort'] = function (errorThatCausedAbort) {
|
||||
reject(new Error(errorThatCausedAbort));
|
||||
if (originalOnAbortFunction){
|
||||
originalOnAbortFunction(errorThatCausedAbort);
|
||||
}
|
||||
};
|
||||
|
||||
Module['postRun'] = Module['postRun'] || [];
|
||||
Module['postRun'].push(function () {
|
||||
// When Emscripted calls postRun, this promise resolves with the built Module
|
||||
resolveModule(Module);
|
||||
});
|
||||
|
||||
// There is a section of code in the emcc-generated code below that looks like this:
|
||||
// (Note that this is lowercase `module`)
|
||||
// if (typeof module !== 'undefined') {
|
||||
// module['exports'] = Module;
|
||||
// }
|
||||
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
||||
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
||||
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
||||
// So, we have three options:
|
||||
// 1) We undefine `module`
|
||||
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
||||
// 3) We write a script to remove those lines of code as part of the Make process.
|
||||
//
|
||||
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
||||
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
||||
// That's a nice side effect since we're handling the modularization efforts ourselves
|
||||
module = undefined;
|
||||
|
||||
// The emcc-generated code and shell-post.js code goes below,
|
||||
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
||||
var f;f||=typeof Module != 'undefined' ? Module : {};var aa="object"==typeof window,ba="function"==typeof importScripts,ca="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;"use strict";
|
||||
f.onRuntimeInitialized=function(){function a(g,l){switch(typeof l){case "boolean":fc(g,l?1:0);break;case "number":gc(g,l);break;case "string":hc(g,l,-1,-1);break;case "object":if(null===l)ib(g);else if(null!=l.length){var n=da(l,ea);ic(g,n,l.length,-1);fa(n)}else xa(g,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:ib(g)}}function b(g,l){for(var n=[],t=0;t<g;t+=1){var w=m(l+4*t,"i32"),A=jc(w);if(1===A||2===A)w=kc(w);else if(3===A)w=lc(w);else if(4===A){A=w;
|
||||
w=mc(A);A=nc(A);for(var N=new Uint8Array(w),M=0;M<w;M+=1)N[M]=p[A+M];w=N}else w=null;n.push(w)}return n}function c(g,l){this.Ka=g;this.db=l;this.Ia=1;this.eb=[]}function d(g,l){this.db=l;l=ha(g)+1;this.Xa=ia(l);if(null===this.Xa)throw Error("Unable to allocate memory for the SQL string");q(g,u,this.Xa,l);this.cb=this.Xa;this.Ta=this.hb=null}function e(g){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=g){var l=this.filename,n="/",t=l;n&&(n="string"==typeof n?n:ja(n),t=l?x(n+"/"+l):
|
||||
n);l=ka(!0,!0);t=la(t,(void 0!==l?l:438)&4095|32768,0);if(g){if("string"==typeof g){n=Array(g.length);for(var w=0,A=g.length;w<A;++w)n[w]=g.charCodeAt(w);g=n}ma(t,l|146);n=na(t,577);oa(n,g,0,g.length,0);pa(n);ma(t,l)}}this.handleError(r(this.filename,h));this.db=m(h,"i32");lb(this.db);this.Ya={};this.Ma={}}var h=y(4),k=f.cwrap,r=k("sqlite3_open","number",["string","number"]),z=k("sqlite3_close_v2","number",["number"]),v=k("sqlite3_exec","number",["number","string","number","number","number"]),E=k("sqlite3_changes",
|
||||
"number",["number"]),H=k("sqlite3_prepare_v2","number",["number","string","number","number","number"]),mb=k("sqlite3_sql","string",["number"]),oc=k("sqlite3_normalized_sql","string",["number"]),nb=k("sqlite3_prepare_v2","number",["number","number","number","number","number"]),pc=k("sqlite3_bind_text","number",["number","number","number","number","number"]),ob=k("sqlite3_bind_blob","number",["number","number","number","number","number"]),qc=k("sqlite3_bind_double","number",["number","number","number"]),
|
||||
rc=k("sqlite3_bind_int","number",["number","number","number"]),sc=k("sqlite3_bind_parameter_index","number",["number","string"]),tc=k("sqlite3_step","number",["number"]),uc=k("sqlite3_errmsg","string",["number"]),vc=k("sqlite3_column_count","number",["number"]),wc=k("sqlite3_data_count","number",["number"]),xc=k("sqlite3_column_double","number",["number","number"]),pb=k("sqlite3_column_text","string",["number","number"]),yc=k("sqlite3_column_blob","number",["number","number"]),zc=k("sqlite3_column_bytes",
|
||||
"number",["number","number"]),Ac=k("sqlite3_column_type","number",["number","number"]),Bc=k("sqlite3_column_name","string",["number","number"]),Cc=k("sqlite3_reset","number",["number"]),Dc=k("sqlite3_clear_bindings","number",["number"]),Ec=k("sqlite3_finalize","number",["number"]),qb=k("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),jc=k("sqlite3_value_type","number",["number"]),mc=k("sqlite3_value_bytes","number",["number"]),lc=k("sqlite3_value_text",
|
||||
"string",["number"]),nc=k("sqlite3_value_blob","number",["number"]),kc=k("sqlite3_value_double","number",["number"]),gc=k("sqlite3_result_double","",["number","number"]),ib=k("sqlite3_result_null","",["number"]),hc=k("sqlite3_result_text","",["number","string","number","number"]),ic=k("sqlite3_result_blob","",["number","number","number","number"]),fc=k("sqlite3_result_int","",["number","number"]),xa=k("sqlite3_result_error","",["number","string","number"]),rb=k("sqlite3_aggregate_context","number",
|
||||
["number","number"]),lb=k("RegisterExtensionFunctions","number",["number"]);c.prototype.bind=function(g){if(!this.Ka)throw"Statement closed";this.reset();return Array.isArray(g)?this.vb(g):null!=g&&"object"===typeof g?this.wb(g):!0};c.prototype.step=function(){if(!this.Ka)throw"Statement closed";this.Ia=1;var g=tc(this.Ka);switch(g){case 100:return!0;case 101:return!1;default:throw this.db.handleError(g);}};c.prototype.qb=function(g){null==g&&(g=this.Ia,this.Ia+=1);return xc(this.Ka,g)};c.prototype.zb=
|
||||
function(g){null==g&&(g=this.Ia,this.Ia+=1);g=pb(this.Ka,g);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(g)};c.prototype.Ab=function(g){null==g&&(g=this.Ia,this.Ia+=1);return pb(this.Ka,g)};c.prototype.getBlob=function(g){null==g&&(g=this.Ia,this.Ia+=1);var l=zc(this.Ka,g);g=yc(this.Ka,g);for(var n=new Uint8Array(l),t=0;t<l;t+=1)n[t]=p[g+t];return n};c.prototype.get=function(g,l){l=l||{};null!=g&&this.bind(g)&&this.step();g=[];for(var n=wc(this.Ka),t=0;t<n;t+=
|
||||
1)switch(Ac(this.Ka,t)){case 1:var w=l.useBigInt?this.zb(t):this.qb(t);g.push(w);break;case 2:g.push(this.qb(t));break;case 3:g.push(this.Ab(t));break;case 4:g.push(this.getBlob(t));break;default:g.push(null)}return g};c.prototype.getColumnNames=function(){for(var g=[],l=vc(this.Ka),n=0;n<l;n+=1)g.push(Bc(this.Ka,n));return g};c.prototype.getAsObject=function(g,l){g=this.get(g,l);l=this.getColumnNames();for(var n={},t=0;t<l.length;t+=1)n[l[t]]=g[t];return n};c.prototype.getSQL=function(){return mb(this.Ka)};
|
||||
c.prototype.getNormalizedSQL=function(){return oc(this.Ka)};c.prototype.run=function(g){null!=g&&this.bind(g);this.step();return this.reset()};c.prototype.mb=function(g,l){null==l&&(l=this.Ia,this.Ia+=1);g=qa(g);var n=da(g,ea);this.eb.push(n);this.db.handleError(pc(this.Ka,l,n,g.length-1,0))};c.prototype.ub=function(g,l){null==l&&(l=this.Ia,this.Ia+=1);var n=da(g,ea);this.eb.push(n);this.db.handleError(ob(this.Ka,l,n,g.length,0))};c.prototype.lb=function(g,l){null==l&&(l=this.Ia,this.Ia+=1);this.db.handleError((g===
|
||||
(g|0)?rc:qc)(this.Ka,l,g))};c.prototype.xb=function(g){null==g&&(g=this.Ia,this.Ia+=1);ob(this.Ka,g,0,0,0)};c.prototype.nb=function(g,l){null==l&&(l=this.Ia,this.Ia+=1);switch(typeof g){case "string":this.mb(g,l);return;case "number":this.lb(g,l);return;case "bigint":this.mb(g.toString(),l);return;case "boolean":this.lb(g+0,l);return;case "object":if(null===g){this.xb(l);return}if(null!=g.length){this.ub(g,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+g+").";};c.prototype.wb=
|
||||
function(g){var l=this;Object.keys(g).forEach(function(n){var t=sc(l.Ka,n);0!==t&&l.nb(g[n],t)});return!0};c.prototype.vb=function(g){for(var l=0;l<g.length;l+=1)this.nb(g[l],l+1);return!0};c.prototype.reset=function(){this.freemem();return 0===Dc(this.Ka)&&0===Cc(this.Ka)};c.prototype.freemem=function(){for(var g;void 0!==(g=this.eb.pop());)fa(g)};c.prototype.free=function(){this.freemem();var g=0===Ec(this.Ka);delete this.db.Ya[this.Ka];this.Ka=0;return g};d.prototype.next=function(){if(null===
|
||||
this.Xa)return{done:!0};null!==this.Ta&&(this.Ta.free(),this.Ta=null);if(!this.db.db)throw this.fb(),Error("Database closed");var g=ra(),l=y(4);sa(h);sa(l);try{this.db.handleError(nb(this.db.db,this.cb,-1,h,l));this.cb=m(l,"i32");var n=m(h,"i32");if(0===n)return this.fb(),{done:!0};this.Ta=new c(n,this.db);this.db.Ya[n]=this.Ta;return{value:this.Ta,done:!1}}catch(t){throw this.hb=ta(this.cb),this.fb(),t;}finally{ua(g)}};d.prototype.fb=function(){fa(this.Xa);this.Xa=null};d.prototype.getRemainingSQL=
|
||||
function(){return null!==this.hb?this.hb:ta(this.cb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.run=function(g,l){if(!this.db)throw"Database closed";if(l){g=this.prepare(g,l);try{g.step()}finally{g.free()}}else this.handleError(v(this.db,g,0,0,h));return this};e.prototype.exec=function(g,l,n){if(!this.db)throw"Database closed";var t=ra(),w=null;try{var A=va(g),N=y(4);for(g=[];0!==m(A,"i8");){sa(h);sa(N);this.handleError(nb(this.db,
|
||||
A,-1,h,N));var M=m(h,"i32");A=m(N,"i32");if(0!==M){var K=null;w=new c(M,this);for(null!=l&&w.bind(l);w.step();)null===K&&(K={columns:w.getColumnNames(),values:[]},g.push(K)),K.values.push(w.get(null,n));w.free()}}return g}catch(O){throw w&&w.free(),O;}finally{ua(t)}};e.prototype.each=function(g,l,n,t,w){"function"===typeof l&&(t=n,n=l,l=void 0);g=this.prepare(g,l);try{for(;g.step();)n(g.getAsObject(null,w))}finally{g.free()}if("function"===typeof t)return t()};e.prototype.prepare=function(g,l){sa(h);
|
||||
this.handleError(H(this.db,g,-1,h,0));g=m(h,"i32");if(0===g)throw"Nothing to prepare";var n=new c(g,this);null!=l&&n.bind(l);return this.Ya[g]=n};e.prototype.iterateStatements=function(g){return new d(g,this)};e.prototype["export"]=function(){Object.values(this.Ya).forEach(function(l){l.free()});Object.values(this.Ma).forEach(wa);this.Ma={};this.handleError(z(this.db));var g=ya(this.filename);this.handleError(r(this.filename,h));this.db=m(h,"i32");lb(this.db);return g};e.prototype.close=function(){null!==
|
||||
this.db&&(Object.values(this.Ya).forEach(function(g){g.free()}),Object.values(this.Ma).forEach(wa),this.Ma={},this.handleError(z(this.db)),za("/"+this.filename),this.db=null)};e.prototype.handleError=function(g){if(0===g)return null;g=uc(this.db);throw Error(g);};e.prototype.getRowsModified=function(){return E(this.db)};e.prototype.create_function=function(g,l){Object.prototype.hasOwnProperty.call(this.Ma,g)&&(wa(this.Ma[g]),delete this.Ma[g]);var n=Aa(function(t,w,A){w=b(w,A);try{var N=l.apply(null,
|
||||
w)}catch(M){xa(t,M,-1);return}a(t,N)},"viii");this.Ma[g]=n;this.handleError(qb(this.db,g,l.length,1,0,n,0,0,0));return this};e.prototype.create_aggregate=function(g,l){var n=l.init||function(){return null},t=l.finalize||function(K){return K},w=l.step;if(!w)throw"An aggregate function must have a step function in "+g;var A={};Object.hasOwnProperty.call(this.Ma,g)&&(wa(this.Ma[g]),delete this.Ma[g]);l=g+"__finalize";Object.hasOwnProperty.call(this.Ma,l)&&(wa(this.Ma[l]),delete this.Ma[l]);var N=Aa(function(K,
|
||||
O,Ra){var Y=rb(K,1);Object.hasOwnProperty.call(A,Y)||(A[Y]=n());O=b(O,Ra);O=[A[Y]].concat(O);try{A[Y]=w.apply(null,O)}catch(Gc){delete A[Y],xa(K,Gc,-1)}},"viii"),M=Aa(function(K){var O=rb(K,1);try{var Ra=t(A[O])}catch(Y){delete A[O];xa(K,Y,-1);return}a(K,Ra);delete A[O]},"vi");this.Ma[g]=N;this.Ma[l]=M;this.handleError(qb(this.db,g,w.length-1,1,0,0,N,M,0));return this};f.Database=e};var Ba=Object.assign({},f),Ca="./this.program",B="",Da,Ea;
|
||||
if(ca){var fs=require("fs"),Fa=require("path");B=__dirname+"/";Ea=a=>{a=Ga(a)?new URL(a):Fa.normalize(a);return fs.readFileSync(a)};Da=a=>{a=Ga(a)?new URL(a):Fa.normalize(a);return new Promise((b,c)=>{fs.readFile(a,void 0,(d,e)=>{d?c(d):b(e.buffer)})})};!f.thisProgram&&1<process.argv.length&&(Ca=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);"undefined"!=typeof module&&(module.exports=f)}else if(aa||ba)ba?B=self.location.href:"undefined"!=typeof document&&document.currentScript&&(B=document.currentScript.src),
|
||||
B=B.startsWith("blob:")?"":B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1),ba&&(Ea=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),Da=a=>Ga(a)?new Promise((b,c)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{(200==d.status||0==d.status&&d.response)&&c(d.response);b(d.status)};d.onerror=b;d.send(null)}):fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+
|
||||
" : "+b.url)));var Ha=f.print||console.log.bind(console),C=f.printErr||console.error.bind(console);Object.assign(f,Ba);Ba=null;f.thisProgram&&(Ca=f.thisProgram);var Ia;f.wasmBinary&&(Ia=f.wasmBinary);var Ja,Ka=!1,p,u,La,D,F,Ma,Na;
|
||||
function Oa(){var a=Ja.buffer;f.HEAP8=p=new Int8Array(a);f.HEAP16=La=new Int16Array(a);f.HEAPU8=u=new Uint8Array(a);f.HEAPU16=new Uint16Array(a);f.HEAP32=D=new Int32Array(a);f.HEAPU32=F=new Uint32Array(a);f.HEAPF32=Ma=new Float32Array(a);f.HEAPF64=Na=new Float64Array(a)}var Pa=[],Qa=[],Sa=[];function Ta(){var a=f.preRun.shift();Pa.unshift(a)}var Ua=0,Va=null,Wa=null;
|
||||
function G(a){f.onAbort?.(a);a="Aborted("+a+")";C(a);Ka=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Xa=a=>a.startsWith("data:application/octet-stream;base64,"),Ga=a=>a.startsWith("file://"),Ya;function Za(a){if(a==Ya&&Ia)return new Uint8Array(Ia);if(Ea)return Ea(a);throw"both async and sync fetching of the wasm failed";}function $a(a){return Ia?Promise.resolve().then(()=>Za(a)):Da(a).then(b=>new Uint8Array(b),()=>Za(a))}
|
||||
function ab(a,b,c){return $a(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{C(`failed to asynchronously prepare wasm: ${d}`);G(d)})}function bb(a,b){var c=Ya;Ia||"function"!=typeof WebAssembly.instantiateStreaming||Xa(c)||Ga(c)||ca||"function"!=typeof fetch?ab(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){C(`wasm streaming compile failed: ${e}`);C("falling back to ArrayBuffer instantiation");return ab(c,a,b)}))}
|
||||
var I,J,cb=a=>{for(;0<a.length;)a.shift()(f)};function m(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return p[a];case "i8":return p[a];case "i16":return La[a>>1];case "i32":return D[a>>2];case "i64":G("to do getValue(i64) use WASM_BIGINT");case "float":return Ma[a>>2];case "double":return Na[a>>3];case "*":return F[a>>2];default:G(`invalid type for getValue: ${b}`)}}
|
||||
function sa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":p[a]=0;break;case "i8":p[a]=0;break;case "i16":La[a>>1]=0;break;case "i32":D[a>>2]=0;break;case "i64":G("to do setValue(i64) use WASM_BIGINT");case "float":Ma[a>>2]=0;break;case "double":Na[a>>3]=0;break;case "*":F[a>>2]=0;break;default:G(`invalid type for setValue: ${b}`)}}
|
||||
var db="undefined"!=typeof TextDecoder?new TextDecoder:void 0,L=(a,b,c)=>{var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&db)return db.decode(a.subarray(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var h=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|h);else{var k=a[b++]&63;e=224==(e&240)?(e&15)<<12|h<<6|k:(e&7)<<18|h<<12|k<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},ta=(a,
|
||||
b)=>a?L(u,a,b):"",eb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},x=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=eb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},fb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.substr(0,b.length-1);return a+
|
||||
b},gb=a=>{if("/"===a)return"/";a=x(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},hb=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return c=>crypto.getRandomValues(c);if(ca)try{var a=require("crypto");if(a.randomFillSync)return c=>a.randomFillSync(c);var b=a.randomBytes;return c=>(c.set(b(c.byteLength)),c)}catch(c){}G("initRandomDevice")},jb=a=>(jb=hb())(a),kb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=
|
||||
typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=eb(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},sb=[],ha=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},q=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var r=a.charCodeAt(++h);k=65536+((k&1023)<<10)|r&1023}if(127>=
|
||||
k){if(c>=d)break;b[c++]=k}else{if(2047>=k){if(c+1>=d)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=d)break;b[c++]=224|k>>12}else{if(c+3>=d)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-e};function qa(a,b){var c=Array(ha(a)+1);a=q(a,c,0,c.length);b&&(c.length=a);return c}var tb=[];function ub(a,b){tb[a]={input:[],output:[],Wa:b};vb(a,wb)}
|
||||
var wb={open(a){var b=tb[a.node.rdev];if(!b)throw new P(43);a.tty=b;a.seekable=!1},close(a){a.tty.Wa.fsync(a.tty)},fsync(a){a.tty.Wa.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.Wa.rb)throw new P(60);for(var e=0,h=0;h<d;h++){try{var k=a.tty.Wa.rb(a.tty)}catch(r){throw new P(29);}if(void 0===k&&0===e)throw new P(6);if(null===k||void 0===k)break;e++;b[c+h]=k}e&&(a.node.timestamp=Date.now());return e},write(a,b,c,d){if(!a.tty||!a.tty.Wa.ib)throw new P(60);try{for(var e=0;e<d;e++)a.tty.Wa.ib(a.tty,b[c+
|
||||
e])}catch(h){throw new P(29);}d&&(a.node.timestamp=Date.now());return e}},xb={rb(){a:{if(!sb.length){var a=null;if(ca){var b=Buffer.alloc(256),c=0,d=process.stdin.fd;try{c=fs.readSync(d,b,0,256)}catch(e){if(e.toString().includes("EOF"))c=0;else throw e;}0<c&&(a=b.slice(0,c).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){a=null;break a}sb=qa(a,!0)}a=sb.shift()}return a},ib(a,b){null===b||10===b?(Ha(L(a.output,
|
||||
0)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){a.output&&0<a.output.length&&(Ha(L(a.output,0)),a.output=[])},Lb(){return{Gb:25856,Ib:5,Fb:191,Hb:35387,Eb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Mb(){return 0},Nb(){return[24,80]}},yb={ib(a,b){null===b||10===b?(C(L(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){a.output&&0<a.output.length&&(C(L(a.output,0)),a.output=[])}};
|
||||
function zb(a,b){var c=a.Ha?a.Ha.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Ha,a.Ha=new Uint8Array(b),0<a.La&&a.Ha.set(c.subarray(0,a.La),0))}
|
||||
var Q={Pa:null,Qa(){return Q.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new P(63);Q.Pa||(Q.Pa={dir:{node:{Oa:Q.Fa.Oa,Na:Q.Fa.Na,lookup:Q.Fa.lookup,$a:Q.Fa.$a,rename:Q.Fa.rename,unlink:Q.Fa.unlink,rmdir:Q.Fa.rmdir,readdir:Q.Fa.readdir,symlink:Q.Fa.symlink},stream:{Sa:Q.Ga.Sa}},file:{node:{Oa:Q.Fa.Oa,Na:Q.Fa.Na},stream:{Sa:Q.Ga.Sa,read:Q.Ga.read,write:Q.Ga.write,kb:Q.Ga.kb,ab:Q.Ga.ab,bb:Q.Ga.bb}},link:{node:{Oa:Q.Fa.Oa,Na:Q.Fa.Na,readlink:Q.Fa.readlink},
|
||||
stream:{}},ob:{node:{Oa:Q.Fa.Oa,Na:Q.Fa.Na},stream:Ab}});c=Bb(a,b,c,d);R(c.mode)?(c.Fa=Q.Pa.dir.node,c.Ga=Q.Pa.dir.stream,c.Ha={}):32768===(c.mode&61440)?(c.Fa=Q.Pa.file.node,c.Ga=Q.Pa.file.stream,c.La=0,c.Ha=null):40960===(c.mode&61440)?(c.Fa=Q.Pa.link.node,c.Ga=Q.Pa.link.stream):8192===(c.mode&61440)&&(c.Fa=Q.Pa.ob.node,c.Ga=Q.Pa.ob.stream);c.timestamp=Date.now();a&&(a.Ha[b]=c,a.timestamp=c.timestamp);return c},Kb(a){return a.Ha?a.Ha.subarray?a.Ha.subarray(0,a.La):new Uint8Array(a.Ha):new Uint8Array(0)},
|
||||
Fa:{Oa(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;R(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.La:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.yb=4096;b.blocks=Math.ceil(b.size/b.yb);return b},Na(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);if(void 0!==b.size&&(b=b.size,a.La!=b))if(0==
|
||||
b)a.Ha=null,a.La=0;else{var c=a.Ha;a.Ha=new Uint8Array(b);c&&a.Ha.set(c.subarray(0,Math.min(b,a.La)));a.La=b}},lookup(){throw Cb[44];},$a(a,b,c,d){return Q.createNode(a,b,c,d)},rename(a,b,c){if(R(a.mode)){try{var d=Db(b,c)}catch(h){}if(d)for(var e in d.Ha)throw new P(55);}delete a.parent.Ha[a.name];a.parent.timestamp=Date.now();a.name=c;b.Ha[c]=a;b.timestamp=a.parent.timestamp},unlink(a,b){delete a.Ha[b];a.timestamp=Date.now()},rmdir(a,b){var c=Db(a,b),d;for(d in c.Ha)throw new P(55);delete a.Ha[b];
|
||||
a.timestamp=Date.now()},readdir(a){var b=[".",".."],c;for(c of Object.keys(a.Ha))b.push(c);return b},symlink(a,b,c){a=Q.createNode(a,b,41471,0);a.link=c;return a},readlink(a){if(40960!==(a.mode&61440))throw new P(28);return a.link}},Ga:{read(a,b,c,d,e){var h=a.node.Ha;if(e>=a.node.La)return 0;a=Math.min(a.node.La-e,d);if(8<a&&h.subarray)b.set(h.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=h[e+d];return a},write(a,b,c,d,e,h){b.buffer===p.buffer&&(h=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();
|
||||
if(b.subarray&&(!a.Ha||a.Ha.subarray)){if(h)return a.Ha=b.subarray(c,c+d),a.La=d;if(0===a.La&&0===e)return a.Ha=b.slice(c,c+d),a.La=d;if(e+d<=a.La)return a.Ha.set(b.subarray(c,c+d),e),d}zb(a,e+d);if(a.Ha.subarray&&b.subarray)a.Ha.set(b.subarray(c,c+d),e);else for(h=0;h<d;h++)a.Ha[e+h]=b[c+h];a.La=Math.max(a.La,e+d);return d},Sa(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.La);if(0>b)throw new P(28);return b},kb(a,b,c){zb(a.node,b+c);a.node.La=Math.max(a.node.La,b+c)},
|
||||
ab(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new P(43);a=a.node.Ha;if(e&2||a.buffer!==p.buffer){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);c=!0;b=65536*Math.ceil(b/65536);(e=Eb(65536,b))?(u.fill(0,e,e+b),b=e):b=0;if(!b)throw new P(48);p.set(a,b)}else c=!1,b=a.byteOffset;return{Cb:b,tb:c}},bb(a,b,c,d){Q.Ga.write(a,b,0,d,c,!1);return 0}}},ka=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},Fb=null,Gb={},Hb=[],Ib=1,S=null,Jb=!0,P=class{constructor(a){this.name=
|
||||
"ErrnoError";this.Ja=a}},Cb={},Kb=class{constructor(){this.Za={};this.node=null}get flags(){return this.Za.flags}set flags(a){this.Za.flags=a}get position(){return this.Za.position}set position(a){this.Za.position=a}},Lb=class{constructor(a,b,c,d){a||=this;this.parent=a;this.Qa=a.Qa;this.Ua=null;this.id=Ib++;this.name=b;this.mode=c;this.Fa={};this.Ga={};this.rdev=d}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?
|
||||
this.mode|=146:this.mode&=-147}};function T(a,b={}){a=kb(a);if(!a)return{path:"",node:null};b=Object.assign({pb:!0,jb:0},b);if(8<b.jb)throw new P(32);a=a.split("/").filter(k=>!!k);for(var c=Fb,d="/",e=0;e<a.length;e++){var h=e===a.length-1;if(h&&b.parent)break;c=Db(c,a[e]);d=x(d+"/"+a[e]);c.Ua&&(!h||h&&b.pb)&&(c=c.Ua.root);if(!h||b.Ra)for(h=0;40960===(c.mode&61440);)if(c=Mb(d),d=kb(fb(d),c),c=T(d,{jb:b.jb+1}).node,40<h++)throw new P(32);}return{path:d,node:c}}
|
||||
function ja(a){for(var b;;){if(a===a.parent)return a=a.Qa.sb,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Nb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%S.length}function Ob(a){var b=Nb(a.parent.id,a.name);if(S[b]===a)S[b]=a.Va;else for(b=S[b];b;){if(b.Va===a){b.Va=a.Va;break}b=b.Va}}
|
||||
function Db(a,b){var c=R(a.mode)?(c=Pb(a,"x"))?c:a.Fa.lookup?0:2:54;if(c)throw new P(c);for(c=S[Nb(a.id,b)];c;c=c.Va){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.Fa.lookup(a,b)}function Bb(a,b,c,d){a=new Lb(a,b,c,d);b=Nb(a.parent.id,a.name);a.Va=S[b];return S[b]=a}function R(a){return 16384===(a&61440)}function Qb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}
|
||||
function Pb(a,b){if(Jb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Rb(a,b){try{return Db(a,b),20}catch(c){}return Pb(a,"wx")}function Sb(a,b,c){try{var d=Db(a,b)}catch(e){return e.Ja}if(a=Pb(a,"wx"))return a;if(c){if(!R(d.mode))return 54;if(d===d.parent||"/"===ja(d))return 10}else if(R(d.mode))return 31;return 0}function U(a){a=Hb[a];if(!a)throw new P(8);return a}
|
||||
function Tb(a,b=-1){a=Object.assign(new Kb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Hb[b])break a;throw new P(33);}a.fd=b;return Hb[b]=a}function Ub(a,b=-1){a=Tb(a,b);a.Ga?.Jb?.(a);return a}var Ab={open(a){a.Ga=Gb[a.node.rdev].Ga;a.Ga.open?.(a)},Sa(){throw new P(70);}};function vb(a,b){Gb[a]={Ga:b}}
|
||||
function Vb(a,b){var c="/"===b;if(c&&Fb)throw new P(10);if(!c&&b){var d=T(b,{pb:!1});b=d.path;d=d.node;if(d.Ua)throw new P(10);if(!R(d.mode))throw new P(54);}b={type:a,Ob:{},sb:b,Bb:[]};a=a.Qa(b);a.Qa=b;b.root=a;c?Fb=a:d&&(d.Ua=b,d.Qa&&d.Qa.Bb.push(b))}function la(a,b,c){var d=T(a,{parent:!0}).node;a=gb(a);if(!a||"."===a||".."===a)throw new P(28);var e=Rb(d,a);if(e)throw new P(e);if(!d.Fa.$a)throw new P(63);return d.Fa.$a(d,a,b,c)}function V(a,b){return la(a,(void 0!==b?b:511)&1023|16384,0)}
|
||||
function Wb(a,b,c){"undefined"==typeof c&&(c=b,b=438);la(a,b|8192,c)}function Xb(a,b){if(!kb(a))throw new P(44);var c=T(b,{parent:!0}).node;if(!c)throw new P(44);b=gb(b);var d=Rb(c,b);if(d)throw new P(d);if(!c.Fa.symlink)throw new P(63);c.Fa.symlink(c,b,a)}function Yb(a){var b=T(a,{parent:!0}).node;a=gb(a);var c=Db(b,a),d=Sb(b,a,!0);if(d)throw new P(d);if(!b.Fa.rmdir)throw new P(63);if(c.Ua)throw new P(10);b.Fa.rmdir(b,a);Ob(c)}
|
||||
function za(a){var b=T(a,{parent:!0}).node;if(!b)throw new P(44);a=gb(a);var c=Db(b,a),d=Sb(b,a,!1);if(d)throw new P(d);if(!b.Fa.unlink)throw new P(63);if(c.Ua)throw new P(10);b.Fa.unlink(b,a);Ob(c)}function Mb(a){a=T(a).node;if(!a)throw new P(44);if(!a.Fa.readlink)throw new P(28);return kb(ja(a.parent),a.Fa.readlink(a))}function Zb(a,b){a=T(a,{Ra:!b}).node;if(!a)throw new P(44);if(!a.Fa.Oa)throw new P(63);return a.Fa.Oa(a)}function $b(a){return Zb(a,!0)}
|
||||
function ma(a,b){a="string"==typeof a?T(a,{Ra:!0}).node:a;if(!a.Fa.Na)throw new P(63);a.Fa.Na(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})}function ac(a,b){if(0>b)throw new P(28);a="string"==typeof a?T(a,{Ra:!0}).node:a;if(!a.Fa.Na)throw new P(63);if(R(a.mode))throw new P(31);if(32768!==(a.mode&61440))throw new P(28);var c=Pb(a,"w");if(c)throw new P(c);a.Fa.Na(a,{size:b,timestamp:Date.now()})}
|
||||
function na(a,b,c){if(""===a)throw new P(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=x(a);try{e=T(a,{Ra:!(b&131072)}).node}catch(h){}}d=!1;if(b&64)if(e){if(b&128)throw new P(20);}else e=la(a,c,0),d=!0;if(!e)throw new P(44);8192===(e.mode&61440)&&(b&=-513);if(b&65536&&!R(e.mode))throw new P(54);if(!d&&(c=
|
||||
e?40960===(e.mode&61440)?32:R(e.mode)&&("r"!==Qb(b)||b&512)?31:Pb(e,Qb(b)):44))throw new P(c);b&512&&!d&&ac(e,0);b&=-131713;e=Tb({node:e,path:ja(e),flags:b,seekable:!0,position:0,Ga:e.Ga,Db:[],error:!1});e.Ga.open&&e.Ga.open(e);!f.logReadFiles||b&1||(bc||={},a in bc||(bc[a]=1));return e}function pa(a){if(null===a.fd)throw new P(8);a.gb&&(a.gb=null);try{a.Ga.close&&a.Ga.close(a)}catch(b){throw b;}finally{Hb[a.fd]=null}a.fd=null}
|
||||
function cc(a,b,c){if(null===a.fd)throw new P(8);if(!a.seekable||!a.Ga.Sa)throw new P(70);if(0!=c&&1!=c&&2!=c)throw new P(28);a.position=a.Ga.Sa(a,b,c);a.Db=[]}function dc(a,b,c,d,e){if(0>d||0>e)throw new P(28);if(null===a.fd)throw new P(8);if(1===(a.flags&2097155))throw new P(8);if(R(a.node.mode))throw new P(31);if(!a.Ga.read)throw new P(28);var h="undefined"!=typeof e;if(!h)e=a.position;else if(!a.seekable)throw new P(70);b=a.Ga.read(a,b,c,d,e);h||(a.position+=b);return b}
|
||||
function oa(a,b,c,d,e){if(0>d||0>e)throw new P(28);if(null===a.fd)throw new P(8);if(0===(a.flags&2097155))throw new P(8);if(R(a.node.mode))throw new P(31);if(!a.Ga.write)throw new P(28);a.seekable&&a.flags&1024&&cc(a,0,2);var h="undefined"!=typeof e;if(!h)e=a.position;else if(!a.seekable)throw new P(70);b=a.Ga.write(a,b,c,d,e,void 0);h||(a.position+=b);return b}
|
||||
function ya(a){var b="binary";if("utf8"!==b&&"binary"!==b)throw Error(`Invalid encoding type "${b}"`);var c;var d=na(a,d||0);a=Zb(a).size;var e=new Uint8Array(a);dc(d,e,0,a,0);"utf8"===b?c=L(e,0):"binary"===b&&(c=e);pa(d);return c}var ec;
|
||||
function Fc(a,b,c){a=x("/dev/"+a);var d=ka(!!b,!!c);Hc||=64;var e=Hc++<<8|0;vb(e,{open(h){h.seekable=!1},close(){c?.buffer?.length&&c(10)},read(h,k,r,z){for(var v=0,E=0;E<z;E++){try{var H=b()}catch(mb){throw new P(29);}if(void 0===H&&0===v)throw new P(6);if(null===H||void 0===H)break;v++;k[r+E]=H}v&&(h.node.timestamp=Date.now());return v},write(h,k,r,z){for(var v=0;v<z;v++)try{c(k[r+v])}catch(E){throw new P(29);}z&&(h.node.timestamp=Date.now());return v}});Wb(a,d,e)}var Hc,W={},bc;
|
||||
function Ic(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":U(a).path;if(0==b.length){if(!c)throw new P(44);return a}return x(a+"/"+b)}
|
||||
function Jc(a,b,c){a=a(b);D[c>>2]=a.dev;D[c+4>>2]=a.mode;F[c+8>>2]=a.nlink;D[c+12>>2]=a.uid;D[c+16>>2]=a.gid;D[c+20>>2]=a.rdev;J=[a.size>>>0,(I=a.size,1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[c+24>>2]=J[0];D[c+28>>2]=J[1];D[c+32>>2]=4096;D[c+36>>2]=a.blocks;b=a.atime.getTime();var d=a.mtime.getTime(),e=a.ctime.getTime();J=[Math.floor(b/1E3)>>>0,(I=Math.floor(b/1E3),1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>
|
||||
0))/4294967296)>>>0:0)];D[c+40>>2]=J[0];D[c+44>>2]=J[1];F[c+48>>2]=b%1E3*1E3;J=[Math.floor(d/1E3)>>>0,(I=Math.floor(d/1E3),1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[c+56>>2]=J[0];D[c+60>>2]=J[1];F[c+64>>2]=d%1E3*1E3;J=[Math.floor(e/1E3)>>>0,(I=Math.floor(e/1E3),1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[c+72>>2]=J[0];D[c+76>>2]=J[1];F[c+80>>2]=e%1E3*1E3;J=[a.ino>>>0,(I=a.ino,1<=+Math.abs(I)?
|
||||
0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[c+88>>2]=J[0];D[c+92>>2]=J[1];return 0}var Kc=void 0;function Lc(){var a=D[+Kc>>2];Kc+=4;return a}
|
||||
var Mc=(a,b)=>b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN,Nc=[0,31,60,91,121,152,182,213,244,274,305,335],Oc=[0,31,59,90,120,151,181,212,243,273,304,334],Pc={},Rc=()=>{if(!Qc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Ca||"./this.program"},b;for(b in Pc)void 0===Pc[b]?delete a[b]:a[b]=Pc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Qc=c}return Qc},
|
||||
Qc,va=a=>{var b=ha(a)+1,c=y(b);q(a,u,c,b);return c},Sc=(a,b,c,d)=>{var e={string:v=>{var E=0;null!==v&&void 0!==v&&0!==v&&(E=va(v));return E},array:v=>{var E=y(v.length);p.set(v,E);return E}};a=f["_"+a];var h=[],k=0;if(d)for(var r=0;r<d.length;r++){var z=e[c[r]];z?(0===k&&(k=ra()),h[r]=z(d[r])):h[r]=d[r]}c=a(...h);return c=function(v){0!==k&&ua(k);return"string"===b?v?L(u,v):"":"boolean"===b?!!v:v}(c)},ea=0,da=(a,b)=>{b=1==b?y(a.length):ia(a.length);a.subarray||a.slice||(a=new Uint8Array(a));u.set(a,
|
||||
b);return b},Tc,Uc=[],X,wa=a=>{Tc.delete(X.get(a));X.set(a,null);Uc.push(a)},Aa=(a,b)=>{if(!Tc){Tc=new WeakMap;var c=X.length;if(Tc)for(var d=0;d<0+c;d++){var e=X.get(d);e&&Tc.set(e,d)}}if(c=Tc.get(a)||0)return c;if(Uc.length)c=Uc.pop();else{try{X.grow(1)}catch(r){if(!(r instanceof RangeError))throw r;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}c=X.length-1}try{X.set(c,a)}catch(r){if(!(r instanceof TypeError))throw r;if("function"==typeof WebAssembly.Function){d=WebAssembly.Function;
|
||||
e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"};for(var h={parameters:[],results:"v"==b[0]?[]:[e[b[0]]]},k=1;k<b.length;++k)h.parameters.push(e[b[k]]);b=new d(h,a)}else{d=[1];e=b.slice(0,1);b=b.slice(1);h={i:127,p:127,j:126,f:125,d:124,e:111};d.push(96);k=b.length;128>k?d.push(k):d.push(k%128|128,k>>7);for(k=0;k<b.length;++k)d.push(h[b[k]]);"v"==e?d.push(0):d.push(1,h[e]);b=[0,97,115,109,1,0,0,0,1];e=d.length;128>e?b.push(e):b.push(e%128|128,e>>7);b.push(...d);b.push(2,7,1,1,101,1,102,0,
|
||||
0,7,5,1,1,102,0,0);b=new WebAssembly.Module(new Uint8Array(b));b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f}X.set(c,b)}Tc.set(a,c);return c};[44].forEach(a=>{Cb[a]=new P(a);Cb[a].stack="<generic error, no stack>"});S=Array(4096);Vb(Q,"/");V("/tmp");V("/home");V("/home/web_user");
|
||||
(function(){V("/dev");vb(259,{read:()=>0,write:(d,e,h,k)=>k});Wb("/dev/null",259);ub(1280,xb);ub(1536,yb);Wb("/dev/tty",1280);Wb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(b=jb(a).byteLength);return a[--b]};Fc("random",c);Fc("urandom",c);V("/dev/shm");V("/dev/shm/tmp")})();
|
||||
(function(){V("/proc");var a=V("/proc/self");V("/proc/self/fd");Vb({Qa(){var b=Bb(a,"fd",16895,73);b.Fa={lookup(c,d){var e=U(+d);c={parent:null,Qa:{sb:"fake"},Fa:{readlink:()=>e.path}};return c.parent=c}};return b}},"/proc/self/fd")})();
|
||||
var Vc={a:(a,b,c,d)=>{G(`Assertion failed: ${a?L(u,a):""}, at: `+[b?b?L(u,b):"":"unknown filename",c,d?d?L(u,d):"":"unknown function"])},h:function(a,b){try{return a=a?L(u,a):"",ma(a,b),0}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.Ja}},H:function(a,b,c){try{b=b?L(u,b):"";b=Ic(a,b);if(c&-8)return-28;var d=T(b,{Ra:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Pb(d,a)?-2:0}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;
|
||||
return-e.Ja}},i:function(a,b){try{var c=U(a);ma(c.node,b);return 0}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return-d.Ja}},g:function(a){try{var b=U(a).node;var c="string"==typeof b?T(b,{Ra:!0}).node:b;if(!c.Fa.Na)throw new P(63);c.Fa.Na(c,{timestamp:Date.now()});return 0}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return-d.Ja}},b:function(a,b,c){Kc=c;try{var d=U(a);switch(b){case 0:var e=Lc();if(0>e)break;for(;Hb[e];)e++;return Ub(d,e).fd;case 1:case 2:return 0;
|
||||
case 3:return d.flags;case 4:return e=Lc(),d.flags|=e,0;case 12:return e=Lc(),La[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.Ja}},f:function(a,b){try{var c=U(a);return Jc(Zb,c.path,b)}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return-d.Ja}},n:function(a,b,c){b=Mc(b,c);try{if(isNaN(b))return 61;var d=U(a);if(0===(d.flags&2097155))throw new P(28);ac(d.node,b);return 0}catch(e){if("undefined"==typeof W||
|
||||
"ErrnoError"!==e.name)throw e;return-e.Ja}},C:function(a,b){try{if(0===b)return-28;var c=ha("/")+1;if(b<c)return-68;q("/",u,a,b);return c}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return-d.Ja}},F:function(a,b){try{return a=a?L(u,a):"",Jc($b,a,b)}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.Ja}},z:function(a,b,c){try{return b=b?L(u,b):"",b=Ic(a,b),b=x(b),"/"===b[b.length-1]&&(b=b.substr(0,b.length-1)),V(b,c),0}catch(d){if("undefined"==typeof W||"ErrnoError"!==
|
||||
d.name)throw d;return-d.Ja}},E:function(a,b,c,d){try{b=b?L(u,b):"";var e=d&256;b=Ic(a,b,d&4096);return Jc(e?$b:Zb,b,c)}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.Ja}},x:function(a,b,c,d){Kc=d;try{b=b?L(u,b):"";b=Ic(a,b);var e=d?Lc():0;return na(b,c,e).fd}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.Ja}},v:function(a,b,c,d){try{b=b?L(u,b):"";b=Ic(a,b);if(0>=d)return-28;var e=Mb(b),h=Math.min(d,ha(e)),k=p[c+h];q(e,u,c,d+1);p[c+h]=k;return h}catch(r){if("undefined"==
|
||||
typeof W||"ErrnoError"!==r.name)throw r;return-r.Ja}},u:function(a){try{return a=a?L(u,a):"",Yb(a),0}catch(b){if("undefined"==typeof W||"ErrnoError"!==b.name)throw b;return-b.Ja}},G:function(a,b){try{return a=a?L(u,a):"",Jc(Zb,a,b)}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.Ja}},r:function(a,b,c){try{return b=b?L(u,b):"",b=Ic(a,b),0===c?za(b):512===c?Yb(b):G("Invalid flags passed to unlinkat"),0}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return-d.Ja}},
|
||||
q:function(a,b,c){try{b=b?L(u,b):"";b=Ic(a,b,!0);if(c){var d=F[c>>2]+4294967296*D[c+4>>2],e=D[c+8>>2];h=1E3*d+e/1E6;c+=16;d=F[c>>2]+4294967296*D[c+4>>2];e=D[c+8>>2];k=1E3*d+e/1E6}else var h=Date.now(),k=h;a=h;var r=T(b,{Ra:!0}).node;r.Fa.Na(r,{timestamp:Math.max(a,k)});return 0}catch(z){if("undefined"==typeof W||"ErrnoError"!==z.name)throw z;return-z.Ja}},l:function(a,b,c){a=new Date(1E3*Mc(a,b));D[c>>2]=a.getSeconds();D[c+4>>2]=a.getMinutes();D[c+8>>2]=a.getHours();D[c+12>>2]=a.getDate();D[c+16>>
|
||||
2]=a.getMonth();D[c+20>>2]=a.getFullYear()-1900;D[c+24>>2]=a.getDay();b=a.getFullYear();D[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?Oc:Nc)[a.getMonth()]+a.getDate()-1|0;D[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();D[c+32>>2]=(b!=d&&a.getTimezoneOffset()==Math.min(d,b))|0},j:function(a,b,c,d,e,h,k,r){e=Mc(e,h);try{if(isNaN(e))return 61;var z=U(d);if(0!==(b&2)&&0===(c&2)&&2!==(z.flags&2097155))throw new P(2);
|
||||
if(1===(z.flags&2097155))throw new P(2);if(!z.Ga.ab)throw new P(43);var v=z.Ga.ab(z,a,e,b,c);var E=v.Cb;D[k>>2]=v.tb;F[r>>2]=E;return 0}catch(H){if("undefined"==typeof W||"ErrnoError"!==H.name)throw H;return-H.Ja}},k:function(a,b,c,d,e,h,k){h=Mc(h,k);try{var r=U(e);if(c&2){if(32768!==(r.node.mode&61440))throw new P(43);if(!(d&2)){var z=u.slice(a,a+b);r.Ga.bb&&r.Ga.bb(r,z,h,b,d)}}}catch(v){if("undefined"==typeof W||"ErrnoError"!==v.name)throw v;return-v.Ja}},y:(a,b,c,d)=>{var e=(new Date).getFullYear(),
|
||||
h=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(h,e);D[b>>2]=Number(h!=e);b=k=>{var r=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`};a=b(h);b=b(e);e<h?(q(a,u,c,17),q(b,u,d,17)):(q(a,u,d,17),q(b,u,c,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=u.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);var e=
|
||||
Math;d=Math.max(a,d);a:{e=(e.min.call(e,2147483648,d+(65536-d%65536)%65536)-Ja.buffer.byteLength+65535)/65536;try{Ja.grow(e);Oa();var h=1;break a}catch(k){}h=void 0}if(h)return!0}return!1},A:(a,b)=>{var c=0;Rc().forEach((d,e)=>{var h=b+c;e=F[a+4*e>>2]=h;for(h=0;h<d.length;++h)p[e++]=d.charCodeAt(h);p[e]=0;c+=d.length+1});return 0},B:(a,b)=>{var c=Rc();F[a>>2]=c.length;var d=0;c.forEach(e=>d+=e.length+1);F[b>>2]=d;return 0},e:function(a){try{var b=U(a);pa(b);return 0}catch(c){if("undefined"==typeof W||
|
||||
"ErrnoError"!==c.name)throw c;return c.Ja}},p:function(a,b){try{var c=U(a);p[b]=c.tty?2:R(c.mode)?3:40960===(c.mode&61440)?7:4;La[b+2>>1]=0;J=[0,(I=0,1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[b+8>>2]=J[0];D[b+12>>2]=J[1];J=[0,(I=0,1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];D[b+16>>2]=J[0];D[b+20>>2]=J[1];return 0}catch(d){if("undefined"==typeof W||"ErrnoError"!==d.name)throw d;return d.Ja}},
|
||||
w:function(a,b,c,d){try{a:{var e=U(a);a=b;for(var h,k=b=0;k<c;k++){var r=F[a>>2],z=F[a+4>>2];a+=8;var v=dc(e,p,r,z,h);if(0>v){var E=-1;break a}b+=v;if(v<z)break;"undefined"!=typeof h&&(h+=v)}E=b}F[d>>2]=E;return 0}catch(H){if("undefined"==typeof W||"ErrnoError"!==H.name)throw H;return H.Ja}},m:function(a,b,c,d,e){b=Mc(b,c);try{if(isNaN(b))return 61;var h=U(a);cc(h,b,d);J=[h.position>>>0,(I=h.position,1<=+Math.abs(I)?0<I?+Math.floor(I/4294967296)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];
|
||||
D[e>>2]=J[0];D[e+4>>2]=J[1];h.gb&&0===b&&0===d&&(h.gb=null);return 0}catch(k){if("undefined"==typeof W||"ErrnoError"!==k.name)throw k;return k.Ja}},D:function(a){try{var b=U(a);return b.Ga?.fsync?b.Ga.fsync(b):0}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return c.Ja}},t:function(a,b,c,d){try{a:{var e=U(a);a=b;for(var h,k=b=0;k<c;k++){var r=F[a>>2],z=F[a+4>>2];a+=8;var v=oa(e,p,r,z,h);if(0>v){var E=-1;break a}b+=v;"undefined"!=typeof h&&(h+=v)}E=b}F[d>>2]=E;return 0}catch(H){if("undefined"==
|
||||
typeof W||"ErrnoError"!==H.name)throw H;return H.Ja}}},Z=function(){function a(c){Z=c.exports;Ja=Z.I;Oa();X=Z.K;Qa.unshift(Z.J);Ua--;f.monitorRunDependencies?.(Ua);0==Ua&&(null!==Va&&(clearInterval(Va),Va=null),Wa&&(c=Wa,Wa=null,c()));return Z}var b={a:Vc};Ua++;f.monitorRunDependencies?.(Ua);if(f.instantiateWasm)try{return f.instantiateWasm(b,a)}catch(c){return C(`Module.instantiateWasm callback failed with error: ${c}`),!1}Ya||=Xa("sql-wasm.wasm")?"sql-wasm.wasm":f.locateFile?f.locateFile("sql-wasm.wasm",
|
||||
B):B+"sql-wasm.wasm";bb(b,function(c){a(c.instance)});return{}}();f._sqlite3_free=a=>(f._sqlite3_free=Z.L)(a);f._sqlite3_value_text=a=>(f._sqlite3_value_text=Z.M)(a);f._sqlite3_prepare_v2=(a,b,c,d,e)=>(f._sqlite3_prepare_v2=Z.N)(a,b,c,d,e);f._sqlite3_step=a=>(f._sqlite3_step=Z.O)(a);f._sqlite3_reset=a=>(f._sqlite3_reset=Z.P)(a);f._sqlite3_exec=(a,b,c,d,e)=>(f._sqlite3_exec=Z.Q)(a,b,c,d,e);f._sqlite3_finalize=a=>(f._sqlite3_finalize=Z.R)(a);
|
||||
f._sqlite3_column_name=(a,b)=>(f._sqlite3_column_name=Z.S)(a,b);f._sqlite3_column_text=(a,b)=>(f._sqlite3_column_text=Z.T)(a,b);f._sqlite3_column_type=(a,b)=>(f._sqlite3_column_type=Z.U)(a,b);f._sqlite3_errmsg=a=>(f._sqlite3_errmsg=Z.V)(a);f._sqlite3_clear_bindings=a=>(f._sqlite3_clear_bindings=Z.W)(a);f._sqlite3_value_blob=a=>(f._sqlite3_value_blob=Z.X)(a);f._sqlite3_value_bytes=a=>(f._sqlite3_value_bytes=Z.Y)(a);f._sqlite3_value_double=a=>(f._sqlite3_value_double=Z.Z)(a);
|
||||
f._sqlite3_value_int=a=>(f._sqlite3_value_int=Z._)(a);f._sqlite3_value_type=a=>(f._sqlite3_value_type=Z.$)(a);f._sqlite3_result_blob=(a,b,c,d)=>(f._sqlite3_result_blob=Z.aa)(a,b,c,d);f._sqlite3_result_double=(a,b)=>(f._sqlite3_result_double=Z.ba)(a,b);f._sqlite3_result_error=(a,b,c)=>(f._sqlite3_result_error=Z.ca)(a,b,c);f._sqlite3_result_int=(a,b)=>(f._sqlite3_result_int=Z.da)(a,b);f._sqlite3_result_int64=(a,b,c)=>(f._sqlite3_result_int64=Z.ea)(a,b,c);
|
||||
f._sqlite3_result_null=a=>(f._sqlite3_result_null=Z.fa)(a);f._sqlite3_result_text=(a,b,c,d)=>(f._sqlite3_result_text=Z.ga)(a,b,c,d);f._sqlite3_aggregate_context=(a,b)=>(f._sqlite3_aggregate_context=Z.ha)(a,b);f._sqlite3_column_count=a=>(f._sqlite3_column_count=Z.ia)(a);f._sqlite3_data_count=a=>(f._sqlite3_data_count=Z.ja)(a);f._sqlite3_column_blob=(a,b)=>(f._sqlite3_column_blob=Z.ka)(a,b);f._sqlite3_column_bytes=(a,b)=>(f._sqlite3_column_bytes=Z.la)(a,b);
|
||||
f._sqlite3_column_double=(a,b)=>(f._sqlite3_column_double=Z.ma)(a,b);f._sqlite3_bind_blob=(a,b,c,d,e)=>(f._sqlite3_bind_blob=Z.na)(a,b,c,d,e);f._sqlite3_bind_double=(a,b,c)=>(f._sqlite3_bind_double=Z.oa)(a,b,c);f._sqlite3_bind_int=(a,b,c)=>(f._sqlite3_bind_int=Z.pa)(a,b,c);f._sqlite3_bind_text=(a,b,c,d,e)=>(f._sqlite3_bind_text=Z.qa)(a,b,c,d,e);f._sqlite3_bind_parameter_index=(a,b)=>(f._sqlite3_bind_parameter_index=Z.ra)(a,b);f._sqlite3_sql=a=>(f._sqlite3_sql=Z.sa)(a);
|
||||
f._sqlite3_normalized_sql=a=>(f._sqlite3_normalized_sql=Z.ta)(a);f._sqlite3_changes=a=>(f._sqlite3_changes=Z.ua)(a);f._sqlite3_close_v2=a=>(f._sqlite3_close_v2=Z.va)(a);f._sqlite3_create_function_v2=(a,b,c,d,e,h,k,r,z)=>(f._sqlite3_create_function_v2=Z.wa)(a,b,c,d,e,h,k,r,z);f._sqlite3_open=(a,b)=>(f._sqlite3_open=Z.xa)(a,b);var ia=f._malloc=a=>(ia=f._malloc=Z.ya)(a),fa=f._free=a=>(fa=f._free=Z.za)(a);f._RegisterExtensionFunctions=a=>(f._RegisterExtensionFunctions=Z.Aa)(a);
|
||||
var Eb=(a,b)=>(Eb=Z.Ba)(a,b),ua=a=>(ua=Z.Ca)(a),y=a=>(y=Z.Da)(a),ra=()=>(ra=Z.Ea)();f.stackSave=()=>ra();f.stackRestore=a=>ua(a);f.stackAlloc=a=>y(a);f.cwrap=(a,b,c,d)=>{var e=!c||c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&e&&!d?f["_"+a]:(...h)=>Sc(a,b,c,h)};f.addFunction=Aa;f.removeFunction=wa;f.UTF8ToString=ta;f.ALLOC_NORMAL=ea;f.allocate=da;f.allocateUTF8OnStack=va;var Wc;Wa=function Xc(){Wc||Yc();Wc||(Wa=Xc)};
|
||||
function Yc(){function a(){if(!Wc&&(Wc=!0,f.calledRun=!0,!Ka)){f.noFSInit||ec||(ec=!0,f.stdin=f.stdin,f.stdout=f.stdout,f.stderr=f.stderr,f.stdin?Fc("stdin",f.stdin):Xb("/dev/tty","/dev/stdin"),f.stdout?Fc("stdout",null,f.stdout):Xb("/dev/tty","/dev/stdout"),f.stderr?Fc("stderr",null,f.stderr):Xb("/dev/tty1","/dev/stderr"),na("/dev/stdin",0),na("/dev/stdout",1),na("/dev/stderr",1));Jb=!1;cb(Qa);f.onRuntimeInitialized?.();if(f.postRun)for("function"==typeof f.postRun&&(f.postRun=[f.postRun]);f.postRun.length;){var b=
|
||||
f.postRun.shift();Sa.unshift(b)}cb(Sa)}}if(!(0<Ua)){if(f.preRun)for("function"==typeof f.preRun&&(f.preRun=[f.preRun]);f.preRun.length;)Ta();cb(Pa);0<Ua||(f.setStatus?(f.setStatus("Running..."),setTimeout(function(){setTimeout(function(){f.setStatus("")},1);a()},1)):a())}}if(f.preInit)for("function"==typeof f.preInit&&(f.preInit=[f.preInit]);0<f.preInit.length;)f.preInit.pop()();Yc();
|
||||
|
||||
|
||||
// The shell-pre.js and emcc-generated code goes above
|
||||
return Module;
|
||||
}); // The end of the promise being returned
|
||||
|
||||
return initSqlJsPromise;
|
||||
} // The end of our initSqlJs function
|
||||
|
||||
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
||||
// However, we don't want to use the emcc modularization. See shell-pre.js
|
||||
if (typeof exports === 'object' && typeof module === 'object'){
|
||||
module.exports = initSqlJs;
|
||||
// This will allow the module to be used in ES6 or CommonJS
|
||||
module.exports.default = initSqlJs;
|
||||
}
|
||||
else if (typeof define === 'function' && define['amd']) {
|
||||
define([], function() { return initSqlJs; });
|
||||
}
|
||||
else if (typeof exports === 'object'){
|
||||
exports["Module"] = initSqlJs;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Delete Sync Account - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<meta name="description" content="Delete an Inner Breeze remote sync account using the exported inbe-sync.key file.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
<style>
|
||||
.account-delete-form {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
max-width: 760px;
|
||||
}
|
||||
.account-delete-form label {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.account-delete-form input,
|
||||
.account-delete-form textarea {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border: 1px solid #aeb6d8;
|
||||
background: #fff;
|
||||
color: #18202a;
|
||||
font: inherit;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.account-delete-form textarea {
|
||||
min-height: 220px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.account-delete-form button {
|
||||
width: fit-content;
|
||||
border: 0;
|
||||
background: #4b557f;
|
||||
color: #fff;
|
||||
font: inherit;
|
||||
font-weight: 700;
|
||||
padding: 0.85rem 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.account-delete-form button:disabled {
|
||||
opacity: 0.65;
|
||||
cursor: wait;
|
||||
}
|
||||
.status {
|
||||
border: 1px solid #aeb6d8;
|
||||
padding: 0.85rem;
|
||||
max-width: 760px;
|
||||
}
|
||||
.status:empty {
|
||||
display: none;
|
||||
}
|
||||
.status.success {
|
||||
border-color: #38835f;
|
||||
color: #205b41;
|
||||
}
|
||||
.status.error {
|
||||
border-color: #b85252;
|
||||
color: #8a2626;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<section>
|
||||
<h1>Delete Sync Account</h1>
|
||||
<p>Use this page to delete the remote Inner Breeze sync account on the default server. Offline app data on your device is not changed.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Required Proof</h2>
|
||||
<p>This deletion requires the exported <code>inbe-sync.key</code> file from Inner Breeze. Current exports include the sync public ID automatically. The key is sent over HTTPS to the sync server only to prove ownership and delete the account. It is not stored.</p>
|
||||
<p>If you lost the exported key, this page cannot delete the remote sync account. Delete local app data from your device settings or from the app's local data controls.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Account Deletion</h2>
|
||||
<form id="delete-form" class="account-delete-form">
|
||||
<label>
|
||||
Upload exported key
|
||||
<input id="key-file" name="key_file" type="file" accept=".key,.txt,text/plain">
|
||||
</label>
|
||||
<label>
|
||||
Exported key text
|
||||
<textarea id="exported-key" name="exported_key" spellcheck="false" required readonly placeholder="Upload inbe-sync.key to preview its contents here"></textarea>
|
||||
</label>
|
||||
<button id="delete-button" type="submit">Delete Sync Account</button>
|
||||
</form>
|
||||
<p id="status" class="status" role="status" aria-live="polite"></p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>What Gets Deleted</h2>
|
||||
<p>The default sync server removes the remote account row and mirrored sync data for the public ID inside the exported key, including sessions, meditation logs, habits, habit days, and synced preferences. Your local device data, exported backups, and donation records are not part of the sync account.</p>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p><a href="/">Back to Inner Breeze</a> | <a href="/privacy.html">Privacy Policy</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
const apiURL = "https://api.waozi.xyz/api/v1/account/delete-with-key";
|
||||
const keyFile = document.getElementById("key-file");
|
||||
const keyText = document.getElementById("exported-key");
|
||||
const form = document.getElementById("delete-form");
|
||||
const button = document.getElementById("delete-button");
|
||||
const statusBox = document.getElementById("status");
|
||||
|
||||
function setStatus(kind, message) {
|
||||
statusBox.className = "status " + kind;
|
||||
statusBox.textContent = message;
|
||||
}
|
||||
|
||||
function keyField(text, name) {
|
||||
const pattern = new RegExp("^" + name + "=(.+)$", "im");
|
||||
const match = text.match(pattern);
|
||||
return match ? match[1].trim() : "";
|
||||
}
|
||||
|
||||
keyFile.addEventListener("change", async () => {
|
||||
const file = keyFile.files && keyFile.files[0];
|
||||
if (!file) return;
|
||||
keyText.value = await file.text();
|
||||
});
|
||||
|
||||
form.addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
const exportedKey = keyText.value.trim();
|
||||
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
|
||||
setStatus("error", "Upload the exported inbe-sync.key file.");
|
||||
return;
|
||||
}
|
||||
const userID = keyField(exportedKey, "public_id").toLowerCase();
|
||||
if (!/^[0-9a-f]{64}$/.test(userID)) {
|
||||
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
|
||||
return;
|
||||
}
|
||||
button.disabled = true;
|
||||
setStatus("", "Deleting sync account...");
|
||||
try {
|
||||
const response = await fetch(apiURL, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({user_id_hash: userID, exported_key: exportedKey})
|
||||
});
|
||||
const payload = await response.json().catch(() => ({}));
|
||||
if (!response.ok) {
|
||||
throw new Error(payload.error || "Deletion failed");
|
||||
}
|
||||
keyText.value = "";
|
||||
setStatus("success", "Remote sync account deleted.");
|
||||
} catch (error) {
|
||||
setStatus("error", error.message || "Deletion failed");
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,165 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Delete Sync Account - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<meta name="description" content="Delete an Inner Breeze remote sync account using the exported inbe-sync.key file.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
<style>
|
||||
.account-delete-form {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
max-width: 760px;
|
||||
}
|
||||
.account-delete-form label {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.account-delete-form input,
|
||||
.account-delete-form textarea {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border: 1px solid #aeb6d8;
|
||||
background: #fff;
|
||||
color: #18202a;
|
||||
font: inherit;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.account-delete-form textarea {
|
||||
min-height: 220px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.account-delete-form button {
|
||||
width: fit-content;
|
||||
border: 0;
|
||||
background: #4b557f;
|
||||
color: #fff;
|
||||
font: inherit;
|
||||
font-weight: 700;
|
||||
padding: 0.85rem 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.account-delete-form button:disabled {
|
||||
opacity: 0.65;
|
||||
cursor: wait;
|
||||
}
|
||||
.status {
|
||||
border: 1px solid #aeb6d8;
|
||||
padding: 0.85rem;
|
||||
max-width: 760px;
|
||||
}
|
||||
.status:empty {
|
||||
display: none;
|
||||
}
|
||||
.status.success {
|
||||
border-color: #38835f;
|
||||
color: #205b41;
|
||||
}
|
||||
.status.error {
|
||||
border-color: #b85252;
|
||||
color: #8a2626;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<section>
|
||||
<h1>Delete Sync Account</h1>
|
||||
<p>Use this page to delete the remote Inner Breeze sync account on the default server. Offline app data on your device is not changed.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Required Proof</h2>
|
||||
<p>This deletion requires the exported <code>inbe-sync.key</code> file from Inner Breeze. Current exports include the sync public ID automatically. The key is sent over HTTPS to the sync server only to prove ownership and delete the account. It is not stored.</p>
|
||||
<p>If you lost the exported key, this page cannot delete the remote sync account. Delete local app data from your device settings or from the app's local data controls.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Account Deletion</h2>
|
||||
<form id="delete-form" class="account-delete-form">
|
||||
<label>
|
||||
Upload exported key
|
||||
<input id="key-file" name="key_file" type="file" accept=".key,.txt,text/plain">
|
||||
</label>
|
||||
<label>
|
||||
Exported key text
|
||||
<textarea id="exported-key" name="exported_key" spellcheck="false" required readonly placeholder="Upload inbe-sync.key to preview its contents here"></textarea>
|
||||
</label>
|
||||
<button id="delete-button" type="submit">Delete Sync Account</button>
|
||||
</form>
|
||||
<p id="status" class="status" role="status" aria-live="polite"></p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>What Gets Deleted</h2>
|
||||
<p>The default sync server removes the remote account row and mirrored sync data for the public ID inside the exported key, including sessions, meditation logs, habits, habit days, and synced preferences. Your local device data, exported backups, and donation records are not part of the sync account.</p>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p><a href="/">Back to Inner Breeze</a> | <a href="/privacy.html">Privacy Policy</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
const apiURL = "https://api.waozi.xyz/api/v1/account/delete-with-key";
|
||||
const keyFile = document.getElementById("key-file");
|
||||
const keyText = document.getElementById("exported-key");
|
||||
const form = document.getElementById("delete-form");
|
||||
const button = document.getElementById("delete-button");
|
||||
const statusBox = document.getElementById("status");
|
||||
|
||||
function setStatus(kind, message) {
|
||||
statusBox.className = "status " + kind;
|
||||
statusBox.textContent = message;
|
||||
}
|
||||
|
||||
function keyField(text, name) {
|
||||
const pattern = new RegExp("^" + name + "=(.+)$", "im");
|
||||
const match = text.match(pattern);
|
||||
return match ? match[1].trim() : "";
|
||||
}
|
||||
|
||||
keyFile.addEventListener("change", async () => {
|
||||
const file = keyFile.files && keyFile.files[0];
|
||||
if (!file) return;
|
||||
keyText.value = await file.text();
|
||||
});
|
||||
|
||||
form.addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
const exportedKey = keyText.value.trim();
|
||||
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
|
||||
setStatus("error", "Upload the exported inbe-sync.key file.");
|
||||
return;
|
||||
}
|
||||
const userID = keyField(exportedKey, "public_id").toLowerCase();
|
||||
if (!/^[0-9a-f]{64}$/.test(userID)) {
|
||||
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
|
||||
return;
|
||||
}
|
||||
button.disabled = true;
|
||||
setStatus("", "Deleting sync account...");
|
||||
try {
|
||||
const response = await fetch(apiURL, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({user_id_hash: userID, exported_key: exportedKey})
|
||||
});
|
||||
const payload = await response.json().catch(() => ({}));
|
||||
if (!response.ok) {
|
||||
throw new Error(payload.error || "Deletion failed");
|
||||
}
|
||||
keyText.value = "";
|
||||
setStatus("success", "Remote sync account deleted.");
|
||||
} catch (error) {
|
||||
setStatus("error", error.message || "Deletion failed");
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,395 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8" />
|
||||
<head>
|
||||
<title>Inner Breeze Legacy Data Converter</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Convert inbe-legacy JSON exports into the current Inner Breeze import ZIP format.">
|
||||
<link rel="canonical" href="https://inbe.waozi.xyz/legacy-converter.html">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<main id="main-content">
|
||||
<section class="tool-section">
|
||||
<h1>Legacy Data Converter</h1>
|
||||
<p>Coming from inbe-legacy? Convert the old JSON export into the SQLite ZIP file used by the current Inner Breeze import tool.</p>
|
||||
<p class="safety-note"><em>This runs entirely in your browser. Your file is not uploaded.</em></p>
|
||||
|
||||
<div class="converter-panel">
|
||||
<label for="legacy-file">inbe-legacy JSON export</label>
|
||||
<input id="legacy-file" type="file" accept=".json,application/json">
|
||||
<button id="convert-button" type="button">Convert to Inbe SQLite ZIP</button>
|
||||
<p id="converter-status" class="converter-status" role="status">Choose an inbe-legacy JSON export.</p>
|
||||
</div>
|
||||
|
||||
<p><a href="/">Back to downloads</a></p>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<p>© 2026 <a href="https://waozi.xyz">Waozi</a> | <a href="/privacy.html">Privacy Policy</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="/assets/sqljs-1.12.0/sql-wasm.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var fileInput = document.getElementById("legacy-file");
|
||||
var convertButton = document.getElementById("convert-button");
|
||||
var statusEl = document.getElementById("converter-status");
|
||||
var sqlReady = initSqlJs({
|
||||
locateFile: function(file) {
|
||||
return "/assets/sqljs-1.12.0/" + file;
|
||||
}
|
||||
});
|
||||
|
||||
function setStatus(message, isError) {
|
||||
statusEl.textContent = message;
|
||||
statusEl.className = isError ? "converter-status error" : "converter-status";
|
||||
}
|
||||
|
||||
function pad(value, width) {
|
||||
var text = String(value);
|
||||
while(text.length < width) text = "0" + text;
|
||||
return text;
|
||||
}
|
||||
|
||||
function parseDateValue(value) {
|
||||
var numeric;
|
||||
var date;
|
||||
|
||||
if(value === null || value === undefined || value === "") {
|
||||
return null;
|
||||
}
|
||||
|
||||
numeric = Number(value);
|
||||
if(Number.isFinite(numeric) && numeric > 0) {
|
||||
if(numeric < 100000000000) numeric *= 1000;
|
||||
date = new Date(numeric);
|
||||
} else if(typeof value === "string") {
|
||||
date = new Date(value);
|
||||
}
|
||||
|
||||
if(!date || Number.isNaN(date.getTime())) {
|
||||
return null;
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
function dosDateTime(date) {
|
||||
var year = date.getFullYear();
|
||||
if(year < 1980) year = 1980;
|
||||
return {
|
||||
time: (date.getHours() << 11) | (date.getMinutes() << 5) | Math.floor(date.getSeconds() / 2),
|
||||
date: ((year - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate()
|
||||
};
|
||||
}
|
||||
|
||||
var crcTable = null;
|
||||
function makeCrcTable() {
|
||||
var table = [];
|
||||
for(var n = 0; n < 256; n++) {
|
||||
var c = n;
|
||||
for(var k = 0; k < 8; k++) {
|
||||
c = (c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1);
|
||||
}
|
||||
table[n] = c >>> 0;
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
function crc32(bytes) {
|
||||
if(crcTable === null) crcTable = makeCrcTable();
|
||||
var crc = 0 ^ -1;
|
||||
for(var i = 0; i < bytes.length; i++) {
|
||||
crc = (crc >>> 8) ^ crcTable[(crc ^ bytes[i]) & 0xff];
|
||||
}
|
||||
return (crc ^ -1) >>> 0;
|
||||
}
|
||||
|
||||
function writeU16(out, value) {
|
||||
out.push(value & 255, (value >>> 8) & 255);
|
||||
}
|
||||
|
||||
function writeU32(out, value) {
|
||||
out.push(value & 255, (value >>> 8) & 255, (value >>> 16) & 255, (value >>> 24) & 255);
|
||||
}
|
||||
|
||||
function appendBytes(out, bytes) {
|
||||
for(var i = 0; i < bytes.length; i++) out.push(bytes[i]);
|
||||
}
|
||||
|
||||
function makeZip(files) {
|
||||
var encoder = new TextEncoder();
|
||||
var out = [];
|
||||
var central = [];
|
||||
var now = dosDateTime(new Date());
|
||||
|
||||
files.forEach(function(file) {
|
||||
var nameBytes = encoder.encode(file.name);
|
||||
var dataBytes = file.bytes ? file.bytes : encoder.encode(file.content);
|
||||
var crc = crc32(dataBytes);
|
||||
var offset = out.length;
|
||||
|
||||
writeU32(out, 0x04034b50);
|
||||
writeU16(out, 20);
|
||||
writeU16(out, 0);
|
||||
writeU16(out, 0);
|
||||
writeU16(out, now.time);
|
||||
writeU16(out, now.date);
|
||||
writeU32(out, crc);
|
||||
writeU32(out, dataBytes.length);
|
||||
writeU32(out, dataBytes.length);
|
||||
writeU16(out, nameBytes.length);
|
||||
writeU16(out, 0);
|
||||
appendBytes(out, nameBytes);
|
||||
appendBytes(out, dataBytes);
|
||||
|
||||
writeU32(central, 0x02014b50);
|
||||
writeU16(central, 20);
|
||||
writeU16(central, 20);
|
||||
writeU16(central, 0);
|
||||
writeU16(central, 0);
|
||||
writeU16(central, now.time);
|
||||
writeU16(central, now.date);
|
||||
writeU32(central, crc);
|
||||
writeU32(central, dataBytes.length);
|
||||
writeU32(central, dataBytes.length);
|
||||
writeU16(central, nameBytes.length);
|
||||
writeU16(central, 0);
|
||||
writeU16(central, 0);
|
||||
writeU16(central, 0);
|
||||
writeU16(central, 0);
|
||||
writeU32(central, 0);
|
||||
writeU32(central, offset);
|
||||
appendBytes(central, nameBytes);
|
||||
});
|
||||
|
||||
var centralOffset = out.length;
|
||||
appendBytes(out, central);
|
||||
writeU32(out, 0x06054b50);
|
||||
writeU16(out, 0);
|
||||
writeU16(out, 0);
|
||||
writeU16(out, files.length);
|
||||
writeU16(out, files.length);
|
||||
writeU32(out, central.length);
|
||||
writeU32(out, centralOffset);
|
||||
writeU16(out, 0);
|
||||
|
||||
return new Blob([new Uint8Array(out)], {type: "application/zip"});
|
||||
}
|
||||
|
||||
function sessionDate(session) {
|
||||
var id = session && session.id;
|
||||
var dateTime = session && session.dateTime;
|
||||
var date = parseDateValue(id);
|
||||
|
||||
if(!date) {
|
||||
date = parseDateValue(dateTime);
|
||||
}
|
||||
|
||||
if(!date) {
|
||||
return null;
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
function roundSeconds(value) {
|
||||
var number = Number(value);
|
||||
if(!Number.isFinite(number) || number <= 0) return 0;
|
||||
if(number > 999) number = Math.round(number / 1000);
|
||||
else number = Math.round(number);
|
||||
if(number < 1 || number > 999) return 0;
|
||||
return number;
|
||||
}
|
||||
|
||||
function localDateValue(date) {
|
||||
return date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
|
||||
}
|
||||
|
||||
function hashRounds(seconds) {
|
||||
var h = 2166136261 >>> 0;
|
||||
seconds.forEach(function(second) {
|
||||
var value = second >>> 0;
|
||||
h ^= value & 0xff;
|
||||
h = Math.imul(h, 16777619) >>> 0;
|
||||
h ^= (value >>> 8) & 0xff;
|
||||
h = Math.imul(h, 16777619) >>> 0;
|
||||
});
|
||||
return h >>> 0;
|
||||
}
|
||||
|
||||
function sessionId(startedAt, seconds) {
|
||||
return "s-" + startedAt + "-" + pad(hashRounds(seconds).toString(16), 8);
|
||||
}
|
||||
|
||||
function collectLegacySessions(data) {
|
||||
var sessions = Array.isArray(data) ? data : data.sessions;
|
||||
var converted = [];
|
||||
var usedSessions = {};
|
||||
|
||||
if(!Array.isArray(sessions)) {
|
||||
throw new Error("No sessions array found in the legacy export.");
|
||||
}
|
||||
|
||||
sessions.forEach(function(session) {
|
||||
var date = sessionDate(session);
|
||||
var rounds = session && session.rounds;
|
||||
var seconds = [];
|
||||
var startedAt;
|
||||
var id;
|
||||
|
||||
if(!date || !rounds || typeof rounds !== "object") return;
|
||||
|
||||
if(Array.isArray(rounds)) {
|
||||
rounds.forEach(function(round) {
|
||||
var value = roundSeconds(round && typeof round === "object" ? round.duration || round.seconds || round.value : round);
|
||||
if(value > 0) seconds.push(value);
|
||||
});
|
||||
} else {
|
||||
Object.keys(rounds).sort(function(a, b) {
|
||||
return Number(a) - Number(b);
|
||||
}).forEach(function(key) {
|
||||
var value = roundSeconds(rounds[key]);
|
||||
if(value > 0) seconds.push(value);
|
||||
});
|
||||
}
|
||||
|
||||
if(seconds.length === 0) return;
|
||||
|
||||
startedAt = Math.floor(date.getTime() / 1000);
|
||||
id = sessionId(startedAt, seconds);
|
||||
while(usedSessions[id]) {
|
||||
date = new Date(date.getTime() + 1000);
|
||||
startedAt = Math.floor(date.getTime() / 1000);
|
||||
id = sessionId(startedAt, seconds);
|
||||
}
|
||||
usedSessions[id] = true;
|
||||
|
||||
converted.push({
|
||||
id: id,
|
||||
startedAt: startedAt,
|
||||
localDate: localDateValue(date),
|
||||
seconds: seconds,
|
||||
roundsHash: hashRounds(seconds)
|
||||
});
|
||||
});
|
||||
|
||||
if(converted.length === 0) {
|
||||
throw new Error("No valid legacy sessions were found.");
|
||||
}
|
||||
return converted;
|
||||
}
|
||||
|
||||
function createInbeDatabase(SQL, sessions) {
|
||||
var db = new SQL.Database();
|
||||
var now = Math.floor(Date.now() / 1000);
|
||||
var userId = "legacy-converter-local";
|
||||
var sessionStmt;
|
||||
var roundStmt;
|
||||
var bytes;
|
||||
|
||||
db.run(
|
||||
"CREATE TABLE meta(key TEXT PRIMARY KEY, value TEXT NOT NULL);" +
|
||||
"CREATE TABLE users(id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, kind TEXT NOT NULL);" +
|
||||
"CREATE TABLE settings(user_id TEXT NOT NULL, key TEXT NOT NULL, value TEXT NOT NULL, updated_at INTEGER NOT NULL, PRIMARY KEY(user_id,key));" +
|
||||
"CREATE TABLE sessions(id TEXT PRIMARY KEY, user_id TEXT NOT NULL, started_at INTEGER NOT NULL, local_date INTEGER NOT NULL, topic INTEGER NOT NULL DEFAULT 0, activity INTEGER NOT NULL DEFAULT 0, source TEXT NOT NULL, imported_at INTEGER NOT NULL, rounds_hash INTEGER NOT NULL, deleted_at INTEGER NOT NULL DEFAULT 0, UNIQUE(user_id,started_at,rounds_hash));" +
|
||||
"CREATE TABLE session_rounds(session_id TEXT NOT NULL, round_index INTEGER NOT NULL, seconds INTEGER NOT NULL, PRIMARY KEY(session_id,round_index));" +
|
||||
"CREATE TABLE habits(id TEXT PRIMARY KEY, user_id TEXT NOT NULL, name TEXT NOT NULL, color_r INTEGER NOT NULL, color_g INTEGER NOT NULL, color_b INTEGER NOT NULL, sync_mode INTEGER NOT NULL, sync_activity INTEGER NOT NULL, sort_order INTEGER NOT NULL, deleted_at INTEGER NOT NULL DEFAULT 0);" +
|
||||
"CREATE TABLE habit_days(habit_id TEXT NOT NULL, local_date INTEGER NOT NULL, completed INTEGER NOT NULL, updated_at INTEGER NOT NULL, PRIMARY KEY(habit_id,local_date));" +
|
||||
"CREATE TABLE imports(id TEXT PRIMARY KEY, imported_at INTEGER NOT NULL, format TEXT NOT NULL, source_name TEXT NOT NULL, session_count INTEGER NOT NULL, habit_count INTEGER NOT NULL);" +
|
||||
"INSERT INTO meta(key,value) VALUES('schema_version','1');"
|
||||
);
|
||||
db.run("INSERT INTO users(id,created_at,kind) VALUES(?,?,?)", [userId, now, "local"]);
|
||||
|
||||
sessionStmt = db.prepare("INSERT INTO sessions(id,user_id,started_at,local_date,topic,activity,source,imported_at,rounds_hash,deleted_at) VALUES(?,?,?,?,?,?,?,?,?,0)");
|
||||
roundStmt = db.prepare("INSERT INTO session_rounds(session_id,round_index,seconds) VALUES(?,?,?)");
|
||||
sessions.forEach(function(session) {
|
||||
sessionStmt.run([session.id, userId, session.startedAt, session.localDate, 0, 0, "legacy-converter", now, session.roundsHash]);
|
||||
session.seconds.forEach(function(second, index) {
|
||||
roundStmt.run([session.id, index, second]);
|
||||
});
|
||||
});
|
||||
sessionStmt.free();
|
||||
roundStmt.free();
|
||||
db.run("INSERT INTO imports(id,imported_at,format,source_name,session_count,habit_count) VALUES(?,?,?,?,?,0)", [
|
||||
"legacy-converter-" + now,
|
||||
now,
|
||||
"inbe-legacy-json",
|
||||
"legacy-converter",
|
||||
sessions.length
|
||||
]);
|
||||
|
||||
bytes = db.export();
|
||||
db.close();
|
||||
return {
|
||||
userId: userId,
|
||||
bytes: bytes
|
||||
};
|
||||
}
|
||||
|
||||
function convertLegacy(SQL, data) {
|
||||
var sessions = collectLegacySessions(data);
|
||||
var database = createInbeDatabase(SQL, sessions);
|
||||
var metadata = {
|
||||
format: "inbe-data-sqlite",
|
||||
format_version: 1,
|
||||
app_version: "legacy-converter",
|
||||
user_id: database.userId,
|
||||
session_count: sessions.length,
|
||||
habit_count: 0
|
||||
};
|
||||
|
||||
return {
|
||||
count: sessions.length,
|
||||
blob: makeZip([
|
||||
{
|
||||
name: "inbe-data/metadata.json",
|
||||
content: JSON.stringify(metadata, null, 2) + "\n"
|
||||
},
|
||||
{
|
||||
name: "inbe-data/inbe.db",
|
||||
bytes: database.bytes
|
||||
}
|
||||
])
|
||||
};
|
||||
}
|
||||
|
||||
function downloadBlob(blob, filename) {
|
||||
var url = URL.createObjectURL(blob);
|
||||
var link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
setTimeout(function() {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
convertButton.addEventListener("click", function() {
|
||||
var file = fileInput.files && fileInput.files[0];
|
||||
if(!file) {
|
||||
setStatus("Choose a legacy JSON export first.", true);
|
||||
return;
|
||||
}
|
||||
|
||||
Promise.all([sqlReady, file.text()]).then(function(values) {
|
||||
var SQL = values[0];
|
||||
var text = values[1];
|
||||
var data = JSON.parse(text);
|
||||
var result = convertLegacy(SQL, data);
|
||||
downloadBlob(result.blob, "inbe-legacy-converted.zip");
|
||||
setStatus("Converted " + result.count + " sessions. Import the downloaded ZIP in Inner Breeze.", false);
|
||||
}).catch(function(error) {
|
||||
setStatus(error.message || "Conversion failed.", true);
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Inner Breeze",
|
||||
"short_name": "Inner Breeze",
|
||||
"description": "Breathing, meditation sessions, habit tracking, themes, and local-first progress history.",
|
||||
"start_url": "/build/web/index.html",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#1a1a2e",
|
||||
"theme_color": "#5566aa",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/site-icons/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/site-icons/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 83 KiB |
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Privacy Policy - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<meta name="description" content="Privacy policy for Inner Breeze.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<section>
|
||||
<h1>Privacy Policy</h1>
|
||||
<p>Last updated: June 19, 2026</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Inner Breeze</h2>
|
||||
<p>Inner Breeze is a free, open-source guided breathing meditation app based on the Wim Hof method.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Data Collection</h2>
|
||||
<p><strong>Inner Breeze is local-first and does not use analytics, tracking, advertising identifiers, or third-party tracking services.</strong></p>
|
||||
<ul>
|
||||
<li>No personal information collection</li>
|
||||
<li>No analytics or tracking</li>
|
||||
<li>No sale of personal data</li>
|
||||
<li>No account is required for offline use</li>
|
||||
<li>Optional sync sends app data only when you choose to connect a sync server</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Local Data Storage</h2>
|
||||
<p>The app stores practice data locally on your device:</p>
|
||||
<ul>
|
||||
<li>Breathing session timing data</li>
|
||||
<li>Meditation and session history</li>
|
||||
<li>Habit names, colors, completion days, and related settings</li>
|
||||
<li>App preferences such as theme and practice settings</li>
|
||||
<li>Optional sync public/private key material stored by the app on your device</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Optional Sync</h2>
|
||||
<p>Sync is optional. If you connect Inner Breeze to the default sync server or to a custom self-hosted server, the app sends the data needed to mirror your account remotely:</p>
|
||||
<ul>
|
||||
<li>A public-key account identifier derived from your sync public key</li>
|
||||
<li>Your sync public key, used to verify signed sync requests</li>
|
||||
<li>Session, meditation, habit, habit-day, and non-secret preference data</li>
|
||||
<li>Cryptographic challenge and signature metadata used to prevent replay attacks</li>
|
||||
</ul>
|
||||
<p>During normal sync, the sync server does not receive your private key. Your private key remains on your device unless you export it yourself for backup or use the exported key to prove ownership during remote account deletion.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Data Deletion</h2>
|
||||
<p>To delete local data, use the app's data controls or clear the app data through your device's settings.</p>
|
||||
<p>To delete the remote sync account on the default server, use <a href="/delete-account">Delete Sync Account</a>. You must provide the exported <code>inbe-sync.key</code> file, which includes the sync public ID. The exported key is sent over HTTPS to the sync server only to prove account ownership and complete deletion; it is not stored. Remote deletion removes the account row and mirrored sync data for that sync account.</p>
|
||||
<p>If you use a self-hosted sync server, use that server owner's deletion process. Deleting remote sync data does not remove local data from your device or backups you exported yourself.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Donations</h2>
|
||||
<p>Donations are optional and are handled by the external donation/payment provider linked from the website. Donation processing is separate from Inner Breeze sync accounts and app data. Deleting a sync account does not delete records held by an external donation/payment provider.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Permissions</h2>
|
||||
<p>Inner Breeze may use network access for optional sync and file/share access when you import, export, or back up your own data. Core breathing, meditation, and habit tracking features remain usable offline.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Children's Privacy</h2>
|
||||
<p>Inner Breeze is suitable for all ages. The app does not knowingly collect personal information from children. Optional sync should be configured by a parent or guardian when required by local law.</p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Contact</h2>
|
||||
<p>Questions: <a href="mailto:[email protected]">[email protected]</a></p>
|
||||
</section>
|
||||
|
||||
<section class="tool-section">
|
||||
<h2>Open Source</h2>
|
||||
<p>Source code available at: <a href="https://git.sr.ht/~waozi/inbe">https://git.sr.ht/~waozi/inbe</a> and <a href="https://github.com/waozixyz/inbe">https://github.com/waozixyz/inbe</a></p>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p><a href="/">Back to Inner Breeze</a> | <a href="/delete-account">Delete Sync Account</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: https://inbe.waozi.xyz/sitemap.xml
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://inbe.waozi.xyz/</loc>
|
||||
<lastmod>2026-05-29</lastmod>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://inbe.waozi.xyz/privacy.html</loc>
|
||||
<lastmod>2026-06-19</lastmod>
|
||||
<priority>0.3</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://inbe.waozi.xyz/delete-account</loc>
|
||||
<lastmod>2026-06-19</lastmod>
|
||||
<priority>0.3</priority>
|
||||
</url>
|
||||
</urlset>
|
||||
@@ -0,0 +1,121 @@
|
||||
:root {
|
||||
--page-bg: #edf7f7;
|
||||
--page-tile: url('/web-assets/icons/tile2.png');
|
||||
--page-tile-opacity: 0.08;
|
||||
--panel-bg: #fbfefe;
|
||||
--dark: #28536b;
|
||||
--shadow: rgba(24, 49, 61, 0.12);
|
||||
--light: #ffffff;
|
||||
--button-bg: #e5f2f6;
|
||||
--button-highlight: #ffffff;
|
||||
--button-inset: #ffffff;
|
||||
--link: #2478a8;
|
||||
--link-hover: #175f87;
|
||||
--ink: #18313d;
|
||||
--muted: #5d7885;
|
||||
--panel-shadow: rgba(24, 49, 61, 0.14);
|
||||
--hover-web: #edf8fb;
|
||||
--hover-android: #ecf8ef;
|
||||
--hover-windows: #f8efef;
|
||||
--hover-linux: #f8f7eb;
|
||||
--tool-panel-bg: #f3fafb;
|
||||
--card-bg: #f5fbfc;
|
||||
--card-hover-bg: #eef8fb;
|
||||
--card-active-bg: #e3f0f4;
|
||||
}
|
||||
|
||||
body::before {
|
||||
background-size: 160px 160px;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 28px;
|
||||
margin-bottom: 28px;
|
||||
border: 1px solid rgba(40, 83, 107, 0.22);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 16px 42px var(--panel-shadow);
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding: 14px 0 10px;
|
||||
}
|
||||
|
||||
.hero .tk-img {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.hero > p {
|
||||
max-width: 620px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.version {
|
||||
background: #edf7fa;
|
||||
border-color: rgba(40, 83, 107, 0.2);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
button,
|
||||
.tk-button,
|
||||
.platform-btn,
|
||||
.download-item,
|
||||
.feature-item,
|
||||
.platform-section,
|
||||
.dropdown summary,
|
||||
.dropdown-content,
|
||||
.converter-panel {
|
||||
border: 1px solid rgba(40, 83, 107, 0.24);
|
||||
box-shadow: 0 2px 10px rgba(24, 49, 61, 0.08);
|
||||
}
|
||||
|
||||
button:active,
|
||||
.tk-button:active,
|
||||
.platform-btn:active,
|
||||
.download-item:active,
|
||||
.dropdown[open] summary {
|
||||
box-shadow: inset 0 1px 3px rgba(24, 49, 61, 0.16);
|
||||
}
|
||||
|
||||
.tk-img {
|
||||
border: 1px solid rgba(40, 83, 107, 0.24);
|
||||
box-shadow: 0 8px 24px rgba(24, 49, 61, 0.12);
|
||||
}
|
||||
|
||||
.platform-btn,
|
||||
.download-item {
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.platform-section {
|
||||
background: #f7fcfd;
|
||||
}
|
||||
|
||||
.feature-item p,
|
||||
.about-section p,
|
||||
.migration-section p,
|
||||
.benefits-list li,
|
||||
.platform-header p,
|
||||
.safety-note {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.features-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
}
|
||||
|
||||
.feature-item {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.content {
|
||||
margin: 10px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
@@ -311,7 +311,8 @@ app_background_sync_safe(const InbeApp *app)
|
||||
if(app->modal.active)
|
||||
return 0;
|
||||
if(app->inbe.screen == InbeScreenPracticeSession ||
|
||||
app->inbe.screen == InbeScreenMeditation)
|
||||
app->inbe.screen == InbeScreenMeditation ||
|
||||
app->inbe.screen == InbeScreenSunSalutation)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -694,7 +695,7 @@ app_apply_sidebar_route(InbeApp *app, int route)
|
||||
if(app->practice_tab == PRACTICE_TAB_CONFIG)
|
||||
app_leave_practice_config(app);
|
||||
reset_settings_preview(app);
|
||||
app->settings_tab = SETTINGS_TAB_DEVICE;
|
||||
app->settings_tab = SETTINGS_TAB_SESSION;
|
||||
app->settings_scroll = 0;
|
||||
app_switch_screen(app, InbeScreenSettings);
|
||||
app_schedule_settings_save(app);
|
||||
@@ -1554,7 +1555,7 @@ app_init(void *vapp) {
|
||||
app->cursor_disabled = 0;
|
||||
app->play_circle_hover = 0;
|
||||
app->play_circle_scale = 1.0f;
|
||||
app->settings_tab = SETTINGS_TAB_DEVICE;
|
||||
app->settings_tab = SETTINGS_TAB_SESSION;
|
||||
app->habit_edit = (HabitEditState){
|
||||
.index = -1,
|
||||
.color = {99, 196, 165, 255},
|
||||
@@ -1834,12 +1835,16 @@ updateapp(InbeApp *app)
|
||||
{
|
||||
int center_x = view_width / 2;
|
||||
int center_y = view_height / 2;
|
||||
int play_center_y;
|
||||
int hover = 0;
|
||||
int frame_screen = app->inbe.screen;
|
||||
int first_run_guide_active = 0;
|
||||
int habits_guide_active = 0;
|
||||
|
||||
app_apply_pending_sidebar_route(app);
|
||||
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
|
||||
app->backgrounded = (!IsWindowFocused() || IsWindowMinimized()) ? 1 : 0;
|
||||
#endif
|
||||
for(int i = 0; i < practice_count(); i++) {
|
||||
const PracticeDefinition *practice = practice_get(i);
|
||||
if(practice->update != NULL)
|
||||
@@ -1899,9 +1904,10 @@ updateapp(InbeApp *app)
|
||||
practice_update_circle_bounds(app, 0, 84);
|
||||
}
|
||||
|
||||
play_center_y = center_y - flint_px(12);
|
||||
int play_circle_clicked = 0;
|
||||
if(app->inbe.screen == InbeScreenStart && app->practice_tab == PRACTICE_TAB_PLAY)
|
||||
play_circle_clicked = practice_draw_start_preview(app, center_x, center_y);
|
||||
play_circle_clicked = practice_draw_start_preview(app, center_x, play_center_y);
|
||||
else if(app->inbe.screen == InbeScreenSession)
|
||||
practice_draw_active_breathing(app, center_x, center_y);
|
||||
|
||||
@@ -1946,6 +1952,14 @@ updateapp(InbeApp *app)
|
||||
}
|
||||
break;
|
||||
|
||||
case InbeScreenSunSalutation:
|
||||
{
|
||||
const PracticeDefinition *practice = practice_get(PRACTICE_SUN_SALUTATION);
|
||||
if(practice->draw_active_session != NULL)
|
||||
practice->draw_active_session(app, center_x, center_y);
|
||||
}
|
||||
break;
|
||||
|
||||
case InbeScreenResults:
|
||||
practice_draw_results(app, center_x, center_y, &hover);
|
||||
break;
|
||||
|
||||
@@ -41,7 +41,8 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
SETTINGS_TAB_DEVICE = 0,
|
||||
SETTINGS_TAB_SESSION = 0,
|
||||
SETTINGS_TAB_DEVICE,
|
||||
SETTINGS_TAB_THEME,
|
||||
SETTINGS_TAB_DATA,
|
||||
SETTINGS_TAB_COUNT
|
||||
@@ -104,7 +105,8 @@ typedef enum HoldDisplayMode {
|
||||
typedef enum ExerciseType {
|
||||
EXERCISE_WIM_HOF = 0,
|
||||
EXERCISE_MEDITATION = 1,
|
||||
EXERCISE_COUNT = 2
|
||||
EXERCISE_SUN_SALUTATION = 2,
|
||||
EXERCISE_COUNT = 3
|
||||
} ExerciseType;
|
||||
|
||||
typedef enum AppThemeMode {
|
||||
@@ -175,6 +177,16 @@ typedef struct MeditationPracticeState {
|
||||
char music_status[128];
|
||||
} MeditationPracticeState;
|
||||
|
||||
typedef struct SunSalutationPracticeState {
|
||||
Texture2D poses[8];
|
||||
int step;
|
||||
int repetition;
|
||||
int repetitions;
|
||||
int start_seconds;
|
||||
int end_seconds;
|
||||
int step_ticks;
|
||||
} SunSalutationPracticeState;
|
||||
|
||||
typedef struct HabitSessionEditState {
|
||||
int scroll;
|
||||
int active;
|
||||
@@ -211,6 +223,7 @@ struct InbeApp {
|
||||
|
||||
WhmPracticeState whm;
|
||||
MeditationPracticeState meditation;
|
||||
SunSalutationPracticeState sun_salutation;
|
||||
Texture2D font_shapes_texture;
|
||||
Font locale_font;
|
||||
Font locale_font_8;
|
||||
|
||||
@@ -187,6 +187,9 @@ save_settings(InbeApp *app)
|
||||
{"show_session_volume_control", app->show_session_volume_control ? 1 : 0},
|
||||
{"hold_display_mode", app->hold_display_mode},
|
||||
{"exercise_type", app->exercise_type},
|
||||
{"sun_salutation_repetitions", app->sun_salutation.repetitions},
|
||||
{"sun_salutation_start_seconds", app->sun_salutation.start_seconds},
|
||||
{"sun_salutation_end_seconds", app->sun_salutation.end_seconds},
|
||||
{"meditation_music_enabled", app->meditation.music_enabled ? 1 : 0},
|
||||
{"meditation_music_shuffle", app->meditation.music_shuffle ? 1 : 0},
|
||||
{"meditation_music_track", app->meditation.music_track},
|
||||
@@ -315,6 +318,12 @@ app_load_settings(InbeApp *app)
|
||||
HOLD_DISPLAY_CIRCLE, HOLD_DISPLAY_STOPWATCH},
|
||||
{&app->exercise_type, "exercise_type", EXERCISE_WIM_HOF,
|
||||
EXERCISE_WIM_HOF, EXERCISE_COUNT - 1},
|
||||
{&app->sun_salutation.repetitions, "sun_salutation_repetitions", 3,
|
||||
2, 12},
|
||||
{&app->sun_salutation.start_seconds, "sun_salutation_start_seconds", 8,
|
||||
3, 12},
|
||||
{&app->sun_salutation.end_seconds, "sun_salutation_end_seconds", 5,
|
||||
3, 12},
|
||||
{&app->meditation.music_track, "meditation_music_track", 0,
|
||||
0, MEDITATION_MUSIC_TRACK_COUNT - 1},
|
||||
{&app->practice_category_tab, "practice_category_tab", PRACTICE_CATEGORY_MIND,
|
||||
@@ -339,14 +348,10 @@ app_load_settings(InbeApp *app)
|
||||
app->theme_mode = APP_THEME_DARK;
|
||||
}
|
||||
|
||||
#if ANDROID_BUILD || defined(PLATFORM_WEB)
|
||||
app->inbe.play_in_background =
|
||||
storage_get_setting_int("play_in_background", 1) != 0;
|
||||
TraceLog(LOG_INFO, "INBE: Loaded play_in_background setting = %d",
|
||||
app->inbe.play_in_background);
|
||||
#else
|
||||
app->inbe.play_in_background = 0;
|
||||
#endif
|
||||
app->backgrounded = 0;
|
||||
|
||||
app_device_preferences_init(app);
|
||||
|
||||
@@ -94,11 +94,7 @@ inbeinit(Inbe *l)
|
||||
l->progressive_speed = 1;
|
||||
l->progressive_start_speed = DefaultProgressiveStartSpeed;
|
||||
l->breath_animation = InbeBreathAnimationLinear;
|
||||
#if ANDROID_BUILD
|
||||
l->play_in_background = 1; // Enabled by default on Android
|
||||
#else
|
||||
l->play_in_background = 0; // Disabled on other platforms
|
||||
#endif
|
||||
l->play_in_background = 1;
|
||||
|
||||
for(int i = 0; i < MaxRounds; i++) {
|
||||
cpcount(l->results[i], "000");
|
||||
|
||||
@@ -34,6 +34,7 @@ enum {
|
||||
InbeScreenSession,
|
||||
InbeScreenPracticeSession = InbeScreenSession,
|
||||
InbeScreenMeditation,
|
||||
InbeScreenSunSalutation,
|
||||
InbeScreenResults,
|
||||
InbeScreenSettings,
|
||||
InbeScreenPracticeConfig,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define INBE_VERSION_H
|
||||
|
||||
#define INBE_VERSION_MAJOR 1
|
||||
#define INBE_VERSION_MINOR 5
|
||||
#define INBE_VERSION_PATCH 8
|
||||
#define INBE_VERSION_STRING "1.5.8"
|
||||
#define INBE_VERSION_MINOR 6
|
||||
#define INBE_VERSION_PATCH 2
|
||||
#define INBE_VERSION_STRING "1.6.2"
|
||||
|
||||
#endif
|
||||
@@ -608,7 +608,7 @@ int main(int argc, char **argv) {
|
||||
#if defined(PLATFORM_WEB)
|
||||
SetConfigFlags(flint_web_window_flags());
|
||||
#elif !ANDROID_BUILD
|
||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_ALWAYS_RUN);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !ANDROID_BUILD
|
||||
|
||||
@@ -14,6 +14,7 @@ static JavaVM *g_jvm = NULL;
|
||||
static jobject g_activity = NULL;
|
||||
static jmethodID g_acquire_method = NULL;
|
||||
static jmethodID g_release_method = NULL;
|
||||
static jmethodID g_update_notification_method = NULL;
|
||||
static jmethodID g_keep_screen_on_method = NULL;
|
||||
static jmethodID g_allow_screen_off_method = NULL;
|
||||
static pthread_mutex_t wakelock_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -36,6 +37,8 @@ void android_wakelock_set_activity(JNIEnv *env, jobject activity) {
|
||||
if (clazz) {
|
||||
g_acquire_method = (*env)->GetMethodID(env, clazz, "acquireWakeLock", "()V");
|
||||
g_release_method = (*env)->GetMethodID(env, clazz, "releaseWakeLock", "()V");
|
||||
g_update_notification_method =
|
||||
(*env)->GetMethodID(env, clazz, "updateSessionNotification", "(Ljava/lang/String;)V");
|
||||
g_keep_screen_on_method = (*env)->GetMethodID(env, clazz, "keepScreenOn", "()V");
|
||||
g_allow_screen_off_method = (*env)->GetMethodID(env, clazz, "allowScreenOff", "()V");
|
||||
(*env)->DeleteLocalRef(env, clazz);
|
||||
@@ -77,6 +80,34 @@ void android_wakelock_acquire(void) {
|
||||
TraceLog(LOG_INFO, "INBE: Wake lock acquired");
|
||||
}
|
||||
|
||||
void android_wakelock_update_session_notification(const char *status_text) {
|
||||
if(status_text == NULL || status_text[0] == '\0')
|
||||
return;
|
||||
|
||||
pthread_mutex_lock(&wakelock_mutex);
|
||||
|
||||
if (!g_jvm || !g_activity) {
|
||||
pthread_mutex_unlock(&wakelock_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
JNIEnv *env = NULL;
|
||||
jint result = (*g_jvm)->GetEnv(g_jvm, (void**)&env, JNI_VERSION_1_6);
|
||||
if (result == JNI_EDETACHED) {
|
||||
result = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
|
||||
}
|
||||
|
||||
if (env && g_update_notification_method) {
|
||||
jstring text = (*env)->NewStringUTF(env, status_text);
|
||||
if(text != NULL) {
|
||||
(*env)->CallVoidMethod(env, g_activity, g_update_notification_method, text);
|
||||
(*env)->DeleteLocalRef(env, text);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&wakelock_mutex);
|
||||
}
|
||||
|
||||
void android_wakelock_release(void) {
|
||||
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== RELEASE START ===");
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
void android_wakelock_init(void);
|
||||
void android_wakelock_acquire(void);
|
||||
void android_wakelock_release(void);
|
||||
void android_wakelock_update_session_notification(const char *status_text);
|
||||
void android_keep_screen_on(void);
|
||||
void android_allow_screen_off(void);
|
||||
void android_wakelock_set_activity(JNIEnv *env, jobject activity);
|
||||
@@ -17,6 +18,7 @@ void android_wakelock_set_jvm(JavaVM *vm);
|
||||
static inline void android_wakelock_init(void) {}
|
||||
static inline void android_wakelock_acquire(void) {}
|
||||
static inline void android_wakelock_release(void) {}
|
||||
static inline void android_wakelock_update_session_notification(const char *status_text) { (void)status_text; }
|
||||
static inline void android_keep_screen_on(void) {}
|
||||
static inline void android_allow_screen_off(void) {}
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ meditation_start(InbeApp *app, int seconds)
|
||||
app_switch_screen(app, InbeScreenMeditation);
|
||||
app_play_sound(app, app->bell_sound, 1.0f);
|
||||
meditation_music_start_session(app);
|
||||
practice_active_background_start(app);
|
||||
practice_background_start(app, PRACTICE_MEDITATION);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -352,11 +352,11 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
|
||||
flint_ui_text_y(time_text, center_y - font, font * 2, font),
|
||||
font, flint_theme_get_text());
|
||||
|
||||
if(!(
|
||||
if((
|
||||
#if defined(PLATFORM_WEB)
|
||||
app->backgrounded
|
||||
!app->backgrounded
|
||||
#else
|
||||
0
|
||||
!app->backgrounded || app->inbe.play_in_background
|
||||
#endif
|
||||
)) {
|
||||
app->meditation.frame_ticks++;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "practices/whm/whm_practice.h"
|
||||
#include "practices/whm/whm_session.h"
|
||||
#include "practices/meditation/meditation_practice.h"
|
||||
#include "practices/sun_salutation/sun_salutation_practice.h"
|
||||
|
||||
#if ANDROID_BUILD
|
||||
#include "android_timer.h"
|
||||
@@ -24,6 +25,12 @@ practice_meditation_is_active(const InbeApp *app)
|
||||
return app != NULL && app->inbe.screen == InbeScreenMeditation;
|
||||
}
|
||||
|
||||
static int
|
||||
practice_sun_salutation_is_active(const InbeApp *app)
|
||||
{
|
||||
return app != NULL && app->inbe.screen == InbeScreenSunSalutation;
|
||||
}
|
||||
|
||||
static const PracticeDefinition g_practices[PRACTICE_COUNT] = {
|
||||
{
|
||||
.id = PRACTICE_WHM,
|
||||
@@ -63,6 +70,25 @@ static const PracticeDefinition g_practices[PRACTICE_COUNT] = {
|
||||
.background_stop = NULL,
|
||||
.advance_elapsed = meditation_advance_elapsed,
|
||||
},
|
||||
{
|
||||
.id = PRACTICE_SUN_SALUTATION,
|
||||
.label_key = "exercise_sun_salutation",
|
||||
.init = sun_salutation_practice_init,
|
||||
.destroy = sun_salutation_practice_destroy,
|
||||
.start = sun_salutation_practice_start,
|
||||
.draw_manual = NULL,
|
||||
.close_manual = NULL,
|
||||
.draw_config = sun_salutation_config_screen_draw,
|
||||
.leave_config = NULL,
|
||||
.update = NULL,
|
||||
.draw_setup_modal = NULL,
|
||||
.draw_active_session = sun_salutation_draw_screen,
|
||||
.request_exit = sun_salutation_request_exit,
|
||||
.is_active = practice_sun_salutation_is_active,
|
||||
.background_start = NULL,
|
||||
.background_stop = NULL,
|
||||
.advance_elapsed = NULL,
|
||||
},
|
||||
};
|
||||
|
||||
const PracticeDefinition *
|
||||
@@ -111,13 +137,15 @@ practice_active_supports_background(const InbeApp *app)
|
||||
}
|
||||
|
||||
void
|
||||
practice_active_background_start(InbeApp *app)
|
||||
practice_background_start(InbeApp *app, int id)
|
||||
{
|
||||
const PracticeDefinition *practice = practice_active(app);
|
||||
const PracticeDefinition *practice;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
|
||||
practice = practice_get(id);
|
||||
|
||||
#if ANDROID_BUILD
|
||||
set_global_inbe_app(app);
|
||||
#endif
|
||||
@@ -137,6 +165,15 @@ practice_active_background_start(InbeApp *app)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
practice_active_background_start(InbeApp *app)
|
||||
{
|
||||
const PracticeDefinition *practice = practice_active(app);
|
||||
if(practice == NULL)
|
||||
return;
|
||||
practice_background_start(app, practice->id);
|
||||
}
|
||||
|
||||
void
|
||||
practice_active_background_stop(InbeApp *app)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
typedef enum PracticeId {
|
||||
PRACTICE_WHM = 0,
|
||||
PRACTICE_MEDITATION = 1,
|
||||
PRACTICE_COUNT = 2
|
||||
PRACTICE_SUN_SALUTATION = 2,
|
||||
PRACTICE_COUNT = 3
|
||||
} PracticeId;
|
||||
|
||||
typedef struct PracticeDefinition {
|
||||
@@ -42,6 +43,7 @@ void practice_update_active_breathing(InbeApp *app, int center_x, int center_y,
|
||||
void practice_draw_results(InbeApp *app, int center_x, int center_y, int *hover);
|
||||
const PracticeDefinition *practice_active(const InbeApp *app);
|
||||
int practice_active_supports_background(const InbeApp *app);
|
||||
void practice_background_start(InbeApp *app, int id);
|
||||
void practice_active_background_start(InbeApp *app);
|
||||
void practice_active_background_stop(InbeApp *app);
|
||||
void practice_active_advance_elapsed(InbeApp *app, int elapsed_ms);
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
#include "sun_salutation_practice.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "app_settings.h"
|
||||
#include "flint_locale.h"
|
||||
#include "flint_text.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern int view_width;
|
||||
|
||||
static const int g_sun_salutation_pose_sequence[SUN_SALUTATION_STEP_COUNT] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0
|
||||
};
|
||||
|
||||
static const char *g_sun_salutation_step_label_keys[SUN_SALUTATION_STEP_COUNT] = {
|
||||
"sun_salutation_step_1",
|
||||
"sun_salutation_step_2",
|
||||
"sun_salutation_step_3",
|
||||
"sun_salutation_step_4",
|
||||
"sun_salutation_step_5",
|
||||
"sun_salutation_step_6",
|
||||
"sun_salutation_step_7",
|
||||
"sun_salutation_step_8",
|
||||
"sun_salutation_step_9",
|
||||
"sun_salutation_step_10",
|
||||
"sun_salutation_step_11",
|
||||
"sun_salutation_step_12"
|
||||
};
|
||||
|
||||
static int
|
||||
sun_salutation_clampi(int value, int min_value, int max_value)
|
||||
{
|
||||
if(value < min_value)
|
||||
return min_value;
|
||||
if(value > max_value)
|
||||
return max_value;
|
||||
return value;
|
||||
}
|
||||
|
||||
int
|
||||
sun_salutation_step_pose_index(int step)
|
||||
{
|
||||
step = sun_salutation_clampi(step, 0, SUN_SALUTATION_STEP_COUNT - 1);
|
||||
return g_sun_salutation_pose_sequence[step];
|
||||
}
|
||||
|
||||
const char *
|
||||
sun_salutation_step_label(int step)
|
||||
{
|
||||
step = sun_salutation_clampi(step, 0, SUN_SALUTATION_STEP_COUNT - 1);
|
||||
return locale_get(g_sun_salutation_step_label_keys[step]);
|
||||
}
|
||||
|
||||
static void
|
||||
sun_salutation_normalize_settings(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->sun_salutation.repetitions =
|
||||
sun_salutation_clampi(app->sun_salutation.repetitions,
|
||||
2, 12);
|
||||
app->sun_salutation.start_seconds =
|
||||
sun_salutation_clampi(app->sun_salutation.start_seconds,
|
||||
SUN_SALUTATION_SECONDS_MIN,
|
||||
SUN_SALUTATION_SECONDS_MAX);
|
||||
app->sun_salutation.end_seconds =
|
||||
sun_salutation_clampi(app->sun_salutation.end_seconds,
|
||||
SUN_SALUTATION_SECONDS_MIN,
|
||||
SUN_SALUTATION_SECONDS_MAX);
|
||||
if(app->sun_salutation.start_seconds < app->sun_salutation.end_seconds)
|
||||
app->sun_salutation.end_seconds = app->sun_salutation.start_seconds;
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_practice_init(InbeApp *app)
|
||||
{
|
||||
char path[64];
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
if(app->sun_salutation.repetitions < 2 || app->sun_salutation.repetitions > 12)
|
||||
app->sun_salutation.repetitions = SUN_SALUTATION_DEFAULT_REPETITIONS;
|
||||
if(app->sun_salutation.start_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.start_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.start_seconds = SUN_SALUTATION_DEFAULT_START_SECONDS;
|
||||
if(app->sun_salutation.end_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.end_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.end_seconds = SUN_SALUTATION_DEFAULT_END_SECONDS;
|
||||
sun_salutation_normalize_settings(app);
|
||||
for(int i = 0; i < SUN_SALUTATION_POSE_COUNT; i++) {
|
||||
if(app->sun_salutation.poses[i].id != 0)
|
||||
continue;
|
||||
snprintf(path, sizeof(path), "practices/sunsalutation/pos_%04d.png", i + 1);
|
||||
app->sun_salutation.poses[i] = app_load_asset_texture(path);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_practice_destroy(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
for(int i = 0; i < SUN_SALUTATION_POSE_COUNT; i++) {
|
||||
app_unload_texture(app->sun_salutation.poses[i]);
|
||||
app->sun_salutation.poses[i] = (Texture2D){0};
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_preview_pose(Texture2D texture, int x, int y, int w, int h, Color tint)
|
||||
{
|
||||
Rectangle src;
|
||||
Rectangle dst;
|
||||
float scale;
|
||||
float draw_w;
|
||||
float draw_h;
|
||||
|
||||
if(texture.id == 0 || w <= 0 || h <= 0)
|
||||
return;
|
||||
scale = (float)w / (float)texture.width;
|
||||
if((float)texture.height * scale > (float)h)
|
||||
scale = (float)h / (float)texture.height;
|
||||
draw_w = (float)texture.width * scale;
|
||||
draw_h = (float)texture.height * scale;
|
||||
src = (Rectangle){0, 0, (float)texture.width, (float)texture.height};
|
||||
dst = (Rectangle){(float)x + ((float)w - draw_w) * 0.5f,
|
||||
(float)y + ((float)h - draw_h) * 0.5f,
|
||||
draw_w, draw_h};
|
||||
DrawTexturePro(texture, src, dst, (Vector2){0}, 0.0f, tint);
|
||||
}
|
||||
|
||||
static int
|
||||
sun_salutation_preview_height(int content_w)
|
||||
{
|
||||
int thumb_w = (content_w - flint_px(22)) / 6;
|
||||
|
||||
if(thumb_w < flint_px(34))
|
||||
thumb_w = flint_px(34);
|
||||
if(thumb_w > flint_px(56))
|
||||
thumb_w = flint_px(56);
|
||||
return thumb_w * 2 + flint_px(56);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_sun_salutation_preview(InbeApp *app, int x, int y, int w)
|
||||
{
|
||||
int label_font = flint_ui_font();
|
||||
int small_font = flint_ui_font_small();
|
||||
int label_w;
|
||||
int thumb_w = (w - flint_px(22)) / 6;
|
||||
int thumb_h;
|
||||
int gap = flint_px(4);
|
||||
int active_step;
|
||||
int preview_step_ticks;
|
||||
int row_y;
|
||||
Color muted = flint_darken(flint_theme_get_text(), 40);
|
||||
|
||||
if(thumb_w < flint_px(34))
|
||||
thumb_w = flint_px(34);
|
||||
if(thumb_w > flint_px(56))
|
||||
thumb_w = flint_px(56);
|
||||
thumb_h = thumb_w;
|
||||
|
||||
label_w = flint_text_measure(locale_get("sun_salutation_tempo_preview_label"), label_font);
|
||||
flint_text_draw(locale_get("sun_salutation_tempo_preview_label"),
|
||||
x + (w - label_w) / 2, y, label_font, flint_theme_get_text());
|
||||
y += flint_px(28);
|
||||
|
||||
preview_step_ticks = app->sun_salutation.start_seconds * 60;
|
||||
if(preview_step_ticks <= 0)
|
||||
preview_step_ticks = SUN_SALUTATION_DEFAULT_START_SECONDS * 60;
|
||||
active_step = (app->inbe.frame / preview_step_ticks) %
|
||||
SUN_SALUTATION_STEP_COUNT;
|
||||
for(int i = 0; i < SUN_SALUTATION_STEP_COUNT; i++) {
|
||||
int col = i % 6;
|
||||
int row = i / 6;
|
||||
int px = x + col * (thumb_w + gap) + (w - (thumb_w * 6 + gap * 5)) / 2;
|
||||
int py = y + row * (thumb_h + flint_px(18));
|
||||
int pose_index = sun_salutation_step_pose_index(i);
|
||||
Color tint = i == active_step ? WHITE : Fade(WHITE, 0.62f);
|
||||
|
||||
DrawRectangle(px, py, thumb_w, thumb_h, flint_darken(flint_theme_get_bg(), 6));
|
||||
if(i == active_step)
|
||||
DrawRectangleLines(px, py, thumb_w, thumb_h, flint_theme_get_button_hover());
|
||||
draw_preview_pose(app->sun_salutation.poses[pose_index], px, py, thumb_w, thumb_h, tint);
|
||||
if(i < SUN_SALUTATION_STEP_COUNT - 1) {
|
||||
int next_col = (i + 1) % 6;
|
||||
if(next_col != 0)
|
||||
DrawLine(px + thumb_w + flint_px(1), py + thumb_h / 2,
|
||||
px + thumb_w + gap - flint_px(1), py + thumb_h / 2,
|
||||
muted);
|
||||
}
|
||||
}
|
||||
|
||||
row_y = y + thumb_h * 2 + flint_px(26);
|
||||
if(flint_text_measure(locale_get("sun_salutation_tempo_preview_hint"),
|
||||
small_font) <= w)
|
||||
flint_text_draw(locale_get("sun_salutation_tempo_preview_hint"), x, row_y,
|
||||
small_font, muted);
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_config_screen_draw(InbeApp *app)
|
||||
{
|
||||
int content_x;
|
||||
int content_w;
|
||||
int y;
|
||||
int repetitions;
|
||||
int start_seconds;
|
||||
int end_seconds;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
sun_salutation_normalize_settings(app);
|
||||
|
||||
flint_centered_column(CONTENT_MAX_W, CONTENT_SIDE_PAD, &content_x, &content_w);
|
||||
y = app_content_top_reserved(app) + flint_px(20);
|
||||
|
||||
draw_sun_salutation_preview(app, content_x, y, content_w);
|
||||
y += sun_salutation_preview_height(content_w) + flint_px(16);
|
||||
|
||||
repetitions = app->sun_salutation.repetitions;
|
||||
if(ui_draw_slider(610, content_x, y, content_w,
|
||||
locale_get("sun_salutation_repetitions_label"),
|
||||
2, 12, &repetitions, "x")) {
|
||||
app->sun_salutation.repetitions = repetitions;
|
||||
save_settings(app);
|
||||
}
|
||||
y += flint_px(74);
|
||||
|
||||
start_seconds = app->sun_salutation.start_seconds;
|
||||
if(ui_draw_slider(611, content_x, y, content_w,
|
||||
locale_get("sun_salutation_start_speed_label"),
|
||||
SUN_SALUTATION_SECONDS_MIN, SUN_SALUTATION_SECONDS_MAX,
|
||||
&start_seconds, "s")) {
|
||||
app->sun_salutation.start_seconds = start_seconds;
|
||||
sun_salutation_normalize_settings(app);
|
||||
save_settings(app);
|
||||
}
|
||||
y += flint_px(74);
|
||||
|
||||
end_seconds = app->sun_salutation.end_seconds;
|
||||
if(ui_draw_slider(612, content_x, y, content_w,
|
||||
locale_get("sun_salutation_end_speed_label"),
|
||||
SUN_SALUTATION_SECONDS_MIN, app->sun_salutation.start_seconds,
|
||||
&end_seconds, "s")) {
|
||||
app->sun_salutation.end_seconds = end_seconds;
|
||||
sun_salutation_normalize_settings(app);
|
||||
save_settings(app);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef INBE_SUN_SALUTATION_PRACTICE_H
|
||||
#define INBE_SUN_SALUTATION_PRACTICE_H
|
||||
|
||||
#include "app_fwd.h"
|
||||
|
||||
#define SUN_SALUTATION_POSE_COUNT 8
|
||||
#define SUN_SALUTATION_STEP_COUNT 12
|
||||
#define SUN_SALUTATION_SECONDS_MIN 3
|
||||
#define SUN_SALUTATION_SECONDS_MAX 12
|
||||
#define SUN_SALUTATION_DEFAULT_REPETITIONS 3
|
||||
#define SUN_SALUTATION_DEFAULT_START_SECONDS 8
|
||||
#define SUN_SALUTATION_DEFAULT_END_SECONDS 5
|
||||
|
||||
int sun_salutation_step_pose_index(int step);
|
||||
const char *sun_salutation_step_label(int step);
|
||||
void sun_salutation_practice_init(InbeApp *app);
|
||||
void sun_salutation_practice_destroy(InbeApp *app);
|
||||
void sun_salutation_practice_start(InbeApp *app);
|
||||
void sun_salutation_config_screen_draw(InbeApp *app);
|
||||
void sun_salutation_draw_screen(InbeApp *app, int center_x, int center_y);
|
||||
void sun_salutation_request_exit(InbeApp *app);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,304 @@
|
||||
#include "sun_salutation_practice.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "data.h"
|
||||
#include "flint_locale.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern int view_width;
|
||||
extern int view_height;
|
||||
|
||||
static void
|
||||
sun_salutation_exit_to_start(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->sun_salutation.step = 0;
|
||||
app->sun_salutation.repetition = 0;
|
||||
app->sun_salutation.step_ticks = 0;
|
||||
app->session_paused = 0;
|
||||
app_close_modal(app);
|
||||
app_switch_screen(app, InbeScreenStart);
|
||||
}
|
||||
|
||||
static void
|
||||
sun_salutation_finish(InbeApp *app)
|
||||
{
|
||||
int seconds = 1;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
if(data_save_session_path_for_activity(&seconds, 1, 0, EXERCISE_SUN_SALUTATION,
|
||||
NULL, 0)) {
|
||||
sync_habits_for_activity(app, EXERCISE_SUN_SALUTATION);
|
||||
app_auto_sync(app);
|
||||
}
|
||||
sun_salutation_exit_to_start(app);
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_practice_start(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
mark_exercise_manual_seen(app, EXERCISE_SUN_SALUTATION);
|
||||
app->sun_salutation.step = 0;
|
||||
app->sun_salutation.repetition = 0;
|
||||
if(app->sun_salutation.repetitions < 2 || app->sun_salutation.repetitions > 12)
|
||||
app->sun_salutation.repetitions = SUN_SALUTATION_DEFAULT_REPETITIONS;
|
||||
if(app->sun_salutation.start_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.start_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.start_seconds = SUN_SALUTATION_DEFAULT_START_SECONDS;
|
||||
if(app->sun_salutation.end_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.end_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.end_seconds = SUN_SALUTATION_DEFAULT_END_SECONDS;
|
||||
if(app->sun_salutation.start_seconds < app->sun_salutation.end_seconds)
|
||||
app->sun_salutation.end_seconds = app->sun_salutation.start_seconds;
|
||||
app->sun_salutation.step_ticks = 0;
|
||||
app->session_paused = 0;
|
||||
app_close_modal(app);
|
||||
app_switch_screen(app, InbeScreenSunSalutation);
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_request_exit(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app_open_modal(app, UIModalConfirmExitSession);
|
||||
}
|
||||
|
||||
static int
|
||||
sun_salutation_step_seconds(InbeApp *app)
|
||||
{
|
||||
int start_seconds;
|
||||
int end_seconds;
|
||||
int repetitions;
|
||||
int repetition;
|
||||
|
||||
if(app == NULL)
|
||||
return SUN_SALUTATION_DEFAULT_START_SECONDS;
|
||||
start_seconds = app->sun_salutation.start_seconds;
|
||||
end_seconds = app->sun_salutation.end_seconds;
|
||||
repetitions = app->sun_salutation.repetitions;
|
||||
repetition = app->sun_salutation.repetition;
|
||||
if(start_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
start_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
start_seconds = SUN_SALUTATION_DEFAULT_START_SECONDS;
|
||||
if(end_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
end_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
end_seconds = SUN_SALUTATION_DEFAULT_END_SECONDS;
|
||||
if(start_seconds < end_seconds)
|
||||
end_seconds = start_seconds;
|
||||
if(repetitions < 2)
|
||||
return start_seconds;
|
||||
if(repetition < 0)
|
||||
repetition = 0;
|
||||
if(repetition >= repetitions)
|
||||
repetition = repetitions - 1;
|
||||
return start_seconds + ((end_seconds - start_seconds) * repetition) /
|
||||
(repetitions - 1);
|
||||
}
|
||||
|
||||
static void
|
||||
sun_salutation_step_forward(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->sun_salutation.step_ticks = 0;
|
||||
if(app->sun_salutation.step >= SUN_SALUTATION_STEP_COUNT - 1) {
|
||||
if(app->sun_salutation.repetition >= app->sun_salutation.repetitions - 1)
|
||||
sun_salutation_finish(app);
|
||||
else {
|
||||
app->sun_salutation.repetition++;
|
||||
app->sun_salutation.step = 0;
|
||||
}
|
||||
} else {
|
||||
app->sun_salutation.step++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sun_salutation_step_back(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->sun_salutation.step_ticks = 0;
|
||||
if(app->sun_salutation.step > 0) {
|
||||
app->sun_salutation.step--;
|
||||
} else if(app->sun_salutation.repetition > 0) {
|
||||
app->sun_salutation.repetition--;
|
||||
app->sun_salutation.step = SUN_SALUTATION_STEP_COUNT - 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sun_salutation_update_timer(InbeApp *app)
|
||||
{
|
||||
int ticks_per_step;
|
||||
|
||||
if(app == NULL || app->inbe.screen != InbeScreenSunSalutation ||
|
||||
app->session_paused)
|
||||
return;
|
||||
ticks_per_step = sun_salutation_step_seconds(app) * 60;
|
||||
if(ticks_per_step <= 0)
|
||||
ticks_per_step = SUN_SALUTATION_DEFAULT_START_SECONDS * 60;
|
||||
app->sun_salutation.step_ticks++;
|
||||
if(app->sun_salutation.step_ticks >= ticks_per_step)
|
||||
sun_salutation_step_forward(app);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_pose_image(Texture2D texture, int top_y, int bottom_y)
|
||||
{
|
||||
Rectangle src;
|
||||
Rectangle dst;
|
||||
float max_w;
|
||||
float max_h;
|
||||
float scale;
|
||||
float w;
|
||||
float h;
|
||||
|
||||
if(texture.id == 0 || bottom_y <= top_y)
|
||||
return;
|
||||
|
||||
max_w = (float)(view_width - flint_px(48));
|
||||
max_h = (float)(bottom_y - top_y);
|
||||
scale = max_w / (float)texture.width;
|
||||
if((float)texture.height * scale > max_h)
|
||||
scale = max_h / (float)texture.height;
|
||||
if(scale <= 0.0f)
|
||||
return;
|
||||
|
||||
w = (float)texture.width * scale;
|
||||
h = (float)texture.height * scale;
|
||||
src = (Rectangle){0, 0, (float)texture.width, (float)texture.height};
|
||||
dst = (Rectangle){((float)view_width - w) * 0.5f,
|
||||
(float)top_y + (max_h - h) * 0.5f,
|
||||
w, h};
|
||||
DrawTexturePro(texture, src, dst, (Vector2){0}, 0.0f, WHITE);
|
||||
}
|
||||
|
||||
void
|
||||
sun_salutation_draw_screen(InbeApp *app, int center_x, int center_y)
|
||||
{
|
||||
FlintUIIconRowItem controls[3];
|
||||
FlintUIIconRowResult row;
|
||||
Texture2D pose;
|
||||
const char *step_label;
|
||||
int step;
|
||||
int repetition;
|
||||
int repetitions;
|
||||
int pose_index;
|
||||
int title_font = flint_ui_font();
|
||||
int text_w;
|
||||
int return_hover = 0;
|
||||
int content_top = flint_px(72);
|
||||
const char *warning_text = locale_get("sun_salutation_work_in_progress");
|
||||
int warning_font = flint_ui_font_small();
|
||||
int warning_y;
|
||||
int image_bottom;
|
||||
int min_view_dim = view_width < view_height ? view_width : view_height;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
|
||||
if(ui_draw_icon_btn_padded(flint_px(12), flint_px(12), flint_px(24),
|
||||
flint_px(10), app->icons[UI_ICON_TYPE_RETURN], &return_hover)) {
|
||||
sun_salutation_request_exit(app);
|
||||
return;
|
||||
}
|
||||
|
||||
if(app->modal.active && app->modal.type == UIModalConfirmExitSession) {
|
||||
int modal_result = ui_draw_modal(locale_get("exit_session_title"),
|
||||
locale_get("all_progress_lost_message"),
|
||||
locale_get("cancel_button"),
|
||||
locale_get("exit_button"));
|
||||
if(modal_result == 1)
|
||||
app_close_modal(app);
|
||||
else if(modal_result == 2)
|
||||
sun_salutation_exit_to_start(app);
|
||||
return;
|
||||
}
|
||||
|
||||
step = app->sun_salutation.step;
|
||||
repetition = app->sun_salutation.repetition;
|
||||
repetitions = app->sun_salutation.repetitions;
|
||||
if(repetitions < 2 || repetitions > 12)
|
||||
repetitions = SUN_SALUTATION_DEFAULT_REPETITIONS;
|
||||
if(app->sun_salutation.start_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.start_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.start_seconds = SUN_SALUTATION_DEFAULT_START_SECONDS;
|
||||
if(app->sun_salutation.end_seconds < SUN_SALUTATION_SECONDS_MIN ||
|
||||
app->sun_salutation.end_seconds > SUN_SALUTATION_SECONDS_MAX)
|
||||
app->sun_salutation.end_seconds = SUN_SALUTATION_DEFAULT_END_SECONDS;
|
||||
if(app->sun_salutation.start_seconds < app->sun_salutation.end_seconds)
|
||||
app->sun_salutation.end_seconds = app->sun_salutation.start_seconds;
|
||||
if(step < 0)
|
||||
step = 0;
|
||||
if(step >= SUN_SALUTATION_STEP_COUNT)
|
||||
step = SUN_SALUTATION_STEP_COUNT - 1;
|
||||
if(repetition < 0)
|
||||
repetition = 0;
|
||||
if(repetition >= repetitions)
|
||||
repetition = repetitions - 1;
|
||||
app->sun_salutation.step = step;
|
||||
app->sun_salutation.repetition = repetition;
|
||||
app->sun_salutation.repetitions = repetitions;
|
||||
pose_index = sun_salutation_step_pose_index(step);
|
||||
pose = app->sun_salutation.poses[pose_index];
|
||||
|
||||
step_label = sun_salutation_step_label(step);
|
||||
text_w = flint_text_measure(step_label, title_font);
|
||||
if(text_w > view_width - flint_px(64))
|
||||
title_font = flint_ui_font_small();
|
||||
text_w = flint_text_measure(step_label, title_font);
|
||||
flint_text_draw(step_label, center_x - text_w / 2,
|
||||
flint_ui_text_y(step_label, flint_px(12), flint_px(44), title_font),
|
||||
title_font, flint_theme_get_text());
|
||||
text_w = flint_text_measure(warning_text, warning_font);
|
||||
warning_y = flint_px(50);
|
||||
flint_text_draw(warning_text, center_x - text_w / 2,
|
||||
flint_ui_text_y(warning_text, warning_y, flint_px(28), warning_font),
|
||||
warning_font, flint_theme_get_text());
|
||||
|
||||
controls[0] = (FlintUIIconRowItem){app->icons[UI_ICON_TYPE_BACKWARD],
|
||||
step <= 0 && repetition <= 0};
|
||||
controls[1] = (FlintUIIconRowItem){app->session_paused ? app->icons[UI_ICON_TYPE_PLAY] :
|
||||
app->icons[UI_ICON_TYPE_PAUSE],
|
||||
0};
|
||||
controls[2] = (FlintUIIconRowItem){app->icons[UI_ICON_TYPE_FORWARD], 0};
|
||||
row = ui_draw_bottom_icon_row((FlintUIBottomIconRow){
|
||||
.center_x = center_x,
|
||||
.view_width = view_width,
|
||||
.view_height = view_height,
|
||||
.count = 3,
|
||||
.items = controls,
|
||||
.icon_size = flint_px(24),
|
||||
.icon_padding = flint_px(10),
|
||||
.gap = flint_px(12),
|
||||
.side_margin = flint_px(24),
|
||||
.bottom_margin = flint_px(6),
|
||||
.max_button_width = min_view_dim / 6,
|
||||
.min_icon_size = flint_px(16),
|
||||
.min_icon_padding = flint_px(6),
|
||||
.min_gap = flint_px(8)
|
||||
});
|
||||
|
||||
image_bottom = row.y - flint_px(18);
|
||||
draw_pose_image(pose, content_top, image_bottom);
|
||||
|
||||
if(row.clicked_index == 0)
|
||||
sun_salutation_step_back(app);
|
||||
else if(row.clicked_index == 1)
|
||||
app->session_paused = !app->session_paused;
|
||||
else if(row.clicked_index == 2)
|
||||
sun_salutation_step_forward(app);
|
||||
|
||||
sun_salutation_update_timer(app);
|
||||
|
||||
(void)center_y;
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "practices/practice_registry.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if ANDROID_BUILD
|
||||
#include "android_timer.h"
|
||||
@@ -19,6 +20,10 @@ extern int view_width;
|
||||
extern int view_height;
|
||||
|
||||
static int whm_background_remainder_ms = 0;
|
||||
#if ANDROID_BUILD
|
||||
static char whm_last_notification_text[96] = "";
|
||||
static void stop_android_background_session(InbeApp *app);
|
||||
#endif
|
||||
|
||||
static Color
|
||||
text_color_for_background(Color background)
|
||||
@@ -153,6 +158,49 @@ remember_sound_state(InbeApp *app)
|
||||
cpcount(app->sound_last_count, app->inbe.count);
|
||||
}
|
||||
|
||||
#if ANDROID_BUILD
|
||||
static void
|
||||
session_update_notification(InbeApp *app)
|
||||
{
|
||||
char text[96] = "";
|
||||
int count;
|
||||
|
||||
if(app == NULL || app->inbe.screen != InbeScreenSession)
|
||||
return;
|
||||
|
||||
count = int_from_count(app->inbe.count);
|
||||
switch(app->inbe.phase) {
|
||||
case InbePhaseBreathe:
|
||||
locale_format(text, sizeof(text), "notification_breathing_count", count);
|
||||
break;
|
||||
case InbePhaseHold:
|
||||
locale_format(text, sizeof(text), "notification_hold_seconds", count);
|
||||
break;
|
||||
case InbePhaseRecover:
|
||||
locale_format(text, sizeof(text), "notification_breath_in_seconds", count);
|
||||
break;
|
||||
case InbePhaseStarting:
|
||||
locale_format(text, sizeof(text), "notification_starting_seconds",
|
||||
app->inbe.pause_seconds > 0
|
||||
? app->inbe.pause_seconds - app->inbe.sectick / 60
|
||||
: 0);
|
||||
break;
|
||||
case InbePhaseNext:
|
||||
locale_format(text, sizeof(text), "notification_next_round");
|
||||
break;
|
||||
default:
|
||||
locale_format(text, sizeof(text), "notification_session_active");
|
||||
break;
|
||||
}
|
||||
|
||||
if(strcmp(text, whm_last_notification_text) == 0)
|
||||
return;
|
||||
|
||||
snprintf(whm_last_notification_text, sizeof(whm_last_notification_text), "%s", text);
|
||||
android_wakelock_update_session_notification(text);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
update_session_sounds(InbeApp *app)
|
||||
{
|
||||
@@ -197,6 +245,9 @@ session_background_start(InbeApp *app)
|
||||
if(app == NULL)
|
||||
return;
|
||||
whm_background_remainder_ms = 0;
|
||||
#if ANDROID_BUILD
|
||||
whm_last_notification_text[0] = '\0';
|
||||
#endif
|
||||
remember_sound_state(app);
|
||||
}
|
||||
|
||||
@@ -221,6 +272,9 @@ session_advance_elapsed(InbeApp *app, int elapsed_ms)
|
||||
for(int i = 0; i < frame_count && app->inbe.screen == InbeScreenSession; i++) {
|
||||
inbestep(&app->inbe);
|
||||
practice_update_session_sounds(app);
|
||||
#if ANDROID_BUILD
|
||||
session_update_notification(app);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +307,11 @@ session_start(InbeApp *app)
|
||||
android_keep_screen_on();
|
||||
#endif
|
||||
TraceLog(LOG_INFO, "INBE: Starting session - play_in_background = %d", app->inbe.play_in_background);
|
||||
practice_active_background_start(app);
|
||||
practice_background_start(app, PRACTICE_WHM);
|
||||
#if ANDROID_BUILD
|
||||
whm_last_notification_text[0] = '\0';
|
||||
session_update_notification(app);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -362,6 +420,7 @@ finish_round(InbeApp *app)
|
||||
if(session_ensure_results_saved(app)) {
|
||||
#if ANDROID_BUILD
|
||||
android_allow_screen_off();
|
||||
stop_android_background_session(app);
|
||||
#endif
|
||||
app_switch_screen(app, InbeScreenResults);
|
||||
} else {
|
||||
@@ -572,7 +631,15 @@ session_draw_start_preview(InbeApp *app, int center_x, int center_y)
|
||||
int clicked = 0;
|
||||
int released = IsMouseButtonReleased(MOUSE_BUTTON_LEFT);
|
||||
const char *play_text = locale_get("play_button");
|
||||
const char *practice_text = practice_label(app->exercise_type);
|
||||
const char *warning_text = "Work in progress";
|
||||
int font = FLINT_TEXT_16;
|
||||
int practice_font = flint_ui_font();
|
||||
int warning_font = flint_ui_font_small();
|
||||
int practice_w;
|
||||
int practice_y;
|
||||
int warning_w;
|
||||
int warning_y;
|
||||
float scale = 1.0f;
|
||||
|
||||
int radius = flint_px(44);
|
||||
@@ -604,12 +671,31 @@ session_draw_start_preview(InbeApp *app, int center_x, int center_y)
|
||||
}
|
||||
|
||||
int scaled_radius = (int)(radius * scale);
|
||||
practice_w = flint_text_measure(practice_text, practice_font);
|
||||
if(practice_w > view_width - flint_px(48))
|
||||
practice_font = flint_ui_font_small();
|
||||
practice_w = flint_text_measure(practice_text, practice_font);
|
||||
practice_y = center_y - scaled_radius - flint_px(42);
|
||||
if(practice_y < flint_px(8))
|
||||
practice_y = flint_px(8);
|
||||
flint_text_draw(practice_text, center_x - practice_w / 2,
|
||||
flint_ui_text_y(practice_text, practice_y, flint_px(32), practice_font),
|
||||
practice_font, flint_theme_get_text());
|
||||
|
||||
DrawCircle(center_x, center_y, scaled_radius, flint_theme_get_circle());
|
||||
DrawCircleLines(center_x, center_y, scaled_radius, flint_theme_get_text());
|
||||
|
||||
// Draw PLAY text in center
|
||||
flint_ui_draw_text_centered(play_text, center_x, center_y, font, text_color_for_background(flint_theme_get_circle()));
|
||||
|
||||
if(app->exercise_type == EXERCISE_SUN_SALUTATION) {
|
||||
warning_w = flint_text_measure(warning_text, warning_font);
|
||||
warning_y = center_y + scaled_radius + flint_px(14);
|
||||
flint_text_draw(warning_text, center_x - warning_w / 2,
|
||||
flint_ui_text_y(warning_text, warning_y, flint_px(28), warning_font),
|
||||
warning_font, flint_theme_get_text());
|
||||
}
|
||||
|
||||
if(active) {
|
||||
app->cursor_clickable = 1;
|
||||
}
|
||||
@@ -808,11 +894,11 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
|
||||
draw_session_status(app, center_x, center_y);
|
||||
draw_session_round_label(app);
|
||||
|
||||
if(!app->session_paused && !(
|
||||
if(!app->session_paused && (
|
||||
#if defined(PLATFORM_WEB)
|
||||
app->backgrounded
|
||||
!app->backgrounded
|
||||
#else
|
||||
0
|
||||
!app->backgrounded || app->inbe.play_in_background
|
||||
#endif
|
||||
)) {
|
||||
#if ANDROID_BUILD
|
||||
@@ -828,6 +914,9 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
|
||||
inbestep(&app->inbe);
|
||||
update_session_sounds(app);
|
||||
}
|
||||
#if ANDROID_BUILD
|
||||
session_update_notification(app);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(app->inbe.phase != InbePhaseHold)
|
||||
|
||||
@@ -307,12 +307,7 @@ void
|
||||
draw_habit_edit_screen(InbeApp *app)
|
||||
{
|
||||
const char *title;
|
||||
const char *activity_options[] = {
|
||||
"Wim Hof Breathing",
|
||||
"Meditation",
|
||||
"Sun Salutation",
|
||||
"7-Minute Workout"
|
||||
};
|
||||
const char *activity_options[EXERCISE_COUNT];
|
||||
Color color_options[6];
|
||||
int top_h = flint_px(58);
|
||||
int bottom_reserved;
|
||||
@@ -330,6 +325,8 @@ draw_habit_edit_screen(InbeApp *app)
|
||||
if(app == NULL)
|
||||
return;
|
||||
bottom_reserved = app_content_bottom_reserved(app);
|
||||
for(int i = 0; i < EXERCISE_COUNT; i++)
|
||||
activity_options[i] = practice_activity_label(i);
|
||||
|
||||
if(!app->habit_edit.active) {
|
||||
app->habits.tab = app->habits.view_mode == HABIT_VIEW_WEEKLY
|
||||
|
||||
@@ -276,7 +276,9 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
|
||||
|
||||
snprintf(time_text, sizeof(time_text), "%02d:%02d",
|
||||
ctx->entries[i].hour, ctx->entries[i].minute);
|
||||
if(activity == EXERCISE_MEDITATION)
|
||||
if(activity == EXERCISE_SUN_SALUTATION)
|
||||
snprintf(summary_text, sizeof(summary_text), "1 session");
|
||||
else if(activity == EXERCISE_MEDITATION)
|
||||
habit_format_duration(ctx->entries[i].total_seconds,
|
||||
summary_text, sizeof(summary_text));
|
||||
else
|
||||
@@ -303,7 +305,8 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
|
||||
}
|
||||
y += row_h;
|
||||
|
||||
if(activity == EXERCISE_MEDITATION) {
|
||||
if(activity == EXERCISE_MEDITATION ||
|
||||
activity == EXERCISE_SUN_SALUTATION) {
|
||||
y += flint_px(4);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
|
||||
/* Helper functions */
|
||||
static void habits_add_seed(InbeHabits *habits, const char *id, const char *name,
|
||||
Color color, int activity_mask);
|
||||
static void habits_repair_default_meditation_link(InbeHabits *habits);
|
||||
Color color, int activity_mask);
|
||||
|
||||
enum {
|
||||
HABITS_GUIDE_STEPS = 4,
|
||||
@@ -300,6 +299,8 @@ habits_add_default_set(InbeHabits *habits)
|
||||
habits_add_seed(habits, "meditation", "Meditation", (Color){126, 183, 230, 255},
|
||||
habit_activity_mask_for(EXERCISE_WIM_HOF) |
|
||||
habit_activity_mask_for(EXERCISE_MEDITATION));
|
||||
habits_add_seed(habits, "yoga", "Yoga", (Color){239, 178, 102, 255},
|
||||
habit_activity_mask_for(EXERCISE_SUN_SALUTATION));
|
||||
habits->selected = 0;
|
||||
habits->loaded = 1;
|
||||
habits_save(habits);
|
||||
@@ -429,7 +430,6 @@ habits_init(InbeHabits *habits)
|
||||
habits_add_default_set(habits);
|
||||
return;
|
||||
}
|
||||
habits_repair_default_meditation_link(habits);
|
||||
if(habits->count == 3 &&
|
||||
strcmp(habits->items[0].id, "mind") == 0 &&
|
||||
strcmp(habits->items[1].id, "yoga") == 0 &&
|
||||
@@ -852,25 +852,6 @@ habits_screen_top_reserved(InbeApp *app)
|
||||
return habits_screen_selector_height(app) + flint_px(HABITS_TAB_H);
|
||||
}
|
||||
|
||||
static void
|
||||
habits_repair_default_meditation_link(InbeHabits *habits)
|
||||
{
|
||||
int default_activity = habit_activity_mask_for(EXERCISE_WIM_HOF) |
|
||||
habit_activity_mask_for(EXERCISE_MEDITATION);
|
||||
|
||||
if(habits == NULL || habits->count != 1)
|
||||
return;
|
||||
if(strcmp(habits->items[0].name, "Meditation") != 0)
|
||||
return;
|
||||
if(habits->items[0].sync_mode == INBE_HABIT_SYNC_ACTIVITIES &&
|
||||
habits->items[0].sync_activity == default_activity)
|
||||
return;
|
||||
|
||||
habits->items[0].sync_mode = INBE_HABIT_SYNC_ACTIVITIES;
|
||||
habits->items[0].sync_activity = default_activity;
|
||||
habits_save(habits);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_habits_top_bar(InbeApp *app, int draw_menu)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,17 @@ practice_activity_for_tab(int tab, int index)
|
||||
return index;
|
||||
}
|
||||
|
||||
static int
|
||||
practice_screen_play_only(InbeApp *app)
|
||||
{
|
||||
const PracticeDefinition *practice;
|
||||
|
||||
if(app == NULL)
|
||||
return 0;
|
||||
practice = practice_get(app->exercise_type);
|
||||
return practice->draw_manual == NULL && practice->draw_config == NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
practice_activity_label(int exercise)
|
||||
{
|
||||
@@ -48,36 +59,63 @@ static int
|
||||
practice_screen_draw_tab_bar(InbeApp *app, int y)
|
||||
{
|
||||
FlintUISubtab tabs[PRACTICE_TAB_COUNT];
|
||||
int tab_values[PRACTICE_TAB_COUNT];
|
||||
const PracticeDefinition *practice;
|
||||
int tab_h = flint_px(PRACTICE_CATEGORY_TAB_H);
|
||||
int tab_count = 0;
|
||||
int selected_index = 0;
|
||||
int clicked;
|
||||
|
||||
if(app == NULL)
|
||||
return -1;
|
||||
|
||||
tabs[PRACTICE_TAB_PLAY] = (FlintUISubtab){
|
||||
practice = practice_get(app->exercise_type);
|
||||
if(practice_screen_play_only(app)) {
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(practice->draw_manual != NULL) {
|
||||
tabs[tab_count] = (FlintUISubtab){
|
||||
.icon = app->icons[UI_ICON_TYPE_MANUAL],
|
||||
.icon_size = flint_px(20),
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
tab_values[tab_count++] = PRACTICE_TAB_MANUAL;
|
||||
}
|
||||
tabs[tab_count] = (FlintUISubtab){
|
||||
.icon = app->icons[UI_ICON_TYPE_SUN],
|
||||
.icon_size = flint_px(20),
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
tabs[PRACTICE_TAB_MANUAL] = (FlintUISubtab){
|
||||
.icon = app->icons[UI_ICON_TYPE_MANUAL],
|
||||
.icon_size = flint_px(20),
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
tabs[PRACTICE_TAB_CONFIG] = (FlintUISubtab){
|
||||
.icon = app->icons[UI_ICON_TYPE_WRENCH],
|
||||
.icon_size = flint_px(20),
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
tab_values[tab_count++] = PRACTICE_TAB_PLAY;
|
||||
if(practice->draw_config != NULL) {
|
||||
tabs[tab_count] = (FlintUISubtab){
|
||||
.icon = app->icons[UI_ICON_TYPE_WRENCH],
|
||||
.icon_size = flint_px(20),
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
tab_values[tab_count++] = PRACTICE_TAB_CONFIG;
|
||||
}
|
||||
|
||||
if(app->practice_tab < 0 || app->practice_tab >= PRACTICE_TAB_COUNT)
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
for(int i = 0; i < tab_count; i++) {
|
||||
if(tab_values[i] == app->practice_tab) {
|
||||
selected_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(tab_values[selected_index] != app->practice_tab)
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
|
||||
return ui_draw_subtab_bar((FlintUISubtabBar){
|
||||
clicked = ui_draw_subtab_bar((FlintUISubtabBar){
|
||||
.bounds = {0, (float)y, (float)view_width, (float)tab_h},
|
||||
.tabs = tabs,
|
||||
.count = PRACTICE_TAB_COUNT,
|
||||
.selected_index = app->practice_tab
|
||||
.count = tab_count,
|
||||
.selected_index = selected_index
|
||||
});
|
||||
return clicked >= 0 && clicked < tab_count ? tab_values[clicked] : -1;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -92,6 +130,8 @@ practice_screen_open_tab(InbeApp *app, int tab)
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
app_switch_screen(app, InbeScreenStart);
|
||||
} else if(tab == PRACTICE_TAB_MANUAL) {
|
||||
if(practice_get(app->exercise_type)->draw_manual == NULL)
|
||||
return;
|
||||
if(app->practice_tab == PRACTICE_TAB_CONFIG)
|
||||
app_leave_practice_config(app);
|
||||
app->practice_tab = PRACTICE_TAB_MANUAL;
|
||||
@@ -99,6 +139,8 @@ practice_screen_open_tab(InbeApp *app, int tab)
|
||||
app->manual_scroll = 0;
|
||||
app_switch_screen(app, InbeScreenStart);
|
||||
} else if(tab == PRACTICE_TAB_CONFIG) {
|
||||
if(practice_get(app->exercise_type)->draw_config == NULL)
|
||||
return;
|
||||
if(app->practice_tab != PRACTICE_TAB_CONFIG) {
|
||||
reset_settings_preview(app);
|
||||
app->settings_scroll = 0;
|
||||
@@ -217,11 +259,13 @@ practice_screen_draw_top_bar(InbeApp *app, int draw_menu)
|
||||
}
|
||||
|
||||
// Keep existing subtab bar for Play/Manual/Config (works in both modes)
|
||||
{
|
||||
if(!practice_screen_play_only(app)) {
|
||||
int clicked = practice_screen_draw_tab_bar(app,
|
||||
practice_screen_selector_height(app));
|
||||
if(clicked >= 0 && clicked != app->practice_tab)
|
||||
practice_screen_open_tab(app, clicked);
|
||||
} else {
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +339,7 @@ int
|
||||
practice_screen_first_run_guide_active(const InbeApp *app)
|
||||
{
|
||||
return app != NULL && !app->tutorial_seen && !app->modal.active &&
|
||||
app->exercise_type != EXERCISE_SUN_SALUTATION &&
|
||||
app->inbe.screen == InbeScreenStart;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ enum {
|
||||
#define SETTINGS_SYNC_KEY_IMPORT_FILTER ".key"
|
||||
#define SETTINGS_ANDROID_DATA_IMPORT_MIME_TYPES "application/zip,application/x-zip-compressed,application/vnd.sqlite3,application/x-sqlite,application/x-sqlite3,application/octet-stream"
|
||||
#define SETTINGS_ANDROID_SYNC_KEY_IMPORT_MIME_TYPES "*/*"
|
||||
#define SETTINGS_DATA_TOP_PADDING 8
|
||||
|
||||
#if defined(INBE_HAS_FLINT_FILE_DIALOG)
|
||||
static FlintFileDialog export_dlg;
|
||||
@@ -228,7 +229,7 @@ settings_draw_sync_review_modal(InbeApp *app)
|
||||
frame = ui_draw_modal_frame(modal_w, modal_h, "Sync needs review",
|
||||
(Texture2D){0}, (Texture2D){0});
|
||||
intro = (FlintUIParagraph){
|
||||
.text = "Review data differences. Deleted remote rows are ignored.",
|
||||
.text = "Review data differences.",
|
||||
.width = frame.content_w,
|
||||
.font = flint_ui_font_small(),
|
||||
.line_gap = flint_px(2),
|
||||
@@ -343,7 +344,8 @@ settings_data_content_height(int content_w)
|
||||
{
|
||||
int data_button_h = flint_px(36);
|
||||
|
||||
return data_button_h + flint_px(12) +
|
||||
return flint_px(SETTINGS_DATA_TOP_PADDING) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
@@ -551,6 +553,7 @@ settings_data_draw(InbeApp *app, int x, int w, int *y)
|
||||
return;
|
||||
}
|
||||
|
||||
*y += flint_px(SETTINGS_DATA_TOP_PADDING);
|
||||
if(ui_draw_generic_button(x, *y, w, data_button_h,
|
||||
locale_get("sync_configure_account_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover_account))
|
||||
|
||||
@@ -74,16 +74,12 @@ settings_device_draw_toggle_row(int x, int w, int *y, const char *label, int *va
|
||||
int
|
||||
settings_device_content_height(int content_w)
|
||||
{
|
||||
int height = flint_px(74) + flint_px(74) + flint_px(76) + flint_px(40);
|
||||
int height = flint_px(76) + flint_px(76) + flint_px(40);
|
||||
int label_w = content_w > 0 ? content_w : flint_px(240);
|
||||
|
||||
#if ANDROID_BUILD || defined(PLATFORM_WEB)
|
||||
height += settings_device_toggle_row_height(locale_get("play_in_background_label"), label_w);
|
||||
#endif
|
||||
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
|
||||
height += flint_px(50);
|
||||
#endif
|
||||
height += settings_device_toggle_row_height(locale_get("show_session_volume_control_label"), label_w);
|
||||
height += settings_device_toggle_row_height(locale_get("on_screen_keyboard_label"), label_w);
|
||||
return height;
|
||||
}
|
||||
@@ -91,8 +87,6 @@ settings_device_content_height(int content_w)
|
||||
void
|
||||
settings_device_draw(InbeApp *app, int x, int w, int *y, SettingsDeviceState *state)
|
||||
{
|
||||
int sound_volume;
|
||||
int show_session_volume;
|
||||
int keyboard_toggle;
|
||||
const char *orientation_options[] = {
|
||||
locale_get("orientation_system"),
|
||||
@@ -105,40 +99,14 @@ settings_device_draw(InbeApp *app, int x, int w, int *y, SettingsDeviceState *st
|
||||
if(app == NULL || y == NULL || state == NULL)
|
||||
return;
|
||||
|
||||
sound_volume = app->sound_volume;
|
||||
show_session_volume = app->show_session_volume_control;
|
||||
keyboard_toggle = app->on_screen_keyboard_enabled;
|
||||
|
||||
if(language_dropdown_button(app, 101, x, *y, w, flint_px(36), &app->language_index))
|
||||
flint_text_draw(locale_get("language_label"), x, *y, flint_ui_font(), flint_theme_get_text());
|
||||
if(language_dropdown_button(app, 101, x, *y + flint_px(26), w, flint_px(36),
|
||||
&app->language_index))
|
||||
state->language_menu_changed = 1;
|
||||
state->draw_language_menu = 1;
|
||||
*y += flint_px(74);
|
||||
|
||||
if(ui_draw_slider(6, x, *y, w, locale_get("volume_label"),
|
||||
SETTINGS_VOLUME_MIN, SETTINGS_VOLUME_MAX, &sound_volume, "")) {
|
||||
app->sound_volume = sound_volume;
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
}
|
||||
*y += flint_px(74);
|
||||
|
||||
if(settings_device_draw_toggle_row(x, w, y, locale_get("show_session_volume_control_label"),
|
||||
&show_session_volume)) {
|
||||
app->show_session_volume_control = show_session_volume;
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
}
|
||||
|
||||
#if ANDROID_BUILD || defined(PLATFORM_WEB)
|
||||
{
|
||||
int play_in_background = app->inbe.play_in_background;
|
||||
if(settings_device_draw_toggle_row(x, w, y, locale_get("play_in_background_label"),
|
||||
&play_in_background)) {
|
||||
app->inbe.play_in_background = play_in_background;
|
||||
app->settings_dirty = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*y += flint_px(76);
|
||||
|
||||
{
|
||||
int orientation_max = orientation_option_count - 1;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "flint_locale.h"
|
||||
#include "settings_data.h"
|
||||
#include "settings_device.h"
|
||||
#include "settings_session.h"
|
||||
#include "settings_theme.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
@@ -12,6 +13,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define SETTINGS_CONTENT_TOP_PADDING 8
|
||||
|
||||
extern int view_width;
|
||||
extern int view_height;
|
||||
|
||||
@@ -20,26 +23,28 @@ static char unified_detail[256] = "";
|
||||
static int unified_status_type = 0;
|
||||
|
||||
static int
|
||||
settings_draw_subtab_bar(int y, int h, const char **tab_names, int tab_count,
|
||||
int selected_tab)
|
||||
settings_draw_desktop_tab_bar(InbeApp *app, int y, const char **tab_names)
|
||||
{
|
||||
enum { SETTINGS_SUBTAB_RENDER_MAX = 8 };
|
||||
FlintUISubtab tabs[SETTINGS_SUBTAB_RENDER_MAX];
|
||||
FlintUITab tabs[SETTINGS_TAB_COUNT];
|
||||
|
||||
if(tab_count <= 0 || tab_count > SETTINGS_SUBTAB_RENDER_MAX)
|
||||
if(app == NULL)
|
||||
return -1;
|
||||
|
||||
for(int i = 0; i < tab_count; i++) {
|
||||
tabs[i] = (FlintUISubtab){0};
|
||||
tabs[i].label = tab_names[i];
|
||||
tabs[i].disabled = 0;
|
||||
}
|
||||
for(int i = 0; i < SETTINGS_TAB_COUNT; i++)
|
||||
tabs[i] = (FlintUITab){
|
||||
.label = tab_names[i],
|
||||
.icon = (Texture2D){0},
|
||||
.icon_size = 0,
|
||||
.disabled = app->modal.active
|
||||
};
|
||||
|
||||
return ui_draw_subtab_bar((FlintUISubtabBar){
|
||||
.bounds = {0, (float)y, (float)view_width, (float)h},
|
||||
return ui_draw_tab_bar((FlintUITabBar){
|
||||
.bounds = {0, (float)y, (float)view_width, (float)ui_tab_bar_height()},
|
||||
.tabs = tabs,
|
||||
.count = tab_count,
|
||||
.selected_index = selected_tab
|
||||
.count = SETTINGS_TAB_COUNT,
|
||||
.selected_index = app->settings_tab,
|
||||
.min_tab_width = flint_px(110),
|
||||
.max_tab_width = flint_px(170)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -118,6 +123,8 @@ settings_tab_content_height(InbeApp *app, int tab, int content_w)
|
||||
{
|
||||
if(tab == SETTINGS_TAB_THEME)
|
||||
return settings_theme_content_height(content_w);
|
||||
if(tab == SETTINGS_TAB_SESSION)
|
||||
return settings_session_content_height(content_w);
|
||||
if(tab == SETTINGS_TAB_DEVICE)
|
||||
return settings_device_content_height(content_w);
|
||||
if(settings_data_is_configuring(app))
|
||||
@@ -144,18 +151,17 @@ settings_scroll_page_content_height(int content_w, void *user_data)
|
||||
int
|
||||
settings_screen_draw(InbeApp *app)
|
||||
{
|
||||
int top_margin = 0;
|
||||
int main_header_h;
|
||||
int detail_header_h;
|
||||
int top_tab_h;
|
||||
int top_tab_y;
|
||||
int tab_gap;
|
||||
int selector_h;
|
||||
int tab_content_start_y;
|
||||
int content_viewport_h;
|
||||
int clicked_top_tab = -1;
|
||||
int selected_tab;
|
||||
int clicked_tab = -1;
|
||||
int draw_settings_menu = 0;
|
||||
const char *settings_tabs[] = {
|
||||
locale_get("settings_section_session"),
|
||||
locale_get("settings_tab_device"),
|
||||
locale_get("settings_tab_theme"),
|
||||
locale_get("settings_section_appearance"),
|
||||
locale_get("settings_tab_data"),
|
||||
};
|
||||
SettingsDeviceState device_state = {0};
|
||||
@@ -163,22 +169,13 @@ settings_screen_draw(InbeApp *app)
|
||||
if(IsMouseButtonReleased(MOUSE_BUTTON_LEFT))
|
||||
app->settings_drag_slider = 0;
|
||||
|
||||
if(app->settings_tab < SETTINGS_TAB_DEVICE || app->settings_tab >= SETTINGS_TAB_COUNT)
|
||||
app->settings_tab = SETTINGS_TAB_DEVICE;
|
||||
if(app->settings_tab < SETTINGS_TAB_SESSION || app->settings_tab >= SETTINGS_TAB_COUNT)
|
||||
app->settings_tab = SETTINGS_TAB_SESSION;
|
||||
selected_tab = app->settings_tab;
|
||||
|
||||
if(settings_data_draw_pending_file_dialog(app))
|
||||
return 1;
|
||||
|
||||
main_header_h = settings_data_is_configuring(app) ? 0 : flint_px(58);
|
||||
if(main_header_h > 0) {
|
||||
Texture2D left_icon = (Texture2D){0};
|
||||
FlintUIHeader header = ui_draw_title_header(main_header_h,
|
||||
locale_get("settings_title"),
|
||||
left_icon,
|
||||
(Texture2D){0});
|
||||
(void)header.left_clicked;
|
||||
}
|
||||
|
||||
detail_header_h = settings_data_is_configuring(app) ? flint_px(58) : 0;
|
||||
if(detail_header_h > 0) {
|
||||
FlintUIHeader header = ui_draw_title_header(detail_header_h,
|
||||
@@ -193,10 +190,10 @@ settings_screen_draw(InbeApp *app)
|
||||
}
|
||||
}
|
||||
|
||||
top_tab_h = detail_header_h > 0 ? 0 : flint_px(40);
|
||||
top_tab_y = top_margin + main_header_h + detail_header_h;
|
||||
tab_gap = top_tab_h > 0 ? flint_px(14) : 0;
|
||||
tab_content_start_y = top_tab_y + top_tab_h + tab_gap;
|
||||
selector_h = detail_header_h > 0 ? 0 : ui_tab_bar_height();
|
||||
tab_content_start_y = detail_header_h + selector_h;
|
||||
if(selector_h > 0)
|
||||
tab_content_start_y += flint_px(SETTINGS_CONTENT_TOP_PADDING);
|
||||
content_viewport_h = view_height - tab_content_start_y - app_content_bottom_reserved(app);
|
||||
|
||||
#if ANDROID_BUILD
|
||||
@@ -208,11 +205,33 @@ settings_screen_draw(InbeApp *app)
|
||||
if(content_viewport_h < 0)
|
||||
content_viewport_h = 0;
|
||||
|
||||
if(top_tab_h > 0)
|
||||
clicked_top_tab = settings_draw_subtab_bar(top_tab_y, top_tab_h, settings_tabs,
|
||||
SETTINGS_TAB_COUNT, app->settings_tab);
|
||||
if(clicked_top_tab != -1) {
|
||||
app->settings_tab = clicked_top_tab;
|
||||
if(selector_h > 0) {
|
||||
selected_tab = app->settings_tab;
|
||||
if(app_should_use_tab_bar(app)) {
|
||||
clicked_tab = settings_draw_desktop_tab_bar(app, 0, settings_tabs);
|
||||
} else {
|
||||
(void)ui_draw_toolbar_header((FlintUIToolbarHeader){
|
||||
.leading_icon = (Texture2D){0},
|
||||
.toolbar = (FlintUIToolbar){
|
||||
.id = 302,
|
||||
.height = selector_h,
|
||||
.options = app->modal.active ? NULL : settings_tabs,
|
||||
.option_count = app->modal.active ? 0 : SETTINGS_TAB_COUNT,
|
||||
.selected_index = &selected_tab,
|
||||
.dropdown_min_width = flint_px(150),
|
||||
.dropdown_height = flint_px(36),
|
||||
.side_padding = -1
|
||||
}
|
||||
});
|
||||
draw_settings_menu = !app->modal.active;
|
||||
}
|
||||
}
|
||||
|
||||
if(clicked_tab >= 0 && clicked_tab < SETTINGS_TAB_COUNT)
|
||||
selected_tab = clicked_tab;
|
||||
|
||||
if(selected_tab != app->settings_tab) {
|
||||
app->settings_tab = selected_tab;
|
||||
app->settings_scroll = 0;
|
||||
app->settings_data_view = 0;
|
||||
if(app->modal.type == UIModalThemePicker) {
|
||||
@@ -236,6 +255,8 @@ settings_screen_draw(InbeApp *app)
|
||||
|
||||
if(app->settings_tab == SETTINGS_TAB_THEME)
|
||||
settings_theme_draw(app, page.content_x, page.content_w, &y, &app->theme_state);
|
||||
else if(app->settings_tab == SETTINGS_TAB_SESSION)
|
||||
settings_session_draw(app, page.content_x, page.content_w, &y);
|
||||
else if(app->settings_tab == SETTINGS_TAB_DEVICE)
|
||||
settings_device_draw(app, page.content_x, page.content_w, &y, &device_state);
|
||||
else
|
||||
@@ -244,6 +265,20 @@ settings_screen_draw(InbeApp *app)
|
||||
ui_scroll_page_end(page);
|
||||
}
|
||||
|
||||
if(draw_settings_menu) {
|
||||
ui_set_dropdown_clip_top(tab_content_start_y);
|
||||
if(ui_draw_dropdown_menu(302) && selected_tab != app->settings_tab) {
|
||||
app->settings_tab = selected_tab;
|
||||
app->settings_scroll = 0;
|
||||
app->settings_data_view = 0;
|
||||
if(app->modal.type == UIModalThemePicker) {
|
||||
app_close_modal(app);
|
||||
}
|
||||
settings_screen_clear_status();
|
||||
}
|
||||
ui_set_dropdown_clip_top(0);
|
||||
}
|
||||
|
||||
ui_set_dropdown_clip_top(tab_content_start_y);
|
||||
if(app->settings_tab == SETTINGS_TAB_THEME)
|
||||
settings_theme_handle_overlays(app, &app->theme_state);
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
#include "settings_session.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "app_settings.h"
|
||||
#include "flint_locale.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
#define SETTINGS_SESSION_SLIDER_ROW_H 52
|
||||
|
||||
static FlintUIParagraph
|
||||
settings_session_label_paragraph(const char *label, int w)
|
||||
{
|
||||
return (FlintUIParagraph){
|
||||
.text = label,
|
||||
.width = w
|
||||
};
|
||||
}
|
||||
|
||||
static int
|
||||
settings_session_toggle_row_height(const char *label, int w)
|
||||
{
|
||||
int label_h;
|
||||
int row_h;
|
||||
|
||||
if(w <= 0)
|
||||
w = flint_px(160);
|
||||
|
||||
label_h = flint_ui_paragraph_height(settings_session_label_paragraph(label, w));
|
||||
row_h = label_h + flint_px(8) + flint_px(30) + flint_px(22);
|
||||
if(row_h < flint_px(76))
|
||||
row_h = flint_px(76);
|
||||
return row_h;
|
||||
}
|
||||
|
||||
static int
|
||||
settings_session_draw_toggle_row(int x, int w, int *y, const char *label, int *value)
|
||||
{
|
||||
int label_y;
|
||||
int label_h;
|
||||
int row_h;
|
||||
int toggle_w = flint_px(56);
|
||||
int toggle_h = flint_px(30);
|
||||
|
||||
if(y == NULL)
|
||||
return 0;
|
||||
|
||||
row_h = settings_session_toggle_row_height(label, w);
|
||||
label_y = *y;
|
||||
flint_ui_paragraph_draw(settings_session_label_paragraph(label, w), x, &label_y);
|
||||
label_h = label_y - *y;
|
||||
|
||||
if(ui_draw_toggle_switch(x, *y + label_h + flint_px(8), toggle_w, toggle_h,
|
||||
value, locale_get("toggle_off"),
|
||||
locale_get("toggle_on"))) {
|
||||
*y += row_h;
|
||||
return 1;
|
||||
}
|
||||
|
||||
*y += row_h;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
settings_session_content_height(int content_w)
|
||||
{
|
||||
int label_w = content_w > 0 ? content_w : flint_px(240);
|
||||
int height = flint_px(SETTINGS_SESSION_SLIDER_ROW_H) + flint_px(40);
|
||||
|
||||
height += settings_session_toggle_row_height(locale_get("show_session_volume_control_label"),
|
||||
label_w);
|
||||
height += settings_session_toggle_row_height(locale_get("play_in_background_label"),
|
||||
label_w);
|
||||
return height;
|
||||
}
|
||||
|
||||
void
|
||||
settings_session_draw(InbeApp *app, int x, int w, int *y)
|
||||
{
|
||||
int sound_volume;
|
||||
int show_session_volume;
|
||||
int play_in_background;
|
||||
|
||||
if(app == NULL || y == NULL)
|
||||
return;
|
||||
|
||||
sound_volume = app->sound_volume;
|
||||
if(ui_draw_slider(6, x, *y, w, locale_get("volume_label"),
|
||||
SETTINGS_VOLUME_MIN, SETTINGS_VOLUME_MAX, &sound_volume, "")) {
|
||||
app->sound_volume = sound_volume;
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
}
|
||||
*y += flint_px(SETTINGS_SESSION_SLIDER_ROW_H);
|
||||
|
||||
show_session_volume = app->show_session_volume_control;
|
||||
if(settings_session_draw_toggle_row(x, w, y,
|
||||
locale_get("show_session_volume_control_label"),
|
||||
&show_session_volume)) {
|
||||
app->show_session_volume_control = show_session_volume;
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
}
|
||||
|
||||
play_in_background = app->inbe.play_in_background;
|
||||
if(settings_session_draw_toggle_row(x, w, y, locale_get("play_in_background_label"),
|
||||
&play_in_background)) {
|
||||
app->inbe.play_in_background = play_in_background;
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef INBE_SETTINGS_SESSION_H
|
||||
#define INBE_SETTINGS_SESSION_H
|
||||
|
||||
#include "app_fwd.h"
|
||||
|
||||
int settings_session_content_height(int content_w);
|
||||
void settings_session_draw(InbeApp *app, int x, int w, int *y);
|
||||
|
||||
#endif
|
||||
@@ -245,6 +245,19 @@ schema_create(void)
|
||||
" queued_at INTEGER NOT NULL,"
|
||||
" UNIQUE(entity_type,entity_id,local_date)"
|
||||
");"
|
||||
"CREATE TABLE IF NOT EXISTS sync_ops("
|
||||
" op_id TEXT PRIMARY KEY,"
|
||||
" client_id TEXT NOT NULL,"
|
||||
" seq INTEGER NOT NULL,"
|
||||
" entity_type TEXT NOT NULL,"
|
||||
" entity_id TEXT NOT NULL,"
|
||||
" local_date INTEGER NOT NULL DEFAULT 0,"
|
||||
" op_type TEXT NOT NULL,"
|
||||
" payload_json TEXT NOT NULL DEFAULT '',"
|
||||
" created_at INTEGER NOT NULL,"
|
||||
" sent_at INTEGER NOT NULL DEFAULT 0,"
|
||||
" acked_at INTEGER NOT NULL DEFAULT 0"
|
||||
");"
|
||||
"INSERT OR IGNORE INTO meta(key,value) VALUES('schema_version','1');");
|
||||
}
|
||||
|
||||
@@ -417,6 +430,19 @@ migrate_schema(void)
|
||||
" local_date INTEGER NOT NULL DEFAULT 0,"
|
||||
" queued_at INTEGER NOT NULL,"
|
||||
" UNIQUE(entity_type,entity_id,local_date)"
|
||||
");"
|
||||
"CREATE TABLE IF NOT EXISTS sync_ops("
|
||||
" op_id TEXT PRIMARY KEY,"
|
||||
" client_id TEXT NOT NULL,"
|
||||
" seq INTEGER NOT NULL,"
|
||||
" entity_type TEXT NOT NULL,"
|
||||
" entity_id TEXT NOT NULL,"
|
||||
" local_date INTEGER NOT NULL DEFAULT 0,"
|
||||
" op_type TEXT NOT NULL,"
|
||||
" payload_json TEXT NOT NULL DEFAULT '',"
|
||||
" created_at INTEGER NOT NULL,"
|
||||
" sent_at INTEGER NOT NULL DEFAULT 0,"
|
||||
" acked_at INTEGER NOT NULL DEFAULT 0"
|
||||
");"))
|
||||
return 0;
|
||||
if(!had_outbox) {
|
||||
|
||||
@@ -23,6 +23,8 @@ static void review_append_local(ReviewText *out);
|
||||
static void review_append_remote(ReviewText *out, const char *json);
|
||||
static void review_append_unique_lines(ReviewText *out, const char *prefix,
|
||||
const char *lines, const char *other);
|
||||
static int review_has_pending_outbox(void);
|
||||
static int review_has_unknown_activity(const char *json);
|
||||
|
||||
static int
|
||||
review_reserve(ReviewText *text, size_t extra)
|
||||
@@ -226,17 +228,25 @@ review_activity_name(int activity)
|
||||
switch(activity) {
|
||||
case 0: return "Wim Hof";
|
||||
case 1: return "Meditation";
|
||||
case 2: return "Sun Salutation";
|
||||
default: break;
|
||||
}
|
||||
return "Unknown";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
review_activity_uses_duration(int activity)
|
||||
{
|
||||
return activity == 1;
|
||||
}
|
||||
|
||||
static void
|
||||
review_append_activity_heading(ReviewText *out, int activity)
|
||||
{
|
||||
review_append(out, review_activity_name(activity));
|
||||
if(activity != 0 && activity != 1)
|
||||
review_appendf(out, " %d", activity);
|
||||
const char *name = review_activity_name(activity);
|
||||
if(name == NULL)
|
||||
return;
|
||||
review_append(out, name);
|
||||
review_append(out, "\n");
|
||||
}
|
||||
|
||||
@@ -264,6 +274,25 @@ review_append_local_rounds(ReviewText *out, const char *session_id)
|
||||
review_append(out, "none");
|
||||
}
|
||||
|
||||
static void
|
||||
review_append_local_duration(ReviewText *out, const char *session_id)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int total = 0;
|
||||
|
||||
if(g_storage.db == NULL || session_id == NULL)
|
||||
return;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT COALESCE(SUM(seconds),0) FROM session_rounds WHERE session_id=?1",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return;
|
||||
bind_text(stmt, 1, session_id);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
total = sqlite3_column_int(stmt, 0);
|
||||
sqlite3_finalize(stmt);
|
||||
review_appendf(out, "duration %ds", total);
|
||||
}
|
||||
|
||||
static void
|
||||
review_append_local(ReviewText *out)
|
||||
{
|
||||
@@ -283,6 +312,8 @@ review_append_local(ReviewText *out)
|
||||
int local_date = sqlite3_column_int(stmt, 1);
|
||||
const char *time_text = (const char *)sqlite3_column_text(stmt, 2);
|
||||
int activity = sqlite3_column_int(stmt, 3);
|
||||
if(review_activity_name(activity) == NULL)
|
||||
continue;
|
||||
if(activity != last_activity) {
|
||||
if(rows > 0)
|
||||
review_append(out, "\n");
|
||||
@@ -292,8 +323,14 @@ review_append_local(ReviewText *out)
|
||||
review_appendf(out, "%04d-%02d-%02d %s\n",
|
||||
local_date / 10000, (local_date / 100) % 100,
|
||||
local_date % 100, time_text != NULL ? time_text : "--:--");
|
||||
review_append(out, "rounds ");
|
||||
review_append_local_rounds(out, id);
|
||||
if(activity == 2) {
|
||||
review_append(out, "session 1");
|
||||
} else if(review_activity_uses_duration(activity)) {
|
||||
review_append_local_duration(out, id);
|
||||
} else {
|
||||
review_append(out, "rounds ");
|
||||
review_append_local_rounds(out, id);
|
||||
}
|
||||
if(sqlite3_column_int64(stmt, 4) != 0)
|
||||
review_append(out, " deleted");
|
||||
review_append(out, "\n");
|
||||
@@ -354,7 +391,8 @@ review_append_remote(ReviewText *out, const char *json)
|
||||
" COALESCE(strftime('%H:%M',json_extract(s.value,'$.started_at'),'localtime'),'--:--'),"
|
||||
" CAST(COALESCE(json_extract(s.value,'$.activity'),0) AS INTEGER),"
|
||||
" CAST(COALESCE(json_extract(s.value,'$.deleted_at'),0) AS INTEGER),"
|
||||
" COALESCE((SELECT group_concat(CAST(COALESCE(json_extract(r.value,'$.hold_seconds'),0) AS INTEGER) || 's', ',') FROM json_each(s.value,'$.rounds') AS r),'none') "
|
||||
" COALESCE((SELECT group_concat(CAST(COALESCE(json_extract(r.value,'$.hold_seconds'),0) AS INTEGER) || 's', ',') FROM json_each(s.value,'$.rounds') AS r),'none'),"
|
||||
" CAST(COALESCE((SELECT SUM(CAST(COALESCE(json_extract(r.value,'$.hold_seconds'),0) AS INTEGER)) FROM json_each(s.value,'$.rounds') AS r),0) AS INTEGER) "
|
||||
"FROM json_each(?1,'$.changes.sessions') AS s "
|
||||
"WHERE CAST(COALESCE(json_extract(s.value,'$.deleted_at'),0) AS INTEGER)=0 "
|
||||
"ORDER BY 3,1 DESC,2 DESC",
|
||||
@@ -365,6 +403,9 @@ review_append_remote(ReviewText *out, const char *json)
|
||||
const char *time_text = (const char *)sqlite3_column_text(stmt, 1);
|
||||
int activity = sqlite3_column_int(stmt, 2);
|
||||
const char *rounds = (const char *)sqlite3_column_text(stmt, 4);
|
||||
int duration = sqlite3_column_int(stmt, 5);
|
||||
if(review_activity_name(activity) == NULL)
|
||||
continue;
|
||||
if(activity != last_activity) {
|
||||
if(rows > 0)
|
||||
review_append(out, "\n");
|
||||
@@ -374,7 +415,12 @@ review_append_remote(ReviewText *out, const char *json)
|
||||
review_appendf(out, "%04d-%02d-%02d %s\n",
|
||||
local_date / 10000, (local_date / 100) % 100,
|
||||
local_date % 100, time_text != NULL ? time_text : "--:--");
|
||||
review_appendf(out, "rounds %s", rounds != NULL ? rounds : "none");
|
||||
if(activity == 2)
|
||||
review_append(out, "session 1");
|
||||
else if(review_activity_uses_duration(activity))
|
||||
review_appendf(out, "duration %ds", duration);
|
||||
else
|
||||
review_appendf(out, "rounds %s", rounds != NULL ? rounds : "none");
|
||||
if(sqlite3_column_int64(stmt, 3) != 0)
|
||||
review_append(out, " deleted");
|
||||
review_append(out, "\n");
|
||||
@@ -389,7 +435,9 @@ review_append_remote(ReviewText *out, const char *json)
|
||||
review_append(out, "\nHabit days\n");
|
||||
if(g_storage.db != NULL && json != NULL &&
|
||||
sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT COALESCE((SELECT COALESCE(json_extract(h.value,'$.name'),'') FROM json_each(?1,'$.changes.habits') AS h WHERE COALESCE(json_extract(h.value,'$.id'),'')=COALESCE(json_extract(d.value,'$.habit_id'),'')),COALESCE(json_extract(d.value,'$.habit_id'),'')),"
|
||||
"SELECT COALESCE((SELECT COALESCE(json_extract(h.value,'$.name'),'') FROM json_each(?1,'$.changes.habits') AS h WHERE COALESCE(json_extract(h.value,'$.id'),'')=COALESCE(json_extract(d.value,'$.habit_id'),'')),"
|
||||
" (SELECT name FROM habits WHERE id=COALESCE(json_extract(d.value,'$.habit_id'),'') LIMIT 1),"
|
||||
" ''),"
|
||||
" CAST(COALESCE(json_extract(d.value,'$.local_date'),0) AS INTEGER),"
|
||||
" CAST(COALESCE(json_extract(d.value,'$.count'),0) AS INTEGER) "
|
||||
"FROM json_each(?1,'$.changes.habit_days') AS d "
|
||||
@@ -401,7 +449,9 @@ review_append_remote(ReviewText *out, const char *json)
|
||||
while(sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
int local_date = sqlite3_column_int(stmt, 1);
|
||||
const char *name = (const char *)sqlite3_column_text(stmt, 0);
|
||||
const char *safe_name = name != NULL && name[0] != '\0' ? name : "(unknown)";
|
||||
const char *safe_name = name != NULL ? name : "";
|
||||
if(safe_name[0] == '\0')
|
||||
continue;
|
||||
if(strcmp(last_name, safe_name) != 0) {
|
||||
if(rows > 0)
|
||||
review_append(out, "\n");
|
||||
@@ -549,11 +599,68 @@ storage_sync_review_json_has_visible_diff(const char *json)
|
||||
free(diff);
|
||||
return 1;
|
||||
}
|
||||
has_diff = diff != NULL && diff[0] != '\0';
|
||||
has_diff = diff != NULL && diff[0] != '\0' &&
|
||||
(review_has_pending_outbox() || review_has_unknown_activity(json));
|
||||
free(diff);
|
||||
return has_diff;
|
||||
}
|
||||
|
||||
static int
|
||||
review_has_pending_outbox(void)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int result = 0;
|
||||
|
||||
if(g_storage.db == NULL)
|
||||
return 1;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT EXISTS(SELECT 1 FROM sync_outbox LIMIT 1)",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 1;
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
result = sqlite3_column_int(stmt, 0) != 0;
|
||||
sqlite3_finalize(stmt);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
review_has_unknown_activity(const char *json)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int result = 0;
|
||||
|
||||
if(g_storage.db == NULL)
|
||||
return 1;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT EXISTS(SELECT 1 FROM sessions "
|
||||
"WHERE deleted_at=0 AND activity NOT IN (0,1,2))",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 1;
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
result = sqlite3_column_int(stmt, 0) != 0;
|
||||
sqlite3_finalize(stmt);
|
||||
if(result)
|
||||
return 1;
|
||||
|
||||
if(json == NULL)
|
||||
return 0;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT EXISTS("
|
||||
" SELECT 1 FROM json_each(?1,'$.changes.sessions') AS s "
|
||||
" WHERE CAST(COALESCE(json_extract(s.value,'$.deleted_at'),0) AS INTEGER)=0 "
|
||||
" AND CAST(COALESCE(json_extract(s.value,'$.activity'),0) AS INTEGER) NOT IN (0,1,2)"
|
||||
")",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 1;
|
||||
bind_text(stmt, 1, json);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
result = sqlite3_column_int(stmt, 0) != 0;
|
||||
sqlite3_finalize(stmt);
|
||||
if(result)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
storage_apply_pending_sync_review(int use_remote)
|
||||
{
|
||||
|
||||
@@ -124,8 +124,7 @@ check_contains(const char *label, const char *text, const char *needle)
|
||||
{
|
||||
if(text != NULL && strstr(text, needle) != NULL)
|
||||
return;
|
||||
fprintf(stderr, "FAIL %s: missing %s in %s\n",
|
||||
label, needle, text != NULL ? text : "(null)");
|
||||
fprintf(stderr, "FAIL %s: missing %s in %s\n", label, needle, text != NULL ? text : "(null)");
|
||||
g_failures++;
|
||||
}
|
||||
|
||||
@@ -171,8 +170,7 @@ remove_tree(const char *path)
|
||||
static void
|
||||
make_clean_root(char *out, size_t out_size, const char *name)
|
||||
{
|
||||
snprintf(out, out_size, "/tmp/inbe-sync-review-test-%ld-%s",
|
||||
(long)getpid(), name);
|
||||
snprintf(out, out_size, "/tmp/inbe-sync-review-test-%ld-%s", (long)getpid(), name);
|
||||
remove_tree(out);
|
||||
check_true("create test root", ensure_dir(out));
|
||||
snprintf(g_data_root, sizeof(g_data_root), "%s", out);
|
||||
@@ -221,17 +219,52 @@ static void
|
||||
seed_local_data(const char *root)
|
||||
{
|
||||
check_true("seed local data",
|
||||
exec_db_sql(root,
|
||||
"INSERT INTO habits(id,user_id,name,color_r,color_g,color_b,"
|
||||
"sync_mode,sync_activity,counter_enabled,sort_order,deleted_at,updated_at)"
|
||||
"VALUES('local-habit',(SELECT id FROM users LIMIT 1),'Local Breath',10,20,30,0,0,1,1,0,1782300000);"
|
||||
"INSERT INTO habit_days(habit_id,local_date,completed,count,session_count,updated_at)"
|
||||
"VALUES('local-habit',20260624,1,4,0,1782300000);"
|
||||
"INSERT INTO sessions(id,user_id,started_at,local_date,topic,activity,source,"
|
||||
"imported_at,rounds_hash,deleted_at,updated_at)"
|
||||
"VALUES('local-session',(SELECT id FROM users LIMIT 1),1782300000,20260624,1,1,'test',1782300000,101,0,1782300000);"
|
||||
"INSERT INTO session_rounds(session_id,round_index,seconds)"
|
||||
"VALUES('local-session',0,40);"));
|
||||
exec_db_sql(root, "INSERT INTO habits(id,user_id,name,color_r,color_g,color_b,"
|
||||
"sync_mode,sync_activity,counter_enabled,sort_order,deleted_at,"
|
||||
"updated_at)"
|
||||
"VALUES('local-habit',(SELECT id FROM users LIMIT 1),'Local "
|
||||
"Breath',10,20,30,0,0,1,1,0,1782300000);"
|
||||
"INSERT INTO "
|
||||
"habit_days(habit_id,local_date,completed,count,session_count,"
|
||||
"updated_at)"
|
||||
"VALUES('local-habit',20260624,1,4,0,1782300000);"
|
||||
"INSERT INTO "
|
||||
"sessions(id,user_id,started_at,local_date,topic,activity,source,"
|
||||
"imported_at,rounds_hash,deleted_at,updated_at)"
|
||||
"VALUES('local-session',(SELECT id FROM users LIMIT "
|
||||
"1),1782300000,20260624,1,1,'test',1782300000,101,0,1782300000);"
|
||||
"INSERT INTO session_rounds(session_id,round_index,seconds)"
|
||||
"VALUES('local-session',0,40);"));
|
||||
}
|
||||
|
||||
static void
|
||||
mark_local_data_pending(const char *root)
|
||||
{
|
||||
check_true("mark local data pending",
|
||||
exec_db_sql(root, "INSERT OR REPLACE INTO "
|
||||
"sync_outbox(entity_type,entity_id,local_date,queued_at)"
|
||||
"VALUES('habit','local-habit',0,1782300000);"
|
||||
"INSERT OR REPLACE INTO "
|
||||
"sync_outbox(entity_type,entity_id,local_date,queued_at)"
|
||||
"VALUES('habit_day','local-habit',20260624,1782300000);"
|
||||
"INSERT OR REPLACE INTO "
|
||||
"sync_outbox(entity_type,entity_id,local_date,queued_at)"
|
||||
"VALUES('session','local-session',0,1782300000);"));
|
||||
}
|
||||
|
||||
static void
|
||||
seed_local_yoga_data(const char *root)
|
||||
{
|
||||
check_true("seed local yoga data",
|
||||
exec_db_sql(root, "INSERT INTO habits(id,user_id,name,color_r,color_g,color_b,"
|
||||
"sync_mode,sync_activity,counter_enabled,sort_order,deleted_"
|
||||
"at,updated_at)"
|
||||
"VALUES('yoga',(SELECT id FROM users LIMIT "
|
||||
"1),'Yoga',239,178,102,1,4,0,1,0,1782300000);"
|
||||
"INSERT INTO "
|
||||
"habit_days(habit_id,local_date,completed,count,session_"
|
||||
"count,updated_at)"
|
||||
"VALUES('yoga',20260624,1,2,0,1782300000);"));
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -247,11 +280,16 @@ remote_snapshot_response(void)
|
||||
"\"color_r\":90,\"color_g\":80,\"color_b\":70,\"sync_mode\":0,"
|
||||
"\"sync_activity\":0,\"counter_enabled\":1,\"sort_order\":1,"
|
||||
"\"deleted_at\":0,\"updated_at\":\"2026-06-24T10:00:00Z\"}],"
|
||||
"\"habit_days\":[{\"habit_id\":\"remote-habit\",\"local_date\":20260624,"
|
||||
"\"completed\":true,\"count\":7,\"updated_at\":\"2026-06-24T10:00:00Z\"}],"
|
||||
"\"sessions\":[{\"id\":\"remote-session\",\"started_at\":\"2026-06-24T10:00:00Z\","
|
||||
"\"local_date\":20260624,\"topic\":2,\"activity\":3,\"source\":\"lyra-test\","
|
||||
"\"rounds_hash\":202,\"deleted_at\":0,\"updated_at\":\"2026-06-24T10:00:00Z\","
|
||||
"\"habit_days\":[{\"habit_id\":\"remote-habit\",\"local_date\":"
|
||||
"20260624,"
|
||||
"\"completed\":true,\"count\":7,\"updated_at\":\"2026-06-24T10:00:"
|
||||
"00Z\"}],"
|
||||
"\"sessions\":[{\"id\":\"remote-session\",\"started_at\":\"2026-06-"
|
||||
"24T10:00:00Z\","
|
||||
"\"local_date\":20260624,\"topic\":2,\"activity\":2,\"source\":\"lyra-"
|
||||
"test\","
|
||||
"\"rounds_hash\":202,\"deleted_at\":0,\"updated_at\":\"2026-06-24T10:"
|
||||
"00:00Z\","
|
||||
"\"rounds\":[{\"round_index\":0,\"hold_seconds\":55}]}],"
|
||||
"\"meditation_logs\":[]"
|
||||
"}"
|
||||
@@ -269,15 +307,46 @@ deleted_only_remote_snapshot_response(void)
|
||||
"\"changes\":{"
|
||||
"\"habits\":[],"
|
||||
"\"habit_days\":[],"
|
||||
"\"sessions\":[{\"id\":\"deleted-session\",\"started_at\":\"2026-06-24T10:00:00Z\","
|
||||
"\"local_date\":20260624,\"topic\":2,\"activity\":3,\"source\":\"lyra-test\","
|
||||
"\"rounds_hash\":202,\"deleted_at\":1782300000,\"updated_at\":\"2026-06-24T10:00:00Z\","
|
||||
"\"sessions\":[{\"id\":\"deleted-session\",\"started_at\":\"2026-06-"
|
||||
"24T10:00:00Z\","
|
||||
"\"local_date\":20260624,\"topic\":2,\"activity\":3,\"source\":\"lyra-"
|
||||
"test\","
|
||||
"\"rounds_hash\":202,\"deleted_at\":1782300000,\"updated_at\":\"2026-"
|
||||
"06-24T10:00:00Z\","
|
||||
"\"rounds\":[{\"round_index\":0,\"hold_seconds\":55}]}],"
|
||||
"\"meditation_logs\":[]"
|
||||
"}"
|
||||
"}";
|
||||
}
|
||||
|
||||
static const char *
|
||||
remote_additive_yoga_response(void)
|
||||
{
|
||||
return "{"
|
||||
"\"server_version\":14,"
|
||||
"\"server_state_hash\":\"remote-hash-yoga\","
|
||||
"\"full_snapshot_required\":true,"
|
||||
"\"changes_complete\":false,"
|
||||
"\"changes\":{"
|
||||
"\"habits\":[{\"id\":\"yoga\",\"name\":\"Yoga\","
|
||||
"\"color_r\":239,\"color_g\":178,\"color_b\":102,\"sync_mode\":1,"
|
||||
"\"sync_activity\":4,\"counter_enabled\":0,\"sort_order\":1,"
|
||||
"\"deleted_at\":0,\"updated_at\":\"2026-06-24T10:00:00Z\"}],"
|
||||
"\"habit_days\":[{\"habit_id\":\"yoga\",\"local_date\":20260624,"
|
||||
"\"completed\":true,\"count\":1,\"updated_at\":\"2026-06-24T10:00:"
|
||||
"00Z\"}],"
|
||||
"\"sessions\":[{\"id\":\"sun-session\",\"started_at\":\"2026-06-24T10:"
|
||||
"00:00Z\","
|
||||
"\"local_date\":20260624,\"topic\":0,\"activity\":2,\"source\":"
|
||||
"\"test\","
|
||||
"\"rounds_hash\":303,\"deleted_at\":0,\"updated_at\":\"2026-06-24T10:"
|
||||
"00:00Z\","
|
||||
"\"rounds\":[{\"round_index\":0,\"hold_seconds\":1}]}],"
|
||||
"\"meditation_logs\":[]"
|
||||
"}"
|
||||
"}";
|
||||
}
|
||||
|
||||
static void
|
||||
test_full_snapshot_waits_for_review(void)
|
||||
{
|
||||
@@ -289,6 +358,7 @@ test_full_snapshot_waits_for_review(void)
|
||||
make_clean_root(root, sizeof(root), "pending");
|
||||
check_true("init pending db", storage_init(root));
|
||||
seed_local_data(root);
|
||||
mark_local_data_pending(root);
|
||||
|
||||
check_true("apply review response",
|
||||
storage_apply_sync_response_json(remote_snapshot_response()));
|
||||
@@ -302,19 +372,21 @@ test_full_snapshot_waits_for_review(void)
|
||||
check_int("remote habit not applied yet",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habits WHERE id='remote-habit'"), 0);
|
||||
|
||||
check_true("review detail builds",
|
||||
storage_sync_review_details(&local_detail, &remote_detail));
|
||||
check_true("review detail builds", storage_sync_review_details(&local_detail, &remote_detail));
|
||||
check_contains("local detail session line", local_detail,
|
||||
"Meditation\n2026-06-24 11:20\nrounds 40s");
|
||||
"Meditation\n2026-06-24 11:20\nduration 40s");
|
||||
check_contains("local detail habit day line", local_detail,
|
||||
"Habit days\nLocal Breath\n2026-06-24 count 4");
|
||||
check_contains("remote detail session line", remote_detail,
|
||||
"Unknown 3\n2026-06-24 10:00\nrounds 55s");
|
||||
"Sun Salutation\n2026-06-24 10:00\nsession 1");
|
||||
check_not_contains("remote detail hides unknown activity", remote_detail, "Unknown");
|
||||
check_not_contains("remote detail hides numeric activity suffix", remote_detail,
|
||||
"Sun Salutation 2");
|
||||
check_contains("remote detail habit day line", remote_detail,
|
||||
"Habit days\nRemote Breath\n2026-06-24 count 7");
|
||||
check_true("review diff builds", storage_sync_review_diff(&diff_detail));
|
||||
check_contains("diff local session", diff_detail, "- Meditation");
|
||||
check_contains("diff remote session", diff_detail, "+ Unknown 3");
|
||||
check_contains("diff remote session", diff_detail, "+ Sun Salutation");
|
||||
check_contains("diff local habit day", diff_detail, "- Local Breath");
|
||||
check_contains("diff remote habit day", diff_detail, "+ Remote Breath");
|
||||
free(local_detail);
|
||||
@@ -335,12 +407,10 @@ test_review_ignores_deleted_remote_rows(void)
|
||||
check_true("init deleted review db", storage_init(root));
|
||||
check_true("apply deleted review response",
|
||||
storage_apply_sync_response_json(deleted_only_remote_snapshot_response()));
|
||||
check_false("deleted-only review not pending",
|
||||
storage_sync_review_pending());
|
||||
check_false("deleted-only review not pending", storage_sync_review_pending());
|
||||
check_true("deleted review json has no visible diff",
|
||||
!storage_sync_review_json_has_visible_diff(deleted_only_remote_snapshot_response()));
|
||||
check_true("deleted review diff builds",
|
||||
storage_sync_review_diff(&diff_detail));
|
||||
check_true("deleted review diff builds", storage_sync_review_diff(&diff_detail));
|
||||
check_not_contains("deleted remote hidden from diff", diff_detail, "deleted-session");
|
||||
check_not_contains("deleted remote marker hidden from diff", diff_detail, "deleted");
|
||||
|
||||
@@ -349,6 +419,107 @@ test_review_ignores_deleted_remote_rows(void)
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_remote_additions_apply_without_review(void)
|
||||
{
|
||||
char root[1024];
|
||||
|
||||
make_clean_root(root, sizeof(root), "remote-additive");
|
||||
check_true("init remote additive db", storage_init(root));
|
||||
check_true("apply remote additive response",
|
||||
storage_apply_sync_response_json(remote_additive_yoga_response()));
|
||||
check_false("remote additive review not pending", storage_sync_review_pending());
|
||||
check_int("remote additive sun session applied",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM sessions WHERE id='sun-session'"), 1);
|
||||
check_int(
|
||||
"remote additive yoga habit applied",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habits WHERE id='yoga' AND counter_enabled=0"),
|
||||
1);
|
||||
check_int(
|
||||
"remote additive yoga day applied",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habit_days WHERE habit_id='yoga' AND count=1"),
|
||||
1);
|
||||
|
||||
storage_close();
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_remote_snapshot_removes_absent_local_yoga_without_pending_edits(void)
|
||||
{
|
||||
char root[1024];
|
||||
|
||||
make_clean_root(root, sizeof(root), "remote-removes-yoga");
|
||||
check_true("init remote removes yoga db", storage_init(root));
|
||||
seed_local_yoga_data(root);
|
||||
check_true("apply remote deleted yoga response",
|
||||
storage_apply_sync_response_json(deleted_only_remote_snapshot_response()));
|
||||
check_false("remote deleted yoga review not pending", storage_sync_review_pending());
|
||||
check_int("remote deleted yoga habit removed",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habits WHERE id='yoga'"), 0);
|
||||
check_int("remote deleted yoga day removed",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habit_days WHERE habit_id='yoga'"), 0);
|
||||
|
||||
storage_close();
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_remote_snapshot_keeps_review_for_pending_yoga_delete(void)
|
||||
{
|
||||
char root[1024];
|
||||
|
||||
make_clean_root(root, sizeof(root), "remote-removes-yoga-pending");
|
||||
check_true("init pending yoga delete db", storage_init(root));
|
||||
seed_local_yoga_data(root);
|
||||
check_true("mark local yoga pending",
|
||||
exec_db_sql(root, "INSERT OR REPLACE INTO "
|
||||
"sync_outbox(entity_type,entity_id,local_date,queued_at)"
|
||||
"VALUES('habit','yoga',0,1782300000);"));
|
||||
check_true("apply pending remote deleted yoga response",
|
||||
storage_apply_sync_response_json(deleted_only_remote_snapshot_response()));
|
||||
check_true("pending yoga delete requires review", storage_sync_review_pending());
|
||||
check_int("pending yoga still local until review",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM habits WHERE id='yoga'"), 1);
|
||||
|
||||
storage_close();
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_sync_payload_includes_v2_ops(void)
|
||||
{
|
||||
char root[1024];
|
||||
char *payload;
|
||||
|
||||
make_clean_root(root, sizeof(root), "v2-payload");
|
||||
check_true("init v2 payload db", storage_init(root));
|
||||
seed_local_data(root);
|
||||
mark_local_data_pending(root);
|
||||
check_int("sync ops migration table exists",
|
||||
read_db_count(root, "SELECT COUNT(*) FROM sqlite_master WHERE "
|
||||
"type='table' AND name='sync_ops'"),
|
||||
1);
|
||||
|
||||
payload = storage_build_sync_payload_json("test-public-id", "test-public-key");
|
||||
check_contains("v2 payload protocol", payload, "\"protocol_version\":2");
|
||||
check_contains("v2 payload client clock", payload, "\"client_clock\":0");
|
||||
check_contains("v2 payload ops array", payload, "\"ops\":[");
|
||||
check_contains("v2 payload habit op", payload, "\"entity_type\":\"habit\"");
|
||||
check_contains("v2 payload habit day op", payload, "\"entity_type\":\"habit_day\"");
|
||||
check_contains("v2 payload session op", payload, "\"entity_type\":\"session\"");
|
||||
check_contains("v2 payload deterministic op id", payload, "\"op_id\":");
|
||||
check_contains("v2 payload op client id", payload, "\"client_id\":");
|
||||
check_contains("v2 payload op sequence", payload, "\"seq\":");
|
||||
check_contains("v2 payload session payload", payload, "\"payload\":{\"id\":\"local-session\"");
|
||||
check_contains("v2 payload keeps legacy habits", payload, "\"habits\":[");
|
||||
check_contains("v2 payload keeps legacy sessions", payload, "\"sessions\":[");
|
||||
storage_free_sync_payload_json(payload);
|
||||
|
||||
storage_close();
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_keep_local_requests_full_replace(void)
|
||||
{
|
||||
@@ -358,6 +529,7 @@ test_keep_local_requests_full_replace(void)
|
||||
make_clean_root(root, sizeof(root), "keep-local");
|
||||
check_true("init keep local db", storage_init(root));
|
||||
seed_local_data(root);
|
||||
mark_local_data_pending(root);
|
||||
check_true("apply keep local review response",
|
||||
storage_apply_sync_response_json(remote_snapshot_response()));
|
||||
|
||||
@@ -388,6 +560,7 @@ test_use_remote_replaces_local_data(void)
|
||||
make_clean_root(root, sizeof(root), "use-remote");
|
||||
check_true("init use remote db", storage_init(root));
|
||||
seed_local_data(root);
|
||||
mark_local_data_pending(root);
|
||||
check_true("apply use remote review response",
|
||||
storage_apply_sync_response_json(remote_snapshot_response()));
|
||||
|
||||
@@ -417,24 +590,26 @@ test_normal_response_records_server_hash(void)
|
||||
{
|
||||
char root[1024];
|
||||
char *payload;
|
||||
const char *response =
|
||||
"{"
|
||||
"\"server_version\":5,"
|
||||
"\"server_state_hash\":\"normal-hash-001\","
|
||||
"\"account_alias\":\"waozi\","
|
||||
"\"changes\":{\"habits\":[],\"habit_days\":[],\"sessions\":[],\"meditation_logs\":[]}"
|
||||
"}";
|
||||
const char *response = "{"
|
||||
"\"server_version\":5,"
|
||||
"\"server_clock\":77,"
|
||||
"\"server_state_hash\":\"normal-hash-001\","
|
||||
"\"account_alias\":\"waozi\","
|
||||
"\"changes\":{\"habits\":[],\"habit_days\":[],"
|
||||
"\"sessions\":[],\"meditation_logs\":[]}"
|
||||
"}";
|
||||
|
||||
make_clean_root(root, sizeof(root), "normal");
|
||||
check_true("init normal db", storage_init(root));
|
||||
check_true("apply normal response", storage_apply_sync_response_json(response));
|
||||
check_false("normal response no review", storage_sync_review_pending());
|
||||
check_contains("normal response saves alias",
|
||||
storage_get_setting_text("sync_account_alias"), "waozi");
|
||||
check_contains("normal response saves alias", storage_get_setting_text("sync_account_alias"),
|
||||
"waozi");
|
||||
|
||||
payload = storage_build_sync_payload_json("test-public-id", "test-public-key");
|
||||
check_contains("normal response hash in next payload", payload,
|
||||
"\"last_server_state_hash\":\"normal-hash-001\"");
|
||||
check_contains("normal response clock in next payload", payload, "\"client_clock\":77");
|
||||
check_not_contains("normal response no full replace", payload, "full_sync_requested");
|
||||
storage_free_sync_payload_json(payload);
|
||||
|
||||
@@ -450,6 +625,10 @@ main(void)
|
||||
|
||||
test_full_snapshot_waits_for_review();
|
||||
test_review_ignores_deleted_remote_rows();
|
||||
test_remote_additions_apply_without_review();
|
||||
test_remote_snapshot_removes_absent_local_yoga_without_pending_edits();
|
||||
test_remote_snapshot_keeps_review_for_pending_yoga_delete();
|
||||
test_sync_payload_includes_v2_ops();
|
||||
test_keep_local_requests_full_replace();
|
||||
test_use_remote_replaces_local_data();
|
||||
test_normal_response_records_server_hash();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
IDI_APP_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,5,8,0
|
||||
PRODUCTVERSION 1,5,8,0
|
||||
FILEVERSION 1,6,2,0
|
||||
PRODUCTVERSION 1,6,2,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -21,11 +21,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "1.5.8"
|
||||
VALUE "FileVersion", "1.6.2"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "1.5.8"
|
||||
VALUE "ProductVersion", "1.6.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||