15 Commits

Author SHA1 Message Date
bc070aae8b Merge pull request 'feat. Timer Done Alert (Issue #3)' (#4) from dev-issue-3 into main
All checks were successful
Build App / build-android (push) Successful in 7m17s
Build App / build-web (push) Successful in 30s
Build App / release (push) Successful in 11s
2026-03-30 20:50:56 +02:00
Space-Banane
39e494a69a ci: remove pr workflow
All checks were successful
Dev Branch Check / validate (push) Successful in 35s
2026-03-30 20:48:50 +02:00
Space-Banane
4cf5b6041d ci: add dev branch workflow
All checks were successful
Dev Branch Check / validate (push) Successful in 29s
Pull Request Check / validate (pull_request) Successful in 23s
2026-03-30 20:46:29 +02:00
172d061e15 ci: add manual workflow to build APK as artifact
All checks were successful
Pull Request Check / validate (pull_request) Successful in 30s
2026-03-30 20:40:27 +02:00
2e8f4ff29a feat: replace alarm with the proppa one provided by Space
All checks were successful
Pull Request Check / validate (pull_request) Successful in 35s
2026-03-30 20:38:41 +02:00
b01f3d2dab feat: use local alert sound instead of broken URL
All checks were successful
Pull Request Check / validate (pull_request) Successful in 23s
2026-03-30 20:36:30 +02:00
0640144e6b feat: add alert sound for timer and time-until done
All checks were successful
Pull Request Check / validate (pull_request) Successful in 28s
2026-03-30 20:35:12 +02:00
Space-Banane
5f2c63ac05 add pull request check workflow
All checks were successful
Pull Request Check / validate (pull_request) Successful in 24s
Build App / build-android (push) Successful in 8m27s
Build App / build-web (push) Successful in 30s
Build App / release (push) Successful in 22s
2026-03-11 22:04:20 +01:00
root
2d5677cd0f add dismiss button to minion feature 2026-03-11 22:01:00 +01:00
root
53d7e0dcb7 revert changes to ci.yml 2026-03-11 21:59:56 +01:00
root
898bb59149 clean up ci triggers
Some checks failed
Build App / build-web (pull_request) Has been cancelled
Build App / release (pull_request) Has been cancelled
Build App / build-android (pull_request) Has been cancelled
2026-03-11 21:59:16 +01:00
root
7308635cee restore original CI workflow and update triggers
Some checks failed
Build App / build-web (push) Has been cancelled
Build App / release (push) Has been cancelled
Build App / build-android (push) Has been cancelled
Build App / build-web (pull_request) Has been cancelled
Build App / release (pull_request) Has been cancelled
Build App / build-android (pull_request) Has been cancelled
2026-03-11 21:58:35 +01:00
root
f8ecc30a69 restore copilot-instructions.md
All checks were successful
CI / build (push) Successful in 11s
CI / build (pull_request) Successful in 11s
2026-03-11 21:53:22 +01:00
root
1d99c729dd move CI workflow to .gitea and remove .github remnants
All checks were successful
CI / build (push) Successful in 14s
CI / build (pull_request) Successful in 11s
2026-03-11 21:52:45 +01:00
root
bb543182b7 feat: show minion on shake (android/ios) and fix CI workflow 2026-03-11 21:51:35 +01:00
6 changed files with 173 additions and 10 deletions

28
.gitea/workflows/dev.yml Normal file
View File

@@ -0,0 +1,28 @@
name: Dev Branch Check
on:
push:
branches-ignore:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 22
- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: 📦 Install dependencies
run: pnpm install
- name: 🧪 Check for linting/type errors
run: npx expo export --platform web

View File

@@ -0,0 +1,57 @@
name: Manual APK Build
on:
workflow_dispatch:
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 22
- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: 🏗 Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: 🏗 Setup Android SDK
uses: android-actions/setup-android@v3
- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
token: ${{ secrets.EXPO_TOKEN }}
eas-version: latest
packager: pnpm
- name: 📦 Install dependencies
run: pnpm install
- name: 👷 Build app
run: |
eas build --local \
--non-interactive \
--output=./app-build \
--platform=android \
--profile=preview
- name: 📝 Rename build to APK
run: mv app-build time-until-manual.apk
- name: 📤 Upload build artifact
uses: actions/upload-artifact@v3
with:
name: manual-apk-build
path: time-until-manual.apk
if-no-files-found: error

55
App.js
View File

@@ -1,7 +1,9 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { BackHandler, Platform, StatusBar } from 'react-native';
import { BackHandler, Platform, StatusBar, Modal, View, Image, StyleSheet, Button } from 'react-native';
import * as ScreenOrientation from 'expo-screen-orientation';
import * as SplashScreen from 'expo-splash-screen';
import { Accelerometer } from 'expo-sensors';
import { Audio } from 'expo-av';
import FocusScreen from './src/screens/FocusScreen';
import HomeScreen from './src/screens/HomeScreen';
import TimeUntilScreen from './src/screens/TimeUntilScreen';
@@ -23,6 +25,8 @@ export default function App() {
const [pinkMode, setPinkMode] = useState(false);
const [isFullscreen, setIsFullscreen] = useState(false);
const [now, setNow] = useState(new Date());
const [showMinion, setShowMinion] = useState(false);
const [targetTime, setTargetTime] = useState(null);
const [tuHour, setTuHour] = useState('');
@@ -50,6 +54,20 @@ export default function App() {
}
}, []);
useEffect(() => {
if (Platform.OS === 'android' || Platform.OS === 'ios') {
Accelerometer.setUpdateInterval(500);
const subscription = Accelerometer.addListener(({ x, y, z }) => {
const acceleration = Math.sqrt(x * x + y * y + z * z);
if (acceleration > 2.5) {
setShowMinion(true);
setTimeout(() => setShowMinion(false), 3000);
}
});
return () => subscription.remove();
}
}, []);
useEffect(() => {
const interval = setInterval(() => setNow(new Date()), 1000);
return () => clearInterval(interval);
@@ -177,6 +195,29 @@ export default function App() {
const timerSec = timerRemaining % 60;
const tuCountdown = getTuCountdown();
const playSound = async () => {
try {
const { sound } = await Audio.Sound.createAsync(
require('./assets/alert.mp3'),
{ shouldPlay: true, volume: 1.0 }
);
sound.setOnPlaybackStatusUpdate((status) => {
if (status.didJustFinish) {
sound.unloadAsync();
}
});
} catch (error) {
console.log('Error playing sound:', error);
}
};
useEffect(() => {
if (timerDone || tuIsOver) {
playSound();
}
}, [timerDone, tuIsOver]);
if (focusMode) {
return (
<FocusScreen
@@ -251,6 +292,18 @@ export default function App() {
return (
<>
<Modal visible={showMinion} transparent={true} animationType="fade">
<View style={StyleSheet.absoluteFill}>
<Image
source={{ uri: 'https://shx.reversed.dev/u/XHuDcA.jpg' }}
style={{ flex: 1 }}
resizeMode="contain"
/>
<View style={{ position: 'absolute', top: 50, right: 20 }}>
<Button title="Dismiss" onPress={() => setShowMinion(false)} />
</View>
</View>
</Modal>
<StatusBar barStyle={barStyle} backgroundColor={theme.bg} />
<TimerScreen
styles={styles}

BIN
assets/alert.mp3 Normal file

Binary file not shown.

41
package-lock.json generated
View File

@@ -9,7 +9,9 @@
"version": "1.0.0",
"dependencies": {
"expo": "~54.0.33",
"expo-av": "^16.0.8",
"expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
@@ -55,7 +57,6 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -3822,7 +3823,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -4430,7 +4430,6 @@
"resolved": "https://registry.npmjs.org/expo/-/expo-54.0.33.tgz",
"integrity": "sha512-3yOEfAKqo+gqHcV8vKcnq0uA5zxlohnhA3fu4G43likN8ct5ZZ3LjAh9wDdKteEkoad3tFPvwxmXW711S5OHUw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/runtime": "^7.20.0",
"@expo/cli": "54.0.23",
@@ -4478,6 +4477,23 @@
}
}
},
"node_modules/expo-av": {
"version": "16.0.8",
"resolved": "https://registry.npmjs.org/expo-av/-/expo-av-16.0.8.tgz",
"integrity": "sha512-cmVPftGR/ca7XBgs7R6ky36lF3OC0/MM/lpgX/yXqfv0jASTsh7AYX9JxHCwFmF+Z6JEB1vne9FDx4GiLcGreQ==",
"license": "MIT",
"peerDependencies": {
"expo": "*",
"react": "*",
"react-native": "*",
"react-native-web": "*"
},
"peerDependenciesMeta": {
"react-native-web": {
"optional": true
}
}
},
"node_modules/expo-modules-autolinking": {
"version": "3.0.24",
"resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-3.0.24.tgz",
@@ -4587,6 +4603,19 @@
"react-native": "*"
}
},
"node_modules/expo-sensors": {
"version": "55.0.8",
"resolved": "https://registry.npmjs.org/expo-sensors/-/expo-sensors-55.0.8.tgz",
"integrity": "sha512-aYDw/IBqJtWQgCIJh12oyj5N4ldT88Aa0V/Vag88xG8K2hOQuM2SLGeNlxGRFRtgLJ4m7pzXhQW7CJRj6p1uHQ==",
"license": "MIT",
"dependencies": {
"invariant": "^2.2.4"
},
"peerDependencies": {
"expo": "*",
"react-native": "*"
}
},
"node_modules/expo-server": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/expo-server/-/expo-server-1.0.5.tgz",
@@ -4942,7 +4971,6 @@
"resolved": "https://registry.npmjs.org/expo-font/-/expo-font-14.0.11.tgz",
"integrity": "sha512-ga0q61ny4s/kr4k8JX9hVH69exVSIfcIc19+qZ7gt71Mqtm7xy2c6kwsPTCyhBW2Ro5yXTT8EaZOpuRi35rHbg==",
"license": "MIT",
"peer": true,
"dependencies": {
"fontfaceobserver": "^2.1.0"
},
@@ -7492,7 +7520,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz",
"integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -7512,7 +7539,6 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz",
"integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==",
"license": "MIT",
"peer": true,
"dependencies": {
"scheduler": "^0.26.0"
},
@@ -7531,7 +7557,6 @@
"resolved": "https://registry.npmjs.org/react-native/-/react-native-0.81.5.tgz",
"integrity": "sha512-1w+/oSjEXZjMqsIvmkCRsOc8UBYv163bTWKTI8+1mxztvQPhCRYGTvZ/PL1w16xXHneIj/SLGfxWg2GWN2uexw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@jest/create-cache-key-function": "^29.7.0",
"@react-native/assets-registry": "0.81.5",
@@ -7715,7 +7740,6 @@
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz",
"integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -8593,7 +8617,6 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},

View File

@@ -10,7 +10,9 @@
},
"dependencies": {
"expo": "~54.0.33",
"expo-av": "^16.0.8",
"expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",