Compare commits

...
42 Commits
Author SHA1 Message Date
waozi a9248d0645 improve sun salutation 2026-06-27 13:18:16 -03:00
waozi 0d6f853775 Remove Inbe all builds page 2026-06-27 11:48:14 -03:00
waozi 841018451d Move Inbe site into project 2026-06-27 11:09:05 -03:00
waozi 15d3176a0b improve notifications and settings 2026-06-27 10:13:49 -03:00
waozi 67e55bc931 Update Flint vendor after Netlify restore 2026-06-27 00:18:26 -03:00
waozi 8d3265732e Update Flint vendor for Netlify deploy 2026-06-27 00:12:25 -03:00
waozi 15eab9f75c Use raylib from Flint vendor 2026-06-27 00:09:25 -03:00
waozi ca6d0c1a51 update version 2026-06-26 18:57:00 -03:00
waozi edac1da85c improve sync and add wip sun salutation 2026-06-26 18:56:46 -03:00
waozi 48ee4615d1 background service working on modern android 2026-06-26 11:34:38 -03:00
waozi 631a3d4666 update github action for itch 2026-06-25 20:30:01 -03:00
waozi 0a325d2dc7 fix background play for practice meditation 2026-06-25 20:14:25 -03:00
waozi 32e76391ef fix test music 2026-06-25 00:38:24 -03:00
waozi 57af29796e update itch upload 2026-06-25 00:29:52 -03:00
waozi d87a9fd7e7 fix modal issues and ci 2026-06-25 00:14:35 -03:00
waozi 6396281b9c Update Flint modal input handling 2026-06-24 23:58:37 -03:00
waozi cac8afab9e Make disabled transitions instant 2026-06-24 23:40:12 -03:00
waozi 39c11965ca Skip empty sync review modal 2026-06-24 23:38:25 -03:00
waozi 2f45dc30a1 Show sync review as diff 2026-06-24 23:33:06 -03:00
waozi 0b85606f98 Simplify sync review habit details 2026-06-24 23:23:45 -03:00
waozi 2b3183eb38 Fix sync review build warnings 2026-06-24 23:17:30 -03:00
waozi 810436f3bb Group sync review sessions by practice 2026-06-24 23:15:41 -03:00
waozi c51911383f Improve sync review details 2026-06-24 23:12:22 -03:00
waozi a0ea5d987c Fix hidden startup modal input block 2026-06-24 21:35:09 -03:00
waozi b7b470ca1c Remove guide pre-blocking from app UI 2026-06-24 21:32:04 -03:00
waozi 63acc477e5 Prevent stale modal capture blocking input 2026-06-24 21:29:50 -03:00
waozi aebc742384 Update Flint guide include fix 2026-06-24 21:27:30 -03:00
waozi 37856cef75 Prevent inactive guide input blocking 2026-06-24 21:26:19 -03:00
waozi 240ae3345f Harden AppImage release smoke test 2026-06-24 21:20:16 -03:00
waozi 8b314ef21f improvements with modal and syn settings 2026-06-24 21:16:25 -03:00
waozi 604f1adc0b Use Flint readonly box for public ID 2026-06-24 21:08:58 -03:00
waozi 05d55bf845 Update Flint submodule to master 2026-06-24 21:02:11 -03:00
waozi 393f62e5f0 Improve WHM breath controls 2026-06-24 21:00:44 -03:00
waozi a12cdac763 Clarify alias change flow 2026-06-24 20:55:21 -03:00
waozi 5da72c3710 Fix alias registration flow 2026-06-24 20:21:26 -03:00
waozi 73b6e5a2dc Test chopped locale font coverage 2026-06-24 20:09:16 -03:00
waozi 9930131571 Add account aliases and Flint font tooling 2026-06-24 20:05:04 -03:00
waozi 8f8114b8d7 Add sync state review flow 2026-06-24 19:24:46 -03:00
waozi cfd92e587a update sun salutation 2026-06-24 19:09:56 -03:00
waozi e6aa9b1d84 Use Flint modal capture throughout Inbe 2026-06-24 19:09:06 -03:00
waozi e625044648 Update vendor/flint submodule to modal capture release 2026-06-24 18:59:51 -03:00
waozi f28daf7668 fix modal bug 2026-06-23 17:58:29 -03:00
119 changed files with 9140 additions and 1081 deletions

No files matched your search

+122
View File
@@ -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 }}
+107 -4
View File
@@ -169,7 +169,7 @@ jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
@@ -229,6 +229,37 @@ jobs:
find build/dist/linux -maxdepth 1 -type f -name '*.AppImage' -exec cp {} build/release/linux/ \;
test -n "$(find build/release/linux -type f -print -quit)"
- name: Smoke Test Linux AppImage
env:
APPIMAGE_EXTRACT_AND_RUN: "1"
DISPLAY: ":99"
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y xvfb x11-utils
appimage="$(find build/release/linux -maxdepth 1 -type f -name '*.AppImage' | head -n 1)"
chmod +x "$appimage"
Xvfb "$DISPLAY" -screen 0 800x600x24 >/tmp/inbe-xvfb.log 2>&1 &
xvfb_pid=$!
trap 'kill "$app_pid" "$xvfb_pid" >/dev/null 2>&1 || true' EXIT
sleep 2
"$appimage" >/tmp/inbe-appimage.log 2>&1 &
app_pid=$!
for _ in $(seq 1 30); do
if xwininfo -tree -root | grep -q 'Inner Breeze'; then
exit 0
fi
if ! kill -0 "$app_pid" >/dev/null 2>&1; then
echo "AppImage exited before opening a window"
cat /tmp/inbe-appimage.log || true
exit 1
fi
sleep 1
done
echo "AppImage did not open an X11 window within 30 seconds"
cat /tmp/inbe-appimage.log || true
exit 1
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
@@ -264,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 }}-
@@ -340,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 }}-
@@ -403,6 +434,10 @@ jobs:
- build-linux
- build-windows
- build-android
outputs:
tag_pushed: ${{ steps.tag_version.outputs.tag_pushed }}
tag_name: ${{ steps.tag_version.outputs.tag_name }}
version: ${{ steps.tag_version.outputs.version }}
steps:
- name: Checkout Repository
@@ -432,6 +467,8 @@ jobs:
exit 1
fi
TAG="v$VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag_name=$TAG" >> "$GITHUB_OUTPUT"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG exists, skipping release"
echo "tag_pushed=false" >> "$GITHUB_OUTPUT"
@@ -441,7 +478,6 @@ jobs:
git tag -a "$TAG" -m "Release $VERSION"
git push origin "$TAG"
echo "tag_pushed=true" >> "$GITHUB_OUTPUT"
echo "tag_name=$TAG" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release
@@ -454,3 +490,70 @@ jobs:
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-itch:
name: Publish itch.io
runs-on: ubuntu-latest
needs:
- build-web
- release
if: needs.release.outputs.tag_pushed == 'true'
env:
BUTLER_API_KEY: ${{ secrets.ITCH_API_KEY }}
steps:
- name: Check itch.io Secret
run: |
set -euo pipefail
if [ -z "${BUTLER_API_KEY:-}" ]; then
echo "ITCH_API_KEY secret is required to publish itch.io"
exit 1
fi
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
pattern: release-*
path: build/release
merge-multiple: true
- name: Install Butler
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y unzip
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: |
set -euo pipefail
VERSION="${{ needs.release.outputs.version }}"
web_zip="build/release/inbe-web.zip"
android_apk="build/release/inbe-$VERSION.apk"
windows_zip="build/release/inbe-windows.zip"
linux_appimage="build/release/inbe-linux-x86_64.AppImage"
test -f "$web_zip"
test -f "$android_apk"
test -f "$windows_zip"
test -f "$linux_appimage"
mkdir -p build/itch/inbe-web
unzip -q "$web_zip" -d build/itch/inbe-web
butler push build/itch/inbe-web waozi/inbe:html5 --userversion "$VERSION"
butler push "$android_apk" waozi/inbe:android --userversion "$VERSION"
butler push "$windows_zip" waozi/inbe:windows --userversion "$VERSION"
butler push "$linux_appimage" waozi/inbe:linux --userversion "$VERSION"
-6
View File
@@ -1,12 +1,6 @@
[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
[submodule "vendor/otfchop"]
path = vendor/otfchop
url = https://github.com/waozixyz/otfchop
[submodule "vendor/sqlite"]
path = vendor/sqlite
url = https://github.com/sqlite/sqlite
+47
View File
@@ -1,4 +1,51 @@
# 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
## [1.5.7] - 2026-06-25
- Fix test music
## [1.5.6] - 2026-06-24
### Fixed
- Modal button issue
## [1.5.5] - 2026-06-24
### Fixed
- modal capture bug
- fix sync diff
## [1.5.4] - 2026-06-24
### Changed
- Use Flint-managed modal handling so modal dialogs block background input consistently.
- Add optional sync account aliases, with compact public ID display and full ID reveal modal.
- Make sync state tracking more robust with snapshot hash checks and review flow for unresolved differences.
- Use Flint's built-in font chopping pipeline and verify multilingual locale glyph coverage.
## [1.5.3] - 2026-06-23
### Fixed
- modal issues
## [1.5.2] - 2026-06-23
### Changed
- let you disable screen transitions
+66 -23
View File
@@ -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
@@ -137,7 +137,10 @@ STORAGE_IMPORT_TEST := $(TEST_BIN_DIR)/storage_import_test
LOCALE_KEYS_TEST := $(TEST_BIN_DIR)/locale_keys_test
SYNC_URL_TEST := $(TEST_BIN_DIR)/sync_url_test
SYNC_ACCOUNT_TEST := $(TEST_BIN_DIR)/sync_account_test
SYNC_REVIEW_TEST := $(TEST_BIN_DIR)/sync_review_test
FONT_LOCALE_TEST := $(TEST_BIN_DIR)/font_locale_test
GUIDE_OVERLAY_TEST := $(TEST_BIN_DIR)/guide_overlay_test
TESTS := $(STORAGE_IMPORT_TEST) $(LOCALE_KEYS_TEST) $(SYNC_URL_TEST) $(SYNC_ACCOUNT_TEST) $(SYNC_REVIEW_TEST) $(FONT_LOCALE_TEST) $(GUIDE_OVERLAY_TEST)
FLINT_RUNTIME_ASSET_CFLAGS := $(FLINT_CURL_CFLAGS)
FLINT_RUNTIME_ASSET_LDLIBS := $(FLINT_CURL_LDLIBS)
@@ -156,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 \
@@ -165,6 +170,7 @@ APP_SRCS := \
src/storage/db.c \
src/storage/import.c \
src/storage/storage.c \
src/storage/sync_review.c \
src/storage/sync_account.c \
src/storage/sync_client.c \
src/third_party/miniz.c \
@@ -174,22 +180,23 @@ 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 ?= vendor/otfchop
OTFCHOP_DIR ?= $(FLINT_DIR)/tools/otfchop
FONT_TOOL := $(OTFCHOP_DIR)/otfchop
FONT_SOURCE := $(OTFCHOP_DIR)/unifont-17.0.04.otf
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
@@ -240,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
@@ -301,18 +308,38 @@ screenshot: $(TARGET)
./scripts/generate-screenshots.sh "$(TARGET)"
test: $(STORAGE_IMPORT_TEST) $(LOCALE_KEYS_TEST) $(SYNC_URL_TEST) $(SYNC_ACCOUNT_TEST) $(GUIDE_OVERLAY_TEST)
$(STORAGE_IMPORT_TEST)
$(LOCALE_KEYS_TEST)
$(SYNC_URL_TEST)
$(SYNC_ACCOUNT_TEST)
$(GUIDE_OVERLAY_TEST)
.SILENT: test $(TESTS)
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.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)
test: $(TESTS)
echo "== Inbe tests =="; \
status=0; \
for test_bin in $(TESTS); do \
name=$$(basename "$$test_bin"); \
log=$$(mktemp /tmp/inbe-test.XXXXXX); \
printf "%-28s" "$$name"; \
if "$$test_bin" >"$$log" 2>&1; then \
echo "PASS"; \
rm -f "$$log"; \
else \
echo "FAIL"; \
cat "$$log"; \
rm -f "$$log"; \
status=1; \
break; \
fi; \
done; \
if [ "$$status" -eq 0 ]; then \
echo "== PASS: all Inbe tests =="; \
else \
echo "== FAIL: Inbe tests =="; \
fi; \
exit "$$status"
$(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/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) \
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
$(LOCALE_KEYS_TEST): tests/locale_keys_test.c $(LOCALE_FILES) | $(TEST_BIN_DIR)
@@ -322,20 +349,32 @@ $(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/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)
$(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/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
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 $(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
$(FONT_LOCALE_TEST): tests/font_locale_test.c $(FONT_OUTPUTS) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE \
-o $@ \
tests/font_locale_test.c
$(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
@@ -350,8 +389,8 @@ assets/fonts:
FORCE:
$(FONT_TOOL): vendor/otfchop/otfchop.c vendor/otfchop/stb_truetype.h vendor/otfchop/stb_image_write.h
$(MAKE) -C vendor/otfchop otfchop
$(FONT_TOOL): $(OTFCHOP_DIR)/otfchop.c $(OTFCHOP_DIR)/stb_truetype.h $(OTFCHOP_DIR)/stb_image_write.h
$(MAKE) -C $(OTFCHOP_DIR) otfchop
assets/fonts/locales.png assets/fonts/locales.dat: $(LOCALE_FILES) $(FONT_TOOL) | assets/fonts
$(FONT_TOOL) $(FONT_SOURCE) $(LOCALE_FILES) assets/fonts/locales
@@ -720,7 +759,7 @@ $(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP)
rm -rf $(LINUX_APPDIR)
rm -rf $(LINUX_DIST_DIR)/*.AppDir
rm -f $(LINUX_DIST_DIR)/*.AppImage
mkdir -p $(LINUX_APPDIR)/usr/bin $(LINUX_APPDIR)/usr/lib $(LINUX_APPDIR)/usr/share/applications $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps $(LINUX_APPDIR)/usr/share/metainfo
mkdir -p $(LINUX_APPDIR)/usr/bin $(LINUX_APPDIR)/usr/lib $(LINUX_APPDIR)/usr/share/applications $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps $(LINUX_APPDIR)/usr/share/metainfo $(LINUX_APPDIR)/usr/share/appdata
cp $(TARGET) $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
cp $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPDIR)/AppRun
@@ -743,6 +782,7 @@ $(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP)
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/$(APP_NAME).desktop
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/usr/share/applications/$(APP_NAME).desktop
cp $(LINUX_APPIMAGE_APPDATA) $(LINUX_APPDIR)/usr/share/metainfo/$(ANDROID_APP_ID).metainfo.xml
cp $(LINUX_APPIMAGE_APPDATA) $(LINUX_APPDIR)/usr/share/appdata/$(ANDROID_APP_ID).appdata.xml
cp $(LINUX_APPIMAGE_ICON) $(LINUX_APPDIR)/$(APP_NAME).png
cp $(LINUX_APPIMAGE_ICON) $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps/$(APP_NAME).png
@# Manually copy critical X11/OpenGL libraries that linuxdeploy might miss
@@ -994,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)
+24 -1
View File
@@ -44,6 +44,17 @@ make android-debug
make android-release PASSWORD=your-keystore-password
```
## Release Automation
GitHub Actions builds release artifacts for web, Linux, Windows, Android, and
the Chrome extension. When a new version tag is created by the release workflow,
the web, Android, Windows, and Linux builds are also published to itch.io.
Required repository secrets:
- `ITCH_API_KEY` - itch.io Butler API key for publishing `waozi/inbe:html5`,
`waozi/inbe:android`, `waozi/inbe:windows`, and `waozi/inbe:linux`
### Android Emulator Testing
For automated testing with camera notch (cutout) support:
@@ -78,11 +89,23 @@ The AVD is configured with:
- `src/` - Inbe application code
- `vendor/` - external third-party dependencies
- `vendor/flint/` - first-party UI/runtime support code used directly by Inbe
- `vendor/flint/` - **git submodule** for first-party UI/runtime support code used directly by Inbe
- `wasm4/` - Standalone WASM-4 version
- `assets/` - Images and sounds
- `droid/` - Android build configuration
## Flint submodule workflow
`vendor/flint` is a source submodule (not a one-off copied sync). To update Inbe after a Flint change:
1. Push changes in the Flint repo.
2. In Inbe, update the submodule pointer:
- `git submodule update --init --recursive vendor/flint`
- `git -C vendor/flint pull`
3. Commit Inbe with the updated `vendor/flint` submodule reference.
When updating other projects that vendor Flint as a submodule, this keeps UI behavior and API docs aligned.
## License
MIT - see [LICENSE](LICENSE)
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 35
versionCode 48
versionName "1.5.2"
versionCode 58
versionName "1.6.2"
}
+7
View File
@@ -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>
+18 -2
View File
@@ -2,14 +2,17 @@ cmake_minimum_required(VERSION 3.22)
project(Inbe C)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
if(CCACHE_PROGRAM AND EXISTS "${CCACHE_PROGRAM}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
else()
set(CMAKE_C_COMPILER_LAUNCHER "")
set(CMAKE_C_COMPILER_LAUNCHER "" CACHE STRING "" FORCE)
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")
@@ -28,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}
@@ -107,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"
@@ -116,6 +129,7 @@ add_library(main SHARED
"${SRC_DIR}/storage/db.c"
"${SRC_DIR}/storage/import.c"
"${SRC_DIR}/storage/storage.c"
"${SRC_DIR}/storage/sync_review.c"
"${SRC_DIR}/storage/sync_account.c"
"${SRC_DIR}/storage/sync_client.c"
"${SRC_DIR}/third_party/miniz.c"
@@ -129,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"
@@ -149,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
---
- modal issues
@@ -0,0 +1,6 @@
Changed
---
- Use Flint-managed modal handling so modal dialogs block background input consistently.
- Add optional sync account aliases, with compact public ID display and full ID reveal modal.
- Make sync state tracking more robust with snapshot hash checks and review flow for unresolved differences.
- Use Flint's built-in font chopping pipeline and verify multilingual locale glyph coverage.
@@ -0,0 +1,3 @@
Fixed
---
- modal capture bug
@@ -0,0 +1,3 @@
Fixed
---
- Modal button issue
@@ -0,0 +1 @@
- Fix test music
@@ -0,0 +1,3 @@
Fixed
---
- Background play for meditation practice
@@ -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
+128 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Zastavit test
Síť není dostupná
---
[meditation_music_network_error_message]
Nelze se připojit k serveru s meditační hudbou. Zkontrolujte síťová oprávnění Androidu a připojení k internetu a zkuste to znovu.
Nelze načíst soubor s meditační hudbou. Zkontrolujte připojení k internetu a zkuste to znovu.
---
[duration_5m]
5 min
@@ -247,6 +304,12 @@ Pauza po kole
[advanced_session_controls_label]
Pokročilé ovládání sezení
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Zobrazeni zadrze
---
@@ -260,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í
@@ -675,10 +738,10 @@ Název
Podtržení
---
[habit_practice_list_title]
Seznam cvičení
Session Data From
---
[habit_practice_list_info]
Propojte tento návyk se cvičeními. Dny s odpovídajícími záznamy se zobrazí jako splněné a mohou otevřít editor sezení.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Počítání
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+127 -3
View File
@@ -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
---
@@ -247,6 +304,12 @@ Pause nach Runde
[advanced_session_controls_label]
Erweiterte Sitzungssteuerung
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Atemhalteanzeige
---
@@ -260,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
@@ -675,10 +738,10 @@ Bezeichnung
Unterstreichung
---
[habit_practice_list_title]
Übungsliste
Session Data From
---
[habit_practice_list_info]
Verknüpfe diese Gewohnheit mit Übungssitzungen. Tage mit passenden Sitzungen werden als erledigt angezeigt und können den Sitzungseditor öffnen.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Zählen
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+126 -3
View File
@@ -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
---
@@ -83,7 +140,7 @@ Stop test
Network unavailable
---
[meditation_music_network_error_message]
Could not reach the meditation music server. Check Android network permissions and your internet connection, then try again.
Could not reach the meditation music file. Check your internet connection, then try again.
---
[meditation_music_attribution]
Music by Elijah_K.
@@ -121,6 +178,9 @@ Save completed rounds before exit?
[cancel_button]
Cancel
---
[skip_button]
Skip
---
[ok_button]
OK
---
@@ -304,6 +364,12 @@ Pause after round
[advanced_session_controls_label]
Advanced session controls
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Hold display
---
@@ -317,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
@@ -575,6 +641,45 @@ Copy ID
[sync_public_id_copied]
Public ID copied
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
This is the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Account Alias
---
[sync_alias_message]
Choose a short name for this account. This is optional.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_rule]
4-32 letters, numbers, or underscore.
---
[sync_alias_register_button]
Register
---
[sync_alias_save_button]
Save Alias
---
[sync_alias_saved]
Alias saved
---
[sync_alias_registered]
Alias registered
---
[sync_alias_failed]
Alias unavailable or remote failed
---
[sync_backup_key_button]
Backup Key
---
@@ -678,7 +783,7 @@ Underline
Practice list
---
[habit_practice_list_info]
Link this habit to practice sessions. Days with matching sessions will show as completed and can open the session editor.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Counting
@@ -818,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
---
+128 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Detener prueba
Red no disponible
---
[meditation_music_network_error_message]
No se pudo acceder al servidor de música de meditación. Revisa los permisos de red de Android y tu conexión a internet, e inténtalo de nuevo.
No se pudo acceder al archivo de música de meditación. Revisa tu conexión a internet e inténtalo de nuevo.
---
[duration_5m]
5 min
@@ -247,6 +304,12 @@ Pausa después de ronda
[advanced_session_controls_label]
Controles avanzados de sesión
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Visualizacion de retencion
---
@@ -260,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
@@ -675,10 +738,10 @@ Nombre
Subrayado
---
[habit_practice_list_title]
Lista de prácticas
Session Data From
---
[habit_practice_list_info]
Vincula este hábito con sesiones de práctica. Los días con sesiones coincidentes aparecerán como completados y podrán abrir el editor de sesión.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Conteo
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+127 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Arrêter le test
Réseau indisponible
---
[meditation_music_network_error_message]
Impossible de joindre le serveur de musique de méditation. Vérifiez les autorisations réseau d'Android et votre connexion internet, puis réessayez.
Impossible de joindre le fichier de musique de méditation. Vérifiez votre connexion internet, puis réessayez.
---
[duration_5m]
5 min
@@ -118,6 +175,9 @@ Enregistrer les cycles terminés avant de quitter ?
[cancel_button]
Annuler
---
[skip_button]
Ignorer
---
[ok_button]
OK
---
@@ -247,6 +307,12 @@ Pause après cycle
[advanced_session_controls_label]
Contrôles avancés de séance
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Affichage de la retention
---
@@ -260,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
@@ -575,6 +641,45 @@ Copier l’ID
[sync_public_id_copied]
ID public copié
---
[sync_public_id_full_title]
ID public complet
---
[sync_public_id_full_message]
Voici l’identifiant complet du compte.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Alias du compte
---
[sync_alias_message]
Choisissez un nom court pour ce compte. C’est facultatif.
---
[sync_alias_change_title]
Modifier l’alias
---
[sync_alias_change_message]
Modifiez le nom court de ce compte sur ce serveur de synchronisation.
---
[sync_alias_rule]
4 à 32 lettres, chiffres ou tiret bas.
---
[sync_alias_register_button]
Enregistrer
---
[sync_alias_save_button]
Enregistrer l’alias
---
[sync_alias_saved]
Alias enregistré
---
[sync_alias_registered]
Alias enregistré
---
[sync_alias_failed]
Alias indisponible ou échec distant
---
[sync_backup_key_button]
Sauvegarder la clé
---
@@ -675,10 +780,10 @@ Nom
Soulignement
---
[habit_practice_list_title]
Liste des pratiques
Session Data From
---
[habit_practice_list_info]
Associez cette habitude aux séances de pratique. Les jours avec des séances correspondantes apparaîtront comme terminés et pourront ouvrir l'éditeur de séance.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Comptage
@@ -815,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
+128 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Hentikan tes
Jaringan tidak tersedia
---
[meditation_music_network_error_message]
Tidak dapat menjangkau server musik meditasi. Periksa izin jaringan Android dan koneksi internetmu, lalu coba lagi.
Tidak dapat membuka file musik meditasi. Periksa koneksi internetmu, lalu coba lagi.
---
[duration_5m]
5 mnt
@@ -247,6 +304,12 @@ Jeda setelah ronde
[advanced_session_controls_label]
Kontrol sesi lanjutan
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Tampilan tahan napas
---
@@ -260,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
@@ -675,10 +738,10 @@ Nama
Garis bawah
---
[habit_practice_list_title]
Daftar latihan
Session Data From
---
[habit_practice_list_info]
Hubungkan kebiasaan ini ke sesi latihan. Hari dengan sesi yang cocok akan tampil selesai dan dapat membuka editor sesi.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Penghitungan
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+128 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Ferma test
Rete non disponibile
---
[meditation_music_network_error_message]
Impossibile raggiungere il server musica per la meditazione. Controlla le autorizzazioni di rete di Android e la connessione a internet, poi riprova.
Impossibile raggiungere il file musicale per la meditazione. Controlla la connessione a internet, poi riprova.
---
[duration_5m]
5 min
@@ -301,6 +358,12 @@ Pausa dopo round
[advanced_session_controls_label]
Controlli avanzati sessione
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Visualizzazione trattenuta
---
@@ -314,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
@@ -675,10 +738,10 @@ Nome
Sottolineatura
---
[habit_practice_list_title]
Elenco pratiche
Session Data From
---
[habit_practice_list_info]
Collega questa abitudine alle sessioni di pratica. I giorni con sessioni corrispondenti verranno mostrati come completati e potranno aprire l'editor della sessione.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Conteggio
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+127 -3
View File
@@ -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]
瞑想
---
@@ -247,6 +304,12 @@ OK
[advanced_session_controls_label]
詳細なセッション設定
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
ホールド表示
---
@@ -260,7 +323,7 @@ OK
音量
---
[show_session_volume_control_label]
セッション中に音量コントロールを表示
音量コントロールを表示
---
[reset_to_defaults_label]
デフォルトに戻す
@@ -675,10 +738,10 @@ https:// または localhost:8080 のようなループバックを使用して
下線
---
[habit_practice_list_title]
練習リスト
Session Data From
---
[habit_practice_list_info]
この習慣を練習セッションに関連付けます。一致するセッションがある日は完了として表示され、セッション編集画面を開けます。
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
カウント
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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]
次のラウンド
---
---
+127 -3
View File
@@ -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]
명상
---
@@ -301,6 +358,12 @@ Inner Breeze
[advanced_session_controls_label]
고급 세션 제어
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
홀드 표시
---
@@ -314,7 +377,7 @@ Inner Breeze
음량
---
[show_session_volume_control_label]
세션에서 볼륨 조절 표시
볼륨 조절 표시
---
[reset_to_defaults_label]
기본값으로 재설정
@@ -674,10 +737,10 @@ https:// 또는 localhost:8080 같은 루프백을 사용하세요
밑줄
---
[habit_practice_list_title]
연습 목록
Session Data From
---
[habit_practice_list_info]
이 습관을 연습 세션에 연결합니다. 일치하는 세션이 있는 날은 완료로 표시되며 세션 편집기를 열 수 있습니다.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
횟수
@@ -814,3 +877,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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]
다음 라운드
---
---
+128 -4
View File
@@ -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
---
@@ -83,7 +140,7 @@ Parar teste
Rede indisponível
---
[meditation_music_network_error_message]
Não foi possível acessar o servidor de música de meditação. Verifique as permissões de rede do Android e sua conexão com a internet, depois tente novamente.
Não foi possível acessar o arquivo de música de meditação. Verifique sua conexão com a internet e tente novamente.
---
[duration_5m]
5 min
@@ -247,6 +304,12 @@ Pausa após rodada
[advanced_session_controls_label]
Controles avançados da sessão
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Exibicao da retencao
---
@@ -260,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
@@ -675,10 +738,10 @@ Nome
Sublinhado
---
[habit_practice_list_title]
Lista de práticas
Session Data From
---
[habit_practice_list_info]
Vincule este hábito às sessões de prática. Dias com sessões correspondentes aparecerão como concluídos e poderão abrir o editor de sessão.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Contagem
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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
---
---
+127 -3
View File
@@ -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]
Медитация
---
@@ -304,6 +361,12 @@ OK
[advanced_session_controls_label]
Расширенное управление сессией
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
Отображение задержки
---
@@ -317,7 +380,7 @@ OK
Громкость
---
[show_session_volume_control_label]
Показывать регулятор громкости в сеансах
Показывать регулятор громкости
---
[reset_to_defaults_label]
Сбросить настройки
@@ -675,10 +738,10 @@ liboqs не собран для этой платформы.
Подчеркивание
---
[habit_practice_list_title]
Список практик
Session Data From
---
[habit_practice_list_info]
Свяжите эту привычку с сеансами практики. Дни с подходящими сеансами будут отмечены как выполненные и смогут открыть редактор сеанса.
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
Подсчет
@@ -815,3 +878,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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]
Следующий раунд
---
---
+127 -3
View File
@@ -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]
冥想
---
@@ -247,6 +304,12 @@ Wim Hof 呼吸
[advanced_session_controls_label]
高级练习控制
---
[double_tap_to_breathe_label]
Double tap to breathe
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[hold_display_label]
屏息显示
---
@@ -260,7 +323,7 @@ Wim Hof 呼吸
音量
---
[show_session_volume_control_label]
在会话中显示音量控制
显示音量控制
---
[reset_to_defaults_label]
恢复默认
@@ -673,10 +736,10 @@ liboqs 未为此目标构建。
下划线
---
[habit_practice_list_title]
练习列表
Session Data From
---
[habit_practice_list_info]
将此习惯关联到练习会话。有匹配会话的日期会显示为已完成,并可打开会话编辑器。
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
---
[habit_counting_title]
计数
@@ -813,3 +876,64 @@ None
Fade
[theme_picker_title]
Choose Theme
[skip_button]
Skip
---
[sync_public_id_full_title]
Full Public ID
---
[sync_public_id_full_message]
Use this if you need the full account identifier.
---
[sync_alias_button]
Alias
---
[sync_alias_title]
Choose Alias
---
[sync_alias_message]
Pick a short alias for this account on the current sync server.
---
[sync_alias_rule]
4-32 characters: lowercase letters, numbers, or underscore.
---
[sync_alias_register_button]
Register Alias
---
[sync_alias_registered]
Alias registered.
---
[sync_alias_failed]
Could not register alias.
---
[sync_alias_change_title]
Change Alias
---
[sync_alias_change_message]
Change the short name for this account on this sync server.
---
[sync_alias_save_button]
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]
下一轮
---
---
+240
View File
@@ -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
}
+203
View File
@@ -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;
}
}
+464
View File
@@ -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;
}
}
+121
View File
@@ -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&amp;network_to=Mainnet&amp;address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&amp;donation=True&amp;simple_mode=True&amp;amount=0.1&amp;name=Inner+Breeze&amp;[email protected]&amp;ticker_from=xmr&amp;network_from=Mainnet&amp;buttonbgcolor=445588&amp;textcolor=ffffff&amp;bgcolor=eaeaffff" target="_blank" rel="noopener">Donate via Crypto</a></nav>
</div>
</details>
</section>
</main>
<footer><p>&copy; 2026 <a href="https://waozi.xyz">Waozi</a> | <a href="/privacy.html">Privacy Policy</a></p></footer>
</div>
</body>
</html>
+189
View File
@@ -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;
}
Binary file not shown.
+165
View File
@@ -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>
+165
View File
@@ -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>
+395
View File
@@ -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>&copy; 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>
+22
View File
@@ -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"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

+96
View File
@@ -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>
+4
View File
@@ -0,0 +1,4 @@
User-agent: *
Allow: /
Sitemap: https://inbe.waozi.xyz/sitemap.xml
+18
View File
@@ -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>
+121
View File
@@ -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;
}
}
+134 -76
View File
@@ -12,6 +12,8 @@
#include "screens/language_screen.h"
#include "screens/manual_screen.h"
#include "screens/settings/settings_screen.h"
#include "screens/settings/settings_data.h"
#include "screens/settings/settings_sync_account.h"
#include "screens/settings/settings_theme.h"
#include "screens/practice_screen.h"
#include "practices/practice_registry.h"
@@ -45,7 +47,6 @@
#if ANDROID_BUILD
#include "android_wakelock.h"
#include "android_timer.h"
#include "android_device.h"
void set_global_inbe_app(InbeApp *app);
#endif
@@ -82,11 +83,6 @@ static int g_sync_running = 0;
static int g_sync_refresh_pending = 0;
static int g_remote_sync_due = 0;
#if defined(PLATFORM_WEB)
static int g_web_background_remainder_ms = 0;
static int g_web_background_meditation_remainder_ms = 0;
#endif
#if !defined(PLATFORM_WEB)
typedef struct InbeSyncWorkerArgs {
char url[256];
@@ -315,11 +311,38 @@ 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;
}
static const char *
app_modal_type_name(UIModalType type)
{
switch(type) {
case UIModalNone: return "none";
case UIModalConfirmExitSession: return "confirm_exit_session";
case UIModalMeditationSetup: return "meditation_setup";
case UIModalConfirmDeleteData: return "confirm_delete_data";
case UIModalConfirmDeleteHabit: return "confirm_delete_habit";
case UIModalEditProgressiveStartSpeed: return "edit_progressive_start_speed";
case UIModalMeditationNetworkError: return "meditation_network_error";
case UIModalConfirmImportDataSettings: return "confirm_import_data_settings";
case UIModalSyncAccountBackup: return "sync_account_backup";
case UIModalConfirmDeleteSyncAccount: return "confirm_delete_sync_account";
case UIModalHabitPracticeListInfo: return "habit_practice_list_info";
case UIModalHabitCountingInfo: return "habit_counting_info";
case UIModalBottomNavConfig: return "bottom_nav_config";
case UIModalThemePicker: return "theme_picker";
case UIModalSyncReview: return "sync_review";
case UIModalSyncAlias: return "sync_alias";
case UIModalSyncPublicId: return "sync_public_id";
default: break;
}
return "unknown";
}
static int
app_input_active(void)
{
@@ -444,6 +467,13 @@ app_pump_sync(InbeApp *app)
if(app == NULL)
return;
app_collect_finished_sync();
if(storage_sync_review_pending() && !app->modal.active) {
if(storage_sync_review_clear_if_no_visible_diff()) {
app_reload_after_import(app, 0);
} else {
app_open_modal(app, UIModalSyncReview);
}
}
app_apply_pending_sync_refresh(app);
if(!app_sync_url(url, sizeof(url)))
return;
@@ -473,7 +503,14 @@ app_pump_sync(InbeApp *app)
return;
}
if(!app_background_sync_safe(app)) {
TraceLog(LOG_INFO, "SYNC: delayed; app is active");
TraceLog(LOG_INFO,
"SYNC: delayed; modal=%d type=%s screen=%d pending_review=%d tutorial_seen=%d habits_guide_seen=%d",
app->modal.active,
app_modal_type_name(app->modal.type),
app->inbe.screen,
storage_sync_review_pending(),
app->tutorial_seen,
app->habits_guide_seen);
if(g_dirty_sync_at <= 0.0)
g_dirty_sync_at = now + 1.0;
return;
@@ -521,6 +558,13 @@ app_switch_screen(InbeApp *app, int screen)
if(screen == InbeScreenHabits && app->inbe.screen != InbeScreenHabits)
app->habits.focus_selected_tab = 1;
if(app->transition_mode == APP_TRANSITION_NONE) {
flint_transition_reset(&app->screen_transition);
app->inbe.screen = screen;
app->screen_transition_target = screen;
return;
}
app->screen_transition_target = screen;
if(app->screen_transition.active) {
if(app->inbe.screen != screen)
@@ -552,6 +596,11 @@ app_observe_direct_screen_change(InbeApp *app, int before_screen)
before_screen == app->inbe.screen)
return;
if(app->transition_mode == APP_TRANSITION_NONE) {
app->screen_transition_target = app->inbe.screen;
return;
}
app->screen_transition = (FlintTransition){
.active = 1,
.phase = FLINT_TRANSITION_IN,
@@ -646,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);
@@ -788,6 +837,25 @@ app_nav_route_label(int route)
return "";
}
void
app_open_modal(InbeApp *app, UIModalType type)
{
if(app == NULL)
return;
app->modal.active = 1;
app->modal.type = type;
app->modal_open_frame = app->inbe.frame;
}
void
app_close_modal(InbeApp *app)
{
if(app == NULL)
return;
app->modal.active = 0;
app->modal.type = UIModalNone;
}
static Texture2D
app_nav_route_icon(InbeApp *app, int route)
{
@@ -1429,13 +1497,10 @@ app_init(void *vapp) {
app->locale_font_8 = (Font){0};
#if ANDROID_BUILD
if (app->inbe.screen == InbeScreenSession) {
if (practice_active(app) != NULL) {
android_allow_screen_off();
}
if (app->inbe.play_in_background) {
android_timer_stop();
android_wakelock_release();
}
practice_active_background_stop(app);
#endif
#if defined(PLATFORM_WEB)
@@ -1490,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},
@@ -1537,10 +1602,6 @@ app_web_set_backgrounded(int active)
return;
app->backgrounded = active ? 1 : 0;
if(!active) {
g_web_background_remainder_ms = 0;
g_web_background_meditation_remainder_ms = 0;
}
}
EMSCRIPTEN_KEEPALIVE
@@ -1548,41 +1609,11 @@ void
app_web_background_tick(int elapsed_ms)
{
InbeApp *app = get_global_inbe_app();
int frame_count;
int elapsed_total;
if(app == NULL || elapsed_ms <= 0)
return;
app->backgrounded = 1;
if(!app->inbe.play_in_background)
return;
if(app->inbe.screen == InbeScreenSession && !app->session_paused) {
g_web_background_meditation_remainder_ms = 0;
elapsed_total = elapsed_ms + g_web_background_remainder_ms;
if(elapsed_total > 5 * 60 * 1000)
elapsed_total = 5 * 60 * 1000;
frame_count = (elapsed_total * 60) / 1000;
g_web_background_remainder_ms = elapsed_total - (frame_count * 1000) / 60;
for(int i = 0; i < frame_count && app->inbe.screen == InbeScreenSession; i++) {
inbestep(&app->inbe);
practice_update_session_sounds(app);
}
return;
}
g_web_background_remainder_ms = 0;
if(app->inbe.screen == InbeScreenMeditation && !app->session_paused) {
elapsed_total = elapsed_ms + g_web_background_meditation_remainder_ms;
g_web_background_meditation_remainder_ms = elapsed_total % 1000;
meditation_background_tick(app, elapsed_total - g_web_background_meditation_remainder_ms);
if(app->inbe.screen == InbeScreenMeditation) {
const PracticeDefinition *practice = practice_get(PRACTICE_MEDITATION);
if(practice->update != NULL)
practice->update(app);
}
}
practice_active_advance_elapsed(app, elapsed_ms);
}
#endif
@@ -1660,18 +1691,11 @@ handle_back_button(InbeApp *app)
case InbeScreenSession:
/* When paused, exit immediately */
if(app->session_paused) {
#if ANDROID_BUILD
if (app->inbe.play_in_background) {
android_wakelock_release();
android_timer_stop();
}
#endif
practice_active_background_stop(app);
app_init(app);
} else {
/* Show confirmation modal */
app->modal.active = 1;
app->modal.type = UIModalConfirmExitSession;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmExitSession);
}
break;
@@ -1737,8 +1761,7 @@ app_draw_bottom_nav_config_modal(InbeApp *app)
.close_icon = app->icons[UI_ICON_TYPE_X]
});
if(result.action == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(result.action == 2) {
app->bottom_nav_count = app->bottom_nav_draft_count;
for(int i = 0; i < APP_BOTTOM_NAV_MAX_ITEMS; i++)
@@ -1748,8 +1771,7 @@ app_draw_bottom_nav_config_modal(InbeApp *app)
app_bottom_nav_normalize(app);
app->settings_dirty = 1;
save_settings(app);
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(result.action == 3) {
app_bottom_nav_default_routes(app->bottom_nav_draft_routes,
&app->bottom_nav_draft_count);
@@ -1766,20 +1788,46 @@ draw_global_modal(InbeApp *app)
if(app->modal_open_frame == app->inbe.frame)
return;
if(settings_data_draw_modals(app))
return;
if(app->modal.type == UIModalMeditationNetworkError) {
modal_result = ui_draw_modal(locale_get("meditation_music_network_error_title"),
locale_get("meditation_music_network_error_message"),
locale_get("ok_button"),
locale_get("ok_button"));
if(modal_result != 0) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
}
}
if(app->modal.type == UIModalBottomNavConfig)
app_draw_bottom_nav_config_modal(app);
if(app->modal.type == UIModalThemePicker)
settings_screen_draw_theme_picker_modal(app);
if(app->modal.type == UIModalSyncAlias) {
modal_result = settings_sync_account_draw_alias_modal(app);
if(modal_result == 1) {
int then_backup = app->sync_alias_then_backup;
app->sync_alias_then_backup = 0;
app_close_modal(app);
settings_screen_set_status_success(locale_get("sync_alias_saved"), NULL);
if(then_backup)
app_open_modal(app, UIModalSyncAccountBackup);
} else if(modal_result == 2) {
settings_screen_set_status_error(locale_get("sync_alias_failed"));
} else if(modal_result == 3) {
int then_backup = app->sync_alias_then_backup;
app->sync_alias_then_backup = 0;
app_close_modal(app);
if(then_backup)
app_open_modal(app, UIModalSyncAccountBackup);
}
}
if(app->modal.type == UIModalSyncPublicId) {
modal_result = settings_sync_account_draw_public_id_modal(app);
if(modal_result != 0)
app_close_modal(app);
}
}
static void
@@ -1787,13 +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;
int 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)
@@ -1805,8 +1856,7 @@ updateapp(InbeApp *app)
habits_screen_prepare_first_run_guide(app);
first_run_guide_active = practice_screen_first_run_guide_active(app);
habits_guide_active = habits_screen_first_run_guide_active(app);
guide_active = first_run_guide_active || habits_guide_active;
ui_set_input_blocked(guide_active);
ui_set_input_blocked(app->modal.active);
if(IsKeyPressed(KEY_BACK)) {
if(first_run_guide_active || habits_guide_active) {
@@ -1815,8 +1865,7 @@ updateapp(InbeApp *app)
app->habits_guide_step = 0;
habits_screen_prepare_first_run_guide(app);
} else if(app->modal.active) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else {
handle_back_button(app);
}
@@ -1855,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);
@@ -1881,7 +1931,9 @@ updateapp(InbeApp *app)
practice_screen_draw_top_bar(app, 1);
}
if(app->modal.active && app->modal.type == UIModalMeditationSetup) {
// Skip drawing on the same frame modal opens to prevent click propagation
if(app->modal.active && app->modal.type == UIModalMeditationSetup &&
app->modal_open_frame != app->inbe.frame) {
const PracticeDefinition *practice = practice_get(PRACTICE_MEDITATION);
if(practice->draw_setup_modal != NULL)
practice->draw_setup_modal(app);
@@ -1900,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;
@@ -1908,12 +1968,10 @@ updateapp(InbeApp *app)
finish_frame:
app_draw_bottom_nav(app);
if(guide_active)
ui_set_input_blocked(0);
ui_set_input_blocked(0);
practice_screen_draw_first_run_guide(app);
habits_screen_draw_first_run_guide(app);
if(!guide_active)
ui_set_input_blocked(0);
ui_set_input_blocked(0);
draw_global_modal(app);
app_flush_deferred_settings(app);
app_observe_direct_screen_change(app, frame_screen);
+27 -3
View File
@@ -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
@@ -76,12 +77,14 @@ typedef enum {
UIModalHabitCountingInfo,
UIModalBottomNavConfig,
UIModalThemePicker,
UIModalSyncReview,
UIModalSyncAlias,
UIModalSyncPublicId,
} UIModalType;
typedef struct {
int active;
UIModalType type;
int selected_button;
} UIModal;
typedef struct InbeConfig {
@@ -102,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 {
@@ -173,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;
@@ -209,6 +223,7 @@ struct InbeApp {
WhmPracticeState whm;
MeditationPracticeState meditation;
SunSalutationPracticeState sun_salutation;
Texture2D font_shapes_texture;
Font locale_font;
Font locale_font_8;
@@ -233,6 +248,10 @@ struct InbeApp {
int sync_server_url_cursor;
int sync_server_url_focused;
char sync_server_url[256];
int sync_alias_cursor;
int sync_alias_focused;
int sync_alias_then_backup;
char sync_alias_input[40];
int device_picker_open;
int device_picker_scroll;
int fullscreen_enabled;
@@ -279,6 +298,8 @@ struct InbeApp {
int habit_counter_press_start_y;
int advanced_session_controls;
int show_session_volume_control;
int double_tap_to_breathe;
double breath_tap_last_time;
int hold_display_mode;
int exercise_type;
int practice_tab;
@@ -316,6 +337,9 @@ void app_play_sound(InbeApp *app, Sound sound, float scale);
Texture2D app_load_asset_texture(const char *name);
void app_unload_texture(Texture2D texture);
void app_open_modal(InbeApp *app, UIModalType type);
void app_close_modal(InbeApp *app);
int clampi(int x, int min, int max);
int int_from_count(const char src[4]);
void count_from_int(char dst[4], int value);
+11 -4
View File
@@ -183,9 +183,13 @@ save_settings(InbeApp *app)
{"progressive_start_speed", app->inbe.progressive_start_speed},
{"breath_animation", app->inbe.breath_animation},
{"advanced_session_controls", app->advanced_session_controls ? 1 : 0},
{"double_tap_to_breathe", app->double_tap_to_breathe ? 1 : 0},
{"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},
@@ -269,6 +273,7 @@ app_load_settings(InbeApp *app)
#endif
{&app->inbe.progressive_speed, "progressive_speed", 1},
{&app->advanced_session_controls, "advanced_session_controls", 0},
{&app->double_tap_to_breathe, "double_tap_to_breathe", 0},
{&app->show_session_volume_control, "show_session_volume_control", 0},
{&app->meditation.music_enabled, "meditation_music_enabled", 1},
{&app->meditation.music_shuffle, "meditation_music_shuffle", 0},
@@ -313,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,
@@ -337,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);
+1 -5
View File
@@ -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");
+1
View File
@@ -34,6 +34,7 @@ enum {
InbeScreenSession,
InbeScreenPracticeSession = InbeScreenSession,
InbeScreenMeditation,
InbeScreenSunSalutation,
InbeScreenResults,
InbeScreenSettings,
InbeScreenPracticeConfig,
+2 -2
View File
@@ -2,8 +2,8 @@
#define INBE_VERSION_H
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 5
#define INBE_VERSION_MINOR 6
#define INBE_VERSION_PATCH 2
#define INBE_VERSION_STRING "1.5.2"
#define INBE_VERSION_STRING "1.6.2"
#endif
+2 -2
View File
@@ -496,7 +496,7 @@ setup_screenshot_scene(InbeApp *app, const ScreenshotRequest *request)
return;
app->language_selected = 1;
app->modal.active = 0;
app_close_modal(app);
app->settings_scroll = 0;
app->manual_scroll = 0;
app->tutorial_step = 0;
@@ -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
+29 -3
View File
@@ -19,11 +19,34 @@ static int timer_running = 0;
static int timer_active = 0; // Only step when timer is active (activity paused)
static void *g_app = NULL;
static int
monotonic_elapsed_ms(struct timespec *last_tick)
{
struct timespec now;
long long elapsed_ms;
clock_gettime(CLOCK_MONOTONIC, &now);
if(last_tick->tv_sec == 0 && last_tick->tv_nsec == 0) {
*last_tick = now;
return FRAME_TIME_US / 1000;
}
elapsed_ms = (long long)(now.tv_sec - last_tick->tv_sec) * 1000LL +
(now.tv_nsec - last_tick->tv_nsec) / 1000000LL;
*last_tick = now;
if(elapsed_ms <= 0)
return FRAME_TIME_US / 1000;
if(elapsed_ms > 5 * 60 * 1000)
return 5 * 60 * 1000;
return (int)elapsed_ms;
}
static void*
timer_thread_func(void *arg) {
(void)arg;
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer thread started");
int frame_count = 0;
struct timespec last_tick = {0};
while (1) {
pthread_mutex_lock(&timer_mutex);
@@ -49,8 +72,7 @@ timer_thread_func(void *arg) {
// Update practice state and sounds with mutex protection
pthread_mutex_lock(&inbe_state_mutex);
InbeApp *app = (InbeApp*)g_app;
inbestep(&app->inbe);
practice_update_session_sounds(app);
practice_active_advance_elapsed(app, monotonic_elapsed_ms(&last_tick));
pthread_mutex_unlock(&inbe_state_mutex);
// Sleep for exact frame time (60fps = ~16.666ms)
@@ -61,6 +83,7 @@ timer_thread_func(void *arg) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer: Paused (inactive)");
frame_count = 0;
}
last_tick = (struct timespec){0};
usleep(50000); // 50ms
}
}
@@ -125,7 +148,10 @@ android_timer_stop(void) {
timer_active = 0;
pthread_mutex_unlock(&timer_mutex);
pthread_join(timer_thread, NULL);
if(pthread_equal(pthread_self(), timer_thread))
pthread_detach(timer_thread);
else
pthread_join(timer_thread, NULL);
TraceLog(LOG_INFO, "INBE: Background timer stopped");
}
+31
View File
@@ -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 ===");
+2
View File
@@ -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
+21 -14
View File
@@ -13,9 +13,13 @@
#include <stdlib.h>
#include <string.h>
#if defined(PLATFORM_WEB)
#include <emscripten.h>
#endif
#ifndef INBE_MEDITATION_AUDIO_URL
#if defined(PLATFORM_WEB)
#define INBE_MEDITATION_AUDIO_URL "/web-assets/dl/inbe-meditation-audio-v1.zip"
#define INBE_MEDITATION_AUDIO_URL "web-assets/dl/inbe-meditation-audio-v1.zip"
#else
#define INBE_MEDITATION_AUDIO_URL "https://inbe.waozi.xyz/web-assets/dl/inbe-meditation-audio-v1.zip"
#endif
@@ -151,21 +155,13 @@ set_status(InbeApp *app, const char *message)
static int
download_supported(void)
{
#if defined(PLATFORM_WEB)
return 0;
#else
return 1;
#endif
}
static const char *
missing_audio_message(void)
{
#if defined(PLATFORM_WEB)
return "Audio is unavailable";
#else
return "Download audio before playing music";
#endif
}
static int
@@ -368,6 +364,17 @@ extract_audio_archive(InbeApp *app, const char *archive_path)
mz_zip_reader_end(&archive);
snprintf(app->meditation.music_status, sizeof(app->meditation.music_status),
"Installed %d audio files", extracted);
#if defined(PLATFORM_WEB)
if(extracted > 0) {
EM_ASM({
if(typeof FS !== 'undefined' && FS.syncfs) {
FS.syncfs(false, function(err) {
if(err) console.error('meditation audio save failed', err);
});
}
});
}
#endif
return extracted > 0;
}
@@ -550,8 +557,10 @@ meditation_music_update(InbeApp *app)
return;
if(app->meditation.music_test_playing &&
(app->exercise_type != EXERCISE_MEDITATION ||
(app->inbe.screen != InbeScreenPracticeConfig &&
app->inbe.screen != InbeScreenManual))) {
!((app->inbe.screen == InbeScreenStart &&
app->practice_tab == PRACTICE_TAB_CONFIG) ||
app->inbe.screen == InbeScreenPracticeConfig ||
app->inbe.screen == InbeScreenManual))) {
meditation_music_stop(app);
return;
}
@@ -566,9 +575,7 @@ meditation_music_update(InbeApp *app)
if(is_network_download_error(&app->meditation.music_download)) {
set_status(app, locale_get("meditation_music_network_error_title"));
if(!app->meditation.music_network_error_notified && !app->modal.active) {
app->modal.active = 1;
app->modal.type = UIModalMeditationNetworkError;
app->modal.selected_button = 0;
app_open_modal(app, UIModalMeditationNetworkError);
app->meditation.music_network_error_notified = 1;
}
} else if(app->meditation.music_download.error[0] != '\0') {
@@ -25,9 +25,7 @@ meditation_practice_start(InbeApp *app)
if(app == NULL)
return;
mark_exercise_manual_seen(app, EXERCISE_MEDITATION);
app->modal.active = 1;
app->modal.type = UIModalMeditationSetup;
app->modal.selected_button = 0;
app_open_modal(app, UIModalMeditationSetup);
app_switch_screen(app, InbeScreenStart);
}
@@ -14,6 +14,6 @@ void meditation_config_screen_draw(InbeApp *app);
void meditation_draw_setup_modal(InbeApp *app);
void meditation_draw_screen(InbeApp *app, int center_x, int center_y);
void meditation_request_exit(InbeApp *app);
void meditation_background_tick(InbeApp *app, int elapsed_ms);
void meditation_advance_elapsed(InbeApp *app, int elapsed_ms);
#endif
+29 -19
View File
@@ -6,6 +6,7 @@
#include "meditation_music.h"
#include "flint_theme.h"
#include "flint_ui.h"
#include "practices/practice_registry.h"
#include "raylib.h"
#include <stdio.h>
@@ -13,6 +14,8 @@
extern int view_width;
extern int view_height;
static int meditation_background_remainder_ms = 0;
static Texture2D
meditation_sound_icon_for_volume(InbeApp *app)
{
@@ -35,13 +38,14 @@ meditation_start(InbeApp *app, int seconds)
app->meditation.duration_seconds = seconds;
app->meditation.remaining_seconds = seconds;
app->meditation.frame_ticks = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
app_switch_screen(app, InbeScreenMeditation);
app_play_sound(app, app->bell_sound, 1.0f);
meditation_music_start_session(app);
practice_background_start(app, PRACTICE_MEDITATION);
}
static void
@@ -65,23 +69,30 @@ meditation_finish(InbeApp *app)
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
meditation_music_stop(app);
practice_active_background_stop(app);
app_switch_screen(app, InbeScreenStart);
}
void
meditation_background_tick(InbeApp *app, int elapsed_ms)
meditation_advance_elapsed(InbeApp *app, int elapsed_ms)
{
int elapsed_total;
int elapsed_seconds;
if(app == NULL || elapsed_ms <= 0)
return;
if(app->inbe.screen != InbeScreenMeditation || app->session_paused)
if(app->inbe.screen != InbeScreenMeditation || app->session_paused) {
meditation_background_remainder_ms = 0;
return;
}
elapsed_seconds = elapsed_ms / 1000;
elapsed_total = elapsed_ms + meditation_background_remainder_ms;
elapsed_seconds = elapsed_total / 1000;
meditation_background_remainder_ms = elapsed_total % 1000;
if(elapsed_seconds <= 0)
return;
@@ -137,10 +148,11 @@ meditation_exit_to_start(InbeApp *app)
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
practice_active_background_stop(app);
app_switch_screen(app, InbeScreenStart);
}
@@ -149,9 +161,7 @@ meditation_request_exit(InbeApp *app)
{
if(app == NULL)
return;
app->modal.active = 1;
app->modal.type = UIModalConfirmExitSession;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmExitSession);
}
static void
@@ -221,6 +231,9 @@ meditation_draw_setup_modal(InbeApp *app)
if(btn_w < flint_px(64))
btn_w = flint_px(64);
ui_set_modal_capture((Rectangle){
(float)modal_x, (float)modal_y, (float)modal_w, (float)modal_h
});
DrawRectangle(0, 0, view_width, view_height, (Color){0, 0, 0, 180});
DrawRectangle(modal_x, modal_y, modal_w, modal_h, flint_theme_get_surface());
ui_draw_bevel(modal_x, modal_y, modal_w, modal_h,
@@ -251,8 +264,7 @@ meditation_draw_setup_modal(InbeApp *app)
if(ui_draw_generic_button(cancel_x, cancel_y, cancel_w, btn_h,
locale_get("cancel_button"), UI_BUTTON_STYLE_SECONDARY,
0, &cancel_hover)) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
}
}
@@ -310,8 +322,7 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
locale_get("save_button"),
locale_get("discard_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(modal_result == 2) {
meditation_save_elapsed(app);
meditation_exit_to_start(app);
@@ -324,8 +335,7 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
locale_get("cancel_button"),
locale_get("exit_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(modal_result == 2) {
meditation_exit_to_start(app);
}
@@ -342,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++;
+146
View File
@@ -5,6 +5,31 @@
#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"
#include "android_wakelock.h"
void set_global_inbe_app(InbeApp *app);
#endif
static int
practice_whm_is_active(const InbeApp *app)
{
return app != NULL && app->inbe.screen == InbeScreenSession;
}
static int
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] = {
{
@@ -21,6 +46,10 @@ static const PracticeDefinition g_practices[PRACTICE_COUNT] = {
.draw_setup_modal = NULL,
.draw_active_session = NULL,
.request_exit = NULL,
.is_active = practice_whm_is_active,
.background_start = session_background_start,
.background_stop = NULL,
.advance_elapsed = session_advance_elapsed,
},
{
.id = PRACTICE_MEDITATION,
@@ -36,6 +65,29 @@ static const PracticeDefinition g_practices[PRACTICE_COUNT] = {
.draw_setup_modal = meditation_draw_setup_modal,
.draw_active_session = meditation_draw_screen,
.request_exit = meditation_request_exit,
.is_active = practice_meditation_is_active,
.background_start = NULL,
.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,
},
};
@@ -66,6 +118,100 @@ practice_label(int id)
return locale_get(practice_get(id)->label_key);
}
const PracticeDefinition *
practice_active(const InbeApp *app)
{
for(int i = 0; i < practice_count(); i++) {
const PracticeDefinition *practice = practice_get(i);
if(practice->is_active != NULL && practice->is_active(app))
return practice;
}
return NULL;
}
int
practice_active_supports_background(const InbeApp *app)
{
const PracticeDefinition *practice = practice_active(app);
return practice != NULL && practice->advance_elapsed != NULL;
}
void
practice_background_start(InbeApp *app, int id)
{
const PracticeDefinition *practice;
if(app == NULL)
return;
practice = practice_get(id);
#if ANDROID_BUILD
set_global_inbe_app(app);
#endif
if(practice == NULL || practice->advance_elapsed == NULL)
return;
if(practice->background_start != NULL)
practice->background_start(app);
#if ANDROID_BUILD
if(app->inbe.play_in_background) {
android_wakelock_acquire();
android_timer_set_app(app);
android_timer_start();
}
#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)
{
const PracticeDefinition *practice = practice_active(app);
if(app == NULL)
return;
if(practice != NULL && practice->background_stop != NULL)
practice->background_stop(app);
#if ANDROID_BUILD
if(app->inbe.play_in_background && practice != NULL &&
practice->advance_elapsed != NULL) {
android_wakelock_release();
android_timer_stop();
}
#endif
}
void
practice_active_advance_elapsed(InbeApp *app, int elapsed_ms)
{
const PracticeDefinition *practice;
if(app == NULL || elapsed_ms <= 0 || !app->inbe.play_in_background)
return;
practice = practice_active(app);
if(practice == NULL || practice->advance_elapsed == NULL)
return;
practice->advance_elapsed(app, elapsed_ms);
if(practice->update != NULL && practice->is_active != NULL &&
practice->is_active(app))
practice->update(app);
}
void
practice_update_circle_bounds(InbeApp *app, int top_reserve, int bottom_reserve)
{
+12 -1
View File
@@ -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 {
@@ -23,6 +24,10 @@ typedef struct PracticeDefinition {
void (*draw_setup_modal)(InbeApp *app);
void (*draw_active_session)(InbeApp *app, int center_x, int center_y);
void (*request_exit)(InbeApp *app);
int (*is_active)(const InbeApp *app);
void (*background_start)(InbeApp *app);
void (*background_stop)(InbeApp *app);
void (*advance_elapsed)(InbeApp *app, int elapsed_ms);
} PracticeDefinition;
const PracticeDefinition *practice_get(int id);
@@ -36,5 +41,11 @@ int practice_draw_start_preview(InbeApp *app, int center_x, int center_y);
void practice_draw_active_breathing(InbeApp *app, int center_x, int center_y);
void practice_update_active_breathing(InbeApp *app, int center_x, int center_y, int *hover);
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);
#endif
@@ -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;
}
+15 -5
View File
@@ -64,6 +64,9 @@ whm_draw_progressive_start_speed_editor(InbeApp *app)
modal_y = (view_height - modal_h) / 2;
title_y = modal_y + flint_px(14);
ui_set_modal_capture((Rectangle){
(float)modal_x, (float)modal_y, (float)modal_w, (float)modal_h
});
DrawRectangle(0, 0, view_width, view_height, (Color){0, 0, 0, 180});
DrawRectangle(modal_x, modal_y, modal_w, modal_h, flint_theme_get_surface());
ui_draw_bevel(modal_x, modal_y, modal_w, modal_h,
@@ -80,8 +83,7 @@ whm_draw_progressive_start_speed_editor(InbeApp *app)
if(ui_draw_icon_btn_padded(modal_x + modal_w - close_w - flint_px(6), modal_y + flint_px(6),
close_size, close_padding, app->icons[UI_ICON_TYPE_X], &close_hover)) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
return;
}
@@ -203,9 +205,7 @@ whm_config_draw_breathing_tab(InbeApp *app, int content_x, int content_w, int y,
if(ui_draw_generic_button(content_x, y, modify_w, flint_px(36),
locale_get("modify_start_speed_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &modify_hover)) {
app->modal.active = 1;
app->modal.type = UIModalEditProgressiveStartSpeed;
app->modal.selected_button = 0;
app_open_modal(app, UIModalEditProgressiveStartSpeed);
}
y += flint_px(58);
}
@@ -220,6 +220,7 @@ whm_config_draw_session_tab(InbeApp *app, int content_x, int content_w, int y)
int max_rounds = app->inbe.max_rounds;
int max_breaths = int_from_count(app->inbe.maxbreaths);
int pause_seconds = app->inbe.pause_seconds;
int double_tap_to_breathe = app->double_tap_to_breathe;
int advanced_session_controls = app->advanced_session_controls;
int toggle_w = flint_px(56);
int toggle_h = flint_px(30);
@@ -252,6 +253,13 @@ whm_config_draw_session_tab(InbeApp *app, int content_x, int content_w, int y)
y += flint_px(26);
draw_hold_display_mode_selector(app, content_x, y, content_w);
y += flint_px(52);
flint_text_draw(locale_get("double_tap_to_breathe_label"), content_x, y, flint_ui_font(), flint_theme_get_text());
if(ui_draw_toggle_switch(content_x, y + flint_px(26), toggle_w, toggle_h, &double_tap_to_breathe,
locale_get("toggle_off"), locale_get("toggle_on"))) {
app->double_tap_to_breathe = double_tap_to_breathe;
app->settings_dirty = 1;
}
y += flint_px(76);
flint_text_draw(locale_get("advanced_session_controls_label"), content_x, y, flint_ui_font(), flint_theme_get_text());
if(ui_draw_toggle_switch(content_x, y + flint_px(26), toggle_w, toggle_h, &advanced_session_controls,
locale_get("toggle_off"), locale_get("toggle_on"))) {
@@ -273,6 +281,7 @@ whm_config_draw_session_tab(InbeApp *app, int content_x, int content_w, int y)
app->inbe.breath_animation = InbeBreathAnimationLinear;
app->settings_preview.breath_animation = InbeBreathAnimationLinear;
app->advanced_session_controls = 0;
app->double_tap_to_breathe = 0;
app->hold_display_mode = HOLD_DISPLAY_CIRCLE;
apply_settings(&app->inbe, speed, max_rounds, max_breaths, pause_seconds);
apply_settings(&app->settings_preview, speed, max_rounds, max_breaths, pause_seconds);
@@ -308,6 +317,7 @@ whm_config_content_height(InbeApp *app, int content_w)
return flint_px(66) * 3 +
flint_px(26) + flint_px(52) +
flint_px(76) +
flint_px(76) +
flint_px(36) + flint_px(28) +
bottom_padding;
}
+163 -37
View File
@@ -6,18 +6,25 @@
#include "flint_theme.h"
#include "flint_dpi.h"
#include "flint_ui.h"
#include "practices/practice_registry.h"
#include <stdio.h>
#include <string.h>
#if ANDROID_BUILD
#include "android_timer.h"
#include "android_wakelock.h"
void set_global_inbe_app(InbeApp *app);
#endif
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)
{
@@ -151,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)
{
@@ -189,6 +239,45 @@ update_session_sounds(InbeApp *app)
remember_sound_state(app);
}
void
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);
}
void
session_advance_elapsed(InbeApp *app, int elapsed_ms)
{
int elapsed_total;
int frame_count;
if(app == NULL || elapsed_ms <= 0)
return;
if(app->inbe.screen != InbeScreenSession || app->session_paused)
return;
elapsed_total = elapsed_ms + whm_background_remainder_ms;
if(elapsed_total > 5 * 60 * 1000)
elapsed_total = 5 * 60 * 1000;
frame_count = (elapsed_total * 60) / 1000;
whm_background_remainder_ms = elapsed_total - (frame_count * 1000) / 60;
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
}
}
void
session_start(InbeApp *app)
{
@@ -216,15 +305,12 @@ session_start(InbeApp *app)
#if ANDROID_BUILD
android_keep_screen_on();
#endif
TraceLog(LOG_INFO, "INBE: Starting session - play_in_background = %d", app->inbe.play_in_background);
if(app->inbe.play_in_background) {
android_wakelock_acquire();
android_timer_set_app(app);
set_global_inbe_app(app);
android_timer_start();
} else {
set_global_inbe_app(app);
}
practice_background_start(app, PRACTICE_WHM);
#if ANDROID_BUILD
whm_last_notification_text[0] = '\0';
session_update_notification(app);
#endif
}
@@ -334,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 {
@@ -544,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);
@@ -576,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;
}
@@ -632,9 +746,6 @@ draw_session_round_label(InbeApp *app)
int text_y;
int font = FLINT_TEXT_16;
if(app->inbe.phase != InbePhaseBreathe)
return;
locale_format(max_text, sizeof(max_text), "session_round_label", MaxRounds);
max_text_w = flint_text_measure(max_text, font);
locale_format(text, sizeof(text), "session_round_label", app->inbe.round + 1);
@@ -669,14 +780,7 @@ sound_icon_for_volume(InbeApp *app)
static void
stop_android_background_session(InbeApp *app)
{
#if ANDROID_BUILD
if(app->inbe.play_in_background) {
android_wakelock_release();
android_timer_stop();
}
#else
(void)app;
#endif
practice_active_background_stop(app);
}
void
@@ -692,9 +796,7 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
stop_android_background_session(app);
app_init(app);
} else {
app->modal.active = 1;
app->modal.type = UIModalConfirmExitSession;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmExitSession);
}
}
@@ -729,18 +831,15 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
locale_get("save_button"),
locale_get("discard_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(modal_result == 2) {
session_ensure_results_saved(app);
stop_android_background_session(app);
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
app_init(app);
} else if(modal_result == 3) {
stop_android_background_session(app);
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
app_init(app);
}
} else {
@@ -749,12 +848,10 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
locale_get("cancel_button"),
locale_get("exit_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(modal_result == 2) {
stop_android_background_session(app);
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
app_init(app);
}
}
@@ -797,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
@@ -817,17 +914,46 @@ 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)
app->breath_tap_last_time = 0.0;
if(app->inbe.phase == InbePhaseHold) {
const char *breath_label = locale_get("breath_button");
int breath_font = FLINT_TEXT_16;
int breath_w = flint_text_measure(breath_label, breath_font) + flint_px(72);
int breath_h = flint_text_line_height(breath_font) + flint_px(28);
int breath_y = center_y + app->inbe.rmax + flint_px(10);
int breath_y = center_y + app->inbe.rmax - flint_px(2);
int breath_x;
int breath_hover = 0;
if(app->double_tap_to_breathe) {
const char *hint = locale_get("double_tap_to_breathe_hint");
int hint_font = flint_ui_font();
int hint_w = flint_text_measure(hint, hint_font);
int hint_y = center_y + app->inbe.rmax + flint_px(12);
if(hint_y > breath_max_y)
hint_y = breath_max_y;
flint_text_draw(hint, center_x - hint_w / 2, hint_y, hint_font,
flint_theme_get_text());
if(IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) {
double now = GetTime();
if(app->breath_tap_last_time > 0.0 &&
now - app->breath_tap_last_time <= 0.35) {
app->breath_tap_last_time = 0.0;
finish_hold(app);
} else {
app->breath_tap_last_time = now;
}
}
return;
}
if(breath_w < flint_px(184))
breath_w = flint_px(184);
if(breath_w > view_width - flint_px(24))
+2
View File
@@ -14,6 +14,8 @@ int session_draw_start_preview(InbeApp *app, int center_x, int center_y);
void session_update_screen(InbeApp *app, int center_x, int center_y, int *hover);
void session_draw_results_screen(InbeApp *app, int center_x, int center_y, int *hover);
void update_session_sounds(InbeApp *app);
void session_background_start(InbeApp *app);
void session_advance_elapsed(InbeApp *app, int elapsed_ms);
void update_preview_bounds(Inbe *inbe, int content_w, int max_h);
void draw_preview_inbe(Inbe *inbe, int center_x, int center_y);
int draw_hold_display_mode_selector(InbeApp *app, int x, int y, int w);
+10 -23
View File
@@ -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
@@ -370,8 +367,7 @@ draw_habit_edit_screen(InbeApp *app)
if(app->modal.active && app->modal.type == UIModalHabitPracticeListInfo) {
if(habit_edit_info_modal(locale_get("habit_practice_list_title"),
locale_get("habit_practice_list_info"))) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
}
return;
}
@@ -379,8 +375,7 @@ draw_habit_edit_screen(InbeApp *app)
if(app->modal.active && app->modal.type == UIModalHabitCountingInfo) {
if(habit_edit_info_modal(locale_get("habit_counting_title"),
locale_get("habit_counting_info"))) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
}
return;
}
@@ -391,12 +386,10 @@ draw_habit_edit_screen(InbeApp *app)
locale_get("cancel_button"),
locale_get("delete_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
} else if(modal_result == 2) {
int index = app->habit_edit.index;
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
habit_edit_cancel(app);
if(index >= 0 && index < app->habits.count) {
habits_delete(&app->habits, index);
@@ -464,9 +457,7 @@ draw_habit_edit_screen(InbeApp *app)
.info_button = 1,
.color = flint_darken(flint_theme_get_text(), 34)
}, content_x, y)) {
app->modal.active = 1;
app->modal.type = UIModalHabitPracticeListInfo;
app->modal.selected_button = 0;
app_open_modal(app, UIModalHabitPracticeListInfo);
}
y += ui_section_label_height((FlintUISectionLabel){0});
for(int i = 0; i < EXERCISE_COUNT; i++) {
@@ -492,9 +483,7 @@ draw_habit_edit_screen(InbeApp *app)
.info_button = 1,
.color = flint_darken(flint_theme_get_text(), 34)
}, content_x, y)) {
app->modal.active = 1;
app->modal.type = UIModalHabitCountingInfo;
app->modal.selected_button = 0;
app_open_modal(app, UIModalHabitCountingInfo);
}
y += ui_section_label_height((FlintUISectionLabel){0});
if(ui_draw_checkbox_row((FlintUICheckboxRow){
@@ -535,9 +524,7 @@ draw_habit_edit_screen(InbeApp *app)
.count = action_count
});
if(!app->habit_edit.is_new && clicked_action == 0) {
app->modal.active = 1;
app->modal.type = UIModalConfirmDeleteHabit;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmDeleteHabit);
} else if((app->habit_edit.is_new && clicked_action == 0) ||
(!app->habit_edit.is_new && clicked_action == 1)) {
ui_scroll_page_end(page);
+5 -2
View File
@@ -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;
}
+4 -31
View File
@@ -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 &&
@@ -793,8 +793,7 @@ habit_open_linked_edit_page(InbeApp *app, int habit_index, int day_index)
app->habit_detail_day = day_index;
app->habit_detail_session_path[0] = '\0';
app->habit_session_edit = (HabitSessionEditState){.round = -1};
app->modal.active = 0;
app->modal.type = 0;
app_close_modal(app);
app_switch_screen(app, InbeScreenHabitSessionEdit);
}
@@ -853,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)
{
@@ -1626,12 +1606,9 @@ draw_habits_screen(InbeApp *app)
int scroll_y;
int scroll_h;
int weekly_days = HABIT_WEEKLY_INITIAL_DAYS;
int screen_input_blocked;
if(app == NULL)
return;
screen_input_blocked = app->modal.active ||
habits_screen_first_run_guide_active(app);
if(app->habits.tab < HABIT_TAB_WEEKLY || app->habits.tab >= HABIT_TAB_COUNT) {
app->habits.tab = app->habits.view_mode == HABIT_VIEW_WEEKLY
@@ -1765,12 +1742,10 @@ draw_habits_screen(InbeApp *app)
y = page.content_y + flint_px(8);
if(app->habits.view_mode == HABIT_VIEW_WEEKLY) {
ui_set_input_blocked(screen_input_blocked);
draw_habits_weekly_view(app, active, selected, linked_ctx,
content_x, content_w, y, weekly_days);
ui_scroll_page_end(page);
free(linked_ctx);
ui_set_input_blocked(screen_input_blocked);
draw_habits_top_bar(app, 0);
if(app->inbe.screen == InbeScreenHabits)
draw_habits_top_bar(app, 1);
@@ -1778,7 +1753,6 @@ draw_habits_screen(InbeApp *app)
}
forward_disabled = app->habits.month_offset >= 0;
ui_set_input_blocked(screen_input_blocked);
if(ui_draw_generic_button(content_x, y, flint_px(44), month_h, "<",
UI_BUTTON_STYLE_SECONDARY, 0, &hover)) {
app->habits.month_offset--;
@@ -1893,7 +1867,6 @@ draw_habits_screen(InbeApp *app)
ui_scroll_page_end(page);
}
free(linked_ctx);
ui_set_input_blocked(screen_input_blocked);
draw_habits_top_bar(app, 0);
if(app->inbe.screen == InbeScreenHabits)
draw_habits_top_bar(app, 1);
+60 -15
View File
@@ -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;
}
+138 -21
View File
@@ -23,6 +23,7 @@
#endif
#include "raylib.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
enum {
@@ -44,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;
@@ -150,9 +152,7 @@ settings_begin_import_for_path(InbeApp *app, const char *path)
if((info.has_sessions || info.has_habits) && info.has_settings) {
snprintf(pending_import_path, sizeof(pending_import_path), "%s", path);
pending_import_info = info;
app->modal.active = 1;
app->modal.type = UIModalConfirmImportDataSettings;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmImportDataSettings);
settings_screen_clear_status();
return;
}
@@ -200,6 +200,112 @@ settings_draw_import_choice_modal(InbeApp *app)
return 0;
}
static int
settings_draw_sync_review_modal(InbeApp *app)
{
FlintUIPanelFrame frame;
char *diff_detail = NULL;
FlintUIParagraph intro;
int intro_h;
int modal_w = ui_view_width >= flint_px(620) ? flint_px(560) : flint_px(336);
int modal_h = ui_view_height >= flint_px(520) ? flint_px(440) : ui_view_height - flint_px(32);
int btn_h = flint_px(36);
int gap = flint_px(10);
int btn_y;
int diff_y;
int diff_h;
int legend_y;
int hover = 0;
static int diff_scroll = 0;
int diff_content_h = flint_px(40);
(void)app;
if(modal_h < flint_px(320))
modal_h = flint_px(320);
if(!storage_sync_review_diff(&diff_detail)) {
free(diff_detail);
return 0;
}
frame = ui_draw_modal_frame(modal_w, modal_h, "Sync needs review",
(Texture2D){0}, (Texture2D){0});
intro = (FlintUIParagraph){
.text = "Review data differences.",
.width = frame.content_w,
.font = flint_ui_font_small(),
.line_gap = flint_px(2),
.color = flint_theme_get_text()
};
intro_h = flint_ui_paragraph_height(intro);
{
int intro_y = frame.content_y;
flint_ui_paragraph_draw(intro, frame.content_x, &intro_y);
}
diff_y = frame.content_y + intro_h + flint_px(12);
btn_y = frame.y + frame.h - flint_px(24) - btn_h;
legend_y = btn_y - flint_px(24);
diff_h = legend_y - diff_y - flint_px(8);
if(diff_h < flint_px(150))
diff_h = flint_px(150);
{
const char *p = diff_detail;
diff_content_h = flint_px(20);
while(p != NULL && *p != '\0') {
diff_content_h += flint_px(20);
p = strchr(p, '\n');
if(p != NULL)
p++;
}
}
FlintUIScrollView diff_view = ui_scroll_container_begin((FlintUIScrollArea){
.bounds = {(float)frame.content_x, (float)diff_y, (float)frame.content_w, (float)diff_h},
.content_height = diff_content_h,
.content_x = frame.content_x + flint_px(10),
.content_width = frame.content_w - flint_px(20),
.scroll_offset = &diff_scroll,
.wheel_step = flint_px(24)
});
{
char *line = strtok(diff_detail, "\n");
int line_y = diff_view.content_y;
while(line != NULL) {
Color color = flint_theme_get_text();
if(line[0] == '-')
color = (Color){215, 88, 88, 255};
else if(line[0] == '+')
color = (Color){74, 170, 112, 255};
flint_text_draw(line, diff_view.content_x, line_y,
flint_ui_font_small(), color);
line_y += flint_px(20);
line = strtok(NULL, "\n");
}
}
ui_scroll_container_end((FlintUIScrollArea){
.bounds = {(float)frame.content_x, (float)diff_y, (float)frame.content_w, (float)diff_h},
.scroll_offset = &diff_scroll
}, diff_view);
flint_text_draw("- Local only", frame.content_x, legend_y,
flint_ui_font_small(), (Color){215, 88, 88, 255});
flint_text_draw("+ Remote only", frame.content_x + flint_px(112), legend_y,
flint_ui_font_small(), (Color){74, 170, 112, 255});
if(ui_draw_generic_button(frame.content_x, btn_y,
(frame.content_w - gap) / 2, btn_h,
"Keep local", UI_BUTTON_STYLE_SECONDARY, 0, &hover)) {
free(diff_detail);
return 1;
}
if(ui_draw_generic_button(frame.content_x + (frame.content_w + gap) / 2, btn_y,
(frame.content_w - gap) / 2, btn_h,
"Use remote", UI_BUTTON_STYLE_PRIMARY, 0, &hover)) {
free(diff_detail);
return 2;
}
free(diff_detail);
return 0;
}
static int
settings_link_icon_columns(int content_w)
{
@@ -238,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) +
@@ -446,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))
@@ -722,9 +830,7 @@ static void
settings_request_delete_all_data(InbeApp *app)
{
if(data_has_any()) {
app->modal.active = 1;
app->modal.type = UIModalConfirmDeleteData;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmDeleteData);
} else {
settings_screen_set_status_error(locale_get("no_data_to_delete"));
}
@@ -816,8 +922,7 @@ settings_data_draw_modals(InbeApp *app)
if(app->modal.type == UIModalConfirmImportDataSettings) {
int modal_result = settings_draw_import_choice_modal(app);
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
settings_clear_pending_import();
settings_screen_set_status_error(locale_get("import_cancelled"));
} else if(modal_result == 2 || modal_result == 3) {
@@ -826,8 +931,7 @@ settings_data_draw_modals(InbeApp *app)
? DATA_IMPORT_DATA_AND_SETTINGS
: DATA_IMPORT_DATA_ONLY;
snprintf(import_path, sizeof(import_path), "%s", pending_import_path);
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
settings_clear_pending_import();
settings_perform_import(app, import_path, mode);
}
@@ -840,13 +944,11 @@ settings_data_draw_modals(InbeApp *app)
locale_get("cancel_button"),
locale_get("clear_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
settings_screen_set_status_error(locale_get("delete_cancelled"));
} else if(modal_result == 2) {
long long deleted = data_delete_all();
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
if(deleted > 0) {
char deleted_message[128];
habits_free(&app->habits);
@@ -877,12 +979,10 @@ settings_data_draw_modals(InbeApp *app)
locale_get("cancel_button"),
locale_get("clear_button"));
if(modal_result == 1) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
settings_screen_set_status_error(locale_get("sync_clear_remote_data_cancelled"));
} else if(modal_result == 2) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
settings_sync_account_clear_remote_confirmed(app);
}
return 1;
@@ -891,8 +991,7 @@ settings_data_draw_modals(InbeApp *app)
if(app->modal.type == UIModalSyncAccountBackup) {
int modal_result = settings_sync_account_draw_backup_modal(app);
if(modal_result == 1 || modal_result == 2 || modal_result == 3 || modal_result == 4) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
if(modal_result == 2)
settings_screen_set_status_success(locale_get("sync_private_key_backup_saved"), NULL);
else if(modal_result == 3)
@@ -901,5 +1000,23 @@ settings_data_draw_modals(InbeApp *app)
return 1;
}
if(app->modal.type == UIModalSyncReview) {
int modal_result = settings_draw_sync_review_modal(app);
if(modal_result == 1 || modal_result == 2) {
int use_remote = modal_result == 2;
if(storage_apply_pending_sync_review(use_remote)) {
app_close_modal(app);
if(use_remote)
app_reload_after_import(app, 0);
else
app_auto_sync(app);
settings_screen_set_status_success(use_remote ? "Using remote data" : "Keeping local data", NULL);
} else {
settings_screen_set_status_error("Sync review failed");
}
}
return 1;
}
return 0;
}
+5 -37
View File
@@ -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;
+78 -49
View File
@@ -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
@@ -205,21 +202,40 @@ settings_screen_draw(InbeApp *app)
settings_data_handle_web_import(app);
#endif
ui_set_input_blocked(app->modal.active);
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) {
app->modal.active = 0;
app->modal.type = UIModalNone;
app_close_modal(app);
}
settings_screen_clear_status();
}
@@ -239,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
@@ -247,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);
@@ -254,9 +286,6 @@ settings_screen_draw(InbeApp *app)
settings_device_handle_overlays(app, &device_state);
ui_set_dropdown_clip_top(0);
ui_set_input_blocked(0);
settings_data_draw_modals(app);
if(IsMouseButtonReleased(MOUSE_BUTTON_LEFT) && app->settings_dirty)
save_settings(app);
+111
View File
@@ -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);
}
}
+9
View File
@@ -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
+304 -94
View File
@@ -15,6 +15,7 @@
#define INBE_SYNC_SERVER_URL_KEY "sync_server_url"
#define INBE_SYNC_SERVER_URL_DEFAULT "https://api.waozi.xyz"
#define INBE_SYNC_ACCOUNT_ALIAS_KEY "sync_account_alias"
static SettingsSyncKeySaveDialog save_dialog_callback = NULL;
static SettingsSyncKeyImportDialog import_dialog_callback = NULL;
@@ -31,85 +32,43 @@ settings_sync_account_set_import_dialog(SettingsSyncKeyImportDialog callback)
import_dialog_callback = callback;
}
static void
static int
settings_draw_public_id_field(const char *text, int x, int w, int *y, int font,
FlintUITextInputStyle style)
{
char line[128];
int text_len;
int pad_x;
int pad_y = flint_px(8);
int line_h = flint_text_line_height(font);
int content_w;
int line_count = 0;
int offset = 0;
int field_h;
int draw_y;
int clicked = 0;
if(text == NULL || y == NULL)
return;
text_len = (int)strlen(text);
pad_x = style.padding_x > 0 ? style.padding_x : flint_px(10);
content_w = w - pad_x * 2;
if(content_w < flint_px(24))
content_w = flint_px(24);
while(offset < text_len) {
int len;
if(flint_text_measure(text + offset, font) <= content_w) {
offset = text_len;
line_count++;
break;
}
len = 1;
while(offset + len < text_len && len + 1 < (int)sizeof(line)) {
snprintf(line, sizeof(line), "%.*s", len + 1, text + offset);
if(flint_text_measure(line, font) > content_w)
break;
len++;
}
offset += len;
line_count++;
}
if(line_count < 1)
line_count = 1;
field_h = line_count * line_h + pad_y * 2;
DrawRectangleRounded((Rectangle){(float)x, (float)*y, (float)w, (float)field_h},
style.radius > 0.0f ? style.radius : 0.08f, 8,
style.background);
DrawRectangleRoundedLines((Rectangle){(float)x, (float)*y, (float)w, (float)field_h},
style.radius > 0.0f ? style.radius : 0.08f, 8,
style.border);
offset = 0;
draw_y = *y + pad_y;
while(offset < text_len) {
int len;
if(flint_text_measure(text + offset, font) <= content_w) {
snprintf(line, sizeof(line), "%s", text + offset);
flint_text_draw(line, x + pad_x, draw_y, font, style.text);
break;
}
len = 1;
while(offset + len < text_len && len + 1 < (int)sizeof(line)) {
snprintf(line, sizeof(line), "%.*s", len + 1, text + offset);
if(flint_text_measure(line, font) > content_w)
break;
len++;
}
snprintf(line, sizeof(line), "%.*s", len, text + offset);
flint_text_draw(line, x + pad_x, draw_y, font, style.text);
draw_y += line_h;
offset += len;
}
return 0;
field_h = flint_ui_readonly_text_box_height(text, font, w, style, 0);
clicked = flint_ui_readonly_text_box((FlintUIReadonlyTextBox){
.bounds = {(float)x, (float)*y, (float)w, (float)field_h},
.text = text,
.font = font,
.style = style
});
*y += field_h;
return clicked;
}
static void
settings_compact_public_id(const char *public_id, char *out, size_t out_size)
{
size_t len;
if(out == NULL || out_size == 0)
return;
out[0] = '\0';
if(public_id == NULL)
return;
len = strlen(public_id);
if(len <= 12) {
snprintf(out, out_size, "%s", public_id);
return;
}
snprintf(out, out_size, "%.*s...%.*s", 4, public_id, 4, public_id + len - 4);
}
static void
@@ -151,6 +110,56 @@ settings_sync_url_filter(int codepoint, void *user_data)
return codepoint >= 33 && codepoint <= 126 && !isspace(codepoint);
}
static int
settings_sync_alias_filter(int codepoint, void *user_data)
{
(void)user_data;
return (codepoint >= 'a' && codepoint <= 'z') ||
(codepoint >= 'A' && codepoint <= 'Z') ||
(codepoint >= '0' && codepoint <= '9') ||
codepoint == '_';
}
static void
settings_sync_alias_normalize(char *text)
{
char out[40];
int n = 0;
if(text == NULL)
return;
for(int i = 0; text[i] != '\0' && n < (int)sizeof(out) - 1; i++) {
unsigned char ch = (unsigned char)text[i];
if(ch == '@' && n == 0)
continue;
if(ch >= 'A' && ch <= 'Z')
ch = (unsigned char)(ch - 'A' + 'a');
if((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_')
out[n++] = (char)ch;
}
out[n] = '\0';
snprintf(text, 40, "%s", out);
}
static int
settings_sync_alias_valid(const char *text)
{
size_t len;
if(text == NULL)
return 0;
len = strlen(text);
if(len < 4 || len > 32)
return 0;
for(size_t i = 0; i < len; i++) {
char ch = text[i];
if((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_')
continue;
return 0;
}
return 1;
}
static int
settings_sync_server_normalize(InbeApp *app, char *out, size_t out_size)
{
@@ -178,6 +187,41 @@ settings_sync_server_save(InbeApp *app)
settings_screen_set_status_success(locale_get("sync_server_saved"), url);
}
static void
settings_sync_open_alias_modal(InbeApp *app, int then_backup)
{
const char *alias;
if(app == NULL)
return;
alias = storage_get_setting_text(INBE_SYNC_ACCOUNT_ALIAS_KEY);
snprintf(app->sync_alias_input, sizeof(app->sync_alias_input), "%s",
alias != NULL ? alias : "");
settings_sync_alias_normalize(app->sync_alias_input);
app->sync_alias_cursor = (int)strlen(app->sync_alias_input);
app->sync_alias_focused = 1;
app->sync_alias_then_backup = then_backup;
app_open_modal(app, UIModalSyncAlias);
}
static void
settings_sync_draw_account_id(InbeApp *app, const InbeSyncAccount *account,
int x, int w, int *y, int small_font,
FlintUITextInputStyle style)
{
const char *alias = storage_get_setting_text(INBE_SYNC_ACCOUNT_ALIAS_KEY);
char display[96];
if(account == NULL)
return;
if(alias != NULL && alias[0] != '\0')
snprintf(display, sizeof(display), "@%s", alias);
else
settings_compact_public_id(account->public_id, display, sizeof(display));
if(settings_draw_public_id_field(display, x, w, y, small_font, style) && app != NULL)
app_open_modal(app, UIModalSyncPublicId);
}
static int
settings_sync_server_connected(InbeApp *app)
{
@@ -232,8 +276,16 @@ settings_sync_run_connect(InbeApp *app)
storage_set_setting_text(INBE_SYNC_SERVER_URL_KEY, url);
result = sync_client_sync(url);
if(result == INBE_SYNC_CLIENT_OK) {
app_reload_after_import(app, 0);
settings_screen_set_status_success(locale_get(settings_sync_result_key(result)), NULL);
if(storage_sync_review_clear_if_no_visible_diff()) {
app_reload_after_import(app, 0);
settings_screen_set_status_success(locale_get(settings_sync_result_key(result)), NULL);
} else if(storage_sync_review_pending()) {
app_open_modal(app, UIModalSyncReview);
settings_screen_set_status_error("Sync needs review");
} else {
app_reload_after_import(app, 0);
settings_screen_set_status_success(locale_get(settings_sync_result_key(result)), NULL);
}
} else {
settings_screen_set_status_error(locale_get(settings_sync_result_key(result)));
}
@@ -314,9 +366,7 @@ settings_sync_account_draw(InbeApp *app, int x, int w, int *y)
UI_BUTTON_STYLE_PRIMARY, 0, &hover)) {
if(sync_account_create(&account)) {
settings_screen_set_status_success(locale_get("sync_account_created"), NULL);
app->modal.active = 1;
app->modal.type = UIModalSyncAccountBackup;
app->modal.selected_button = 0;
settings_sync_open_alias_modal(app, 1);
} else {
settings_screen_set_status_error(locale_get("sync_account_create_failed"));
}
@@ -328,13 +378,14 @@ settings_sync_account_draw(InbeApp *app, int x, int w, int *y)
flint_text_draw(locale_get("sync_public_id_label"), x, *y, small_font,
flint_darken(flint_theme_get_text(), 30));
*y += flint_px(18);
settings_draw_public_id_field(account.public_id, x, w, y, small_font,
settings_sync_draw_account_id(app, &account, x, w, y, small_font,
settings_sync_text_style());
*y += flint_px(4);
{
FlintUIButtonRowItem buttons[2] = {
FlintUIButtonRowItem buttons[3] = {
{locale_get("sync_copy_id_button"), UI_BUTTON_STYLE_SECONDARY, 0},
{locale_get("sync_alias_button"), UI_BUTTON_STYLE_SECONDARY, 0},
{locale_get("sync_backup_key_button"), UI_BUTTON_STYLE_PRIMARY, 0}
};
int clicked = ui_draw_button_row((FlintUIButtonRow){
@@ -344,16 +395,16 @@ settings_sync_account_draw(InbeApp *app, int x, int w, int *y)
.height = btn_h,
.gap = gap,
.items = buttons,
.count = 2
.count = 3
});
if(clicked == 0) {
SetClipboardText(account.public_id);
settings_screen_set_status_success(locale_get("sync_public_id_copied"), NULL);
} else if(clicked == 1) {
app->modal.active = 1;
app->modal.type = UIModalSyncAccountBackup;
app->modal.selected_button = 0;
settings_sync_open_alias_modal(app, 0);
} else if(clicked == 2) {
app_open_modal(app, UIModalSyncAccountBackup);
}
}
*y += btn_h + flint_px(16);
@@ -400,9 +451,7 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
if(sync_account_create(&account)) {
has_account = 1;
settings_screen_set_status_success(locale_get("sync_account_created"), NULL);
app->modal.active = 1;
app->modal.type = UIModalSyncAccountBackup;
app->modal.selected_button = 0;
settings_sync_open_alias_modal(app, 1);
} else {
settings_screen_set_status_error(locale_get("sync_account_create_failed"));
}
@@ -422,7 +471,7 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
flint_text_draw(locale_get("sync_public_id_label"), x, *y, small_font,
flint_darken(flint_theme_get_text(), 30));
*y += flint_px(18);
settings_draw_public_id_field(account.public_id, x, w, y, small_font, input_style);
settings_sync_draw_account_id(app, &account, x, w, y, small_font, input_style);
*y += flint_px(8);
flint_text_draw(locale_get("sync_remote_label"), x, *y, small_font,
@@ -453,8 +502,9 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
*y += btn_h + flint_px(12);
{
FlintUIButtonRowItem buttons[2] = {
FlintUIButtonRowItem buttons[3] = {
{locale_get("sync_copy_id_button"), UI_BUTTON_STYLE_SECONDARY, 0},
{locale_get("sync_alias_button"), UI_BUTTON_STYLE_SECONDARY, 0},
{locale_get("sync_backup_key_button"), UI_BUTTON_STYLE_SECONDARY, 0}
};
int clicked = ui_draw_button_row((FlintUIButtonRow){
@@ -464,16 +514,16 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
.height = btn_h,
.gap = gap,
.items = buttons,
.count = 2
.count = 3
});
if(clicked == 0) {
SetClipboardText(account.public_id);
settings_screen_set_status_success(locale_get("sync_public_id_copied"), NULL);
} else if(clicked == 1) {
app->modal.active = 1;
app->modal.type = UIModalSyncAccountBackup;
app->modal.selected_button = 0;
settings_sync_open_alias_modal(app, 0);
} else if(clicked == 2) {
app_open_modal(app, UIModalSyncAccountBackup);
}
}
*y += btn_h + flint_px(12);
@@ -495,9 +545,7 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
if(clicked == 0) {
settings_sync_account_logout(app);
} else if(clicked == 1) {
app->modal.active = 1;
app->modal.type = UIModalConfirmDeleteSyncAccount;
app->modal.selected_button = 0;
app_open_modal(app, UIModalConfirmDeleteSyncAccount);
}
}
*y += btn_h + flint_px(12);
@@ -553,3 +601,165 @@ settings_sync_account_draw_backup_modal(InbeApp *app)
return 1;
return 0;
}
int
settings_sync_account_draw_alias_modal(InbeApp *app)
{
FlintUIPanelFrame frame;
FlintUITextInputStyle input_style = settings_sync_text_style();
int btn_h = flint_px(36);
int gap = flint_px(10);
int y;
int at_w;
int commit = 0;
int result = 0;
char url[256];
char current_alias[40];
const char *stored_alias;
int has_alias;
int unchanged_alias;
if(app == NULL)
return 3;
stored_alias = storage_get_setting_text(INBE_SYNC_ACCOUNT_ALIAS_KEY);
snprintf(current_alias, sizeof(current_alias), "%s", stored_alias != NULL ? stored_alias : "");
settings_sync_alias_normalize(current_alias);
has_alias = current_alias[0] != '\0';
frame = ui_draw_modal_frame(flint_px(336), flint_px(238),
locale_get(has_alias ? "sync_alias_change_title" : "sync_alias_title"),
(Texture2D){0}, (Texture2D){0});
y = frame.content_y;
flint_text_draw(locale_get(has_alias ? "sync_alias_change_message" : "sync_alias_message"),
frame.content_x, y,
flint_ui_font_small(), flint_darken(flint_theme_get_text(), 20));
y += flint_px(40);
at_w = flint_text_measure("@", flint_ui_font()) + flint_px(12);
flint_text_draw("@", frame.content_x, flint_ui_text_y("@", y, btn_h, flint_ui_font()),
flint_ui_font(), flint_theme_get_text());
flint_ui_text_field((FlintUITextField){
.bounds = {(float)(frame.content_x + at_w), (float)y,
(float)(frame.content_w - at_w), (float)btn_h},
.text = app->sync_alias_input,
.text_size = sizeof(app->sync_alias_input),
.cursor_position = &app->sync_alias_cursor,
.focused = &app->sync_alias_focused,
.max_codepoints = 32,
.font = flint_ui_font_small(),
.style = input_style,
.filter = settings_sync_alias_filter,
.commit_pressed = &commit
});
settings_sync_alias_normalize(app->sync_alias_input);
y += btn_h + flint_px(12);
flint_text_draw(locale_get("sync_alias_rule"), frame.content_x, y,
flint_ui_font_small(), flint_darken(flint_theme_get_text(), 35));
y += flint_px(34);
unchanged_alias = has_alias && strcmp(app->sync_alias_input, current_alias) == 0;
{
FlintUIButtonRowItem buttons[2] = {
{locale_get(app->sync_alias_then_backup ? "skip_button" : "close_button"),
UI_BUTTON_STYLE_SECONDARY, 0},
{locale_get(has_alias ? "sync_alias_save_button" : "sync_alias_register_button"),
UI_BUTTON_STYLE_PRIMARY,
!settings_sync_alias_valid(app->sync_alias_input) || unchanged_alias}
};
int clicked = ui_draw_button_row((FlintUIButtonRow){
.x = frame.content_x,
.y = y,
.width = frame.content_w,
.height = btn_h,
.gap = gap,
.items = buttons,
.count = 2
});
if(clicked == 0)
return 3;
if(clicked == 1 || (commit && settings_sync_alias_valid(app->sync_alias_input) && !unchanged_alias)) {
if(settings_sync_server_normalize(app, url, sizeof(url))) {
InbeSyncClientResult alias_result;
TraceLog(LOG_INFO, "SYNC: saving alias @%s with %s",
app->sync_alias_input, url);
alias_result = sync_client_register_alias(url, app->sync_alias_input);
if(alias_result == INBE_SYNC_CLIENT_OK) {
TraceLog(LOG_INFO, "SYNC: alias saved @%s", app->sync_alias_input);
result = 1;
} else {
TraceLog(LOG_WARNING, "SYNC: alias register failed result=%d alias=@%s",
(int)alias_result, app->sync_alias_input);
result = 2;
}
} else {
TraceLog(LOG_WARNING, "SYNC: alias register failed invalid server url");
result = 2;
}
}
}
return result;
}
int
settings_sync_account_draw_public_id_modal(InbeApp *app)
{
FlintUIPanelFrame frame;
InbeSyncAccount account;
FlintUITextInputStyle input_style = settings_sync_text_style();
int btn_h = flint_px(36);
int gap = flint_px(10);
int y;
int hover = 0;
int result = 0;
(void)app;
memset(&account, 0, sizeof(account));
if(!sync_account_load(&account))
return 1;
frame = ui_draw_modal_frame(flint_px(356), flint_px(274),
locale_get("sync_public_id_full_title"),
(Texture2D){0}, (Texture2D){0});
y = frame.content_y;
flint_text_draw(locale_get("sync_public_id_full_message"), frame.content_x, y,
flint_ui_font_small(), flint_darken(flint_theme_get_text(), 25));
y += flint_px(34);
settings_draw_public_id_field(account.public_id, frame.content_x, frame.content_w,
&y, flint_ui_font_small(), input_style);
y += flint_px(18);
{
FlintUIButtonRowItem buttons[2] = {
{locale_get("sync_copy_id_button"), UI_BUTTON_STYLE_PRIMARY, 0},
{locale_get("close_button"), UI_BUTTON_STYLE_SECONDARY, 0}
};
int clicked = ui_draw_button_row((FlintUIButtonRow){
.x = frame.content_x,
.y = y,
.width = frame.content_w,
.height = btn_h,
.gap = gap,
.items = buttons,
.count = 2
});
if(clicked == 0) {
SetClipboardText(account.public_id);
settings_screen_set_status_success(locale_get("sync_public_id_copied"), NULL);
} else if(clicked == 1) {
result = 1;
}
}
if(ui_draw_generic_button(frame.content_x, frame.y + frame.h - btn_h - flint_px(18),
frame.content_w, btn_h,
locale_get("sync_alias_button"), UI_BUTTON_STYLE_SECONDARY,
0, &hover)) {
app_close_modal(app);
settings_sync_open_alias_modal(app, 0);
}
return result;
}
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more