10 Commits

Author SHA1 Message Date
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
5393910b4c Merge pull request 'docs: add development instructions to README' (#1) from update-readme into main
All checks were successful
Build App / build-android (push) Successful in 6m17s
Build App / build-web (push) Successful in 36s
Build App / release (push) Successful in 1m36s
Reviewed-on: #1
2026-03-11 20:20:26 +01:00
root
f67bcdaddf docs: add development instructions to README 2026-03-11 20:16:25 +01:00
5 changed files with 86 additions and 2 deletions

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

@@ -0,0 +1,28 @@
name: Pull Request Check
on:
pull_request:
branches:
- 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

31
App.js
View File

@@ -1,7 +1,8 @@
import React, { useEffect, useMemo, useRef, useState } from 'react'; 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 ScreenOrientation from 'expo-screen-orientation';
import * as SplashScreen from 'expo-splash-screen'; import * as SplashScreen from 'expo-splash-screen';
import { Accelerometer } from 'expo-sensors';
import FocusScreen from './src/screens/FocusScreen'; import FocusScreen from './src/screens/FocusScreen';
import HomeScreen from './src/screens/HomeScreen'; import HomeScreen from './src/screens/HomeScreen';
import TimeUntilScreen from './src/screens/TimeUntilScreen'; import TimeUntilScreen from './src/screens/TimeUntilScreen';
@@ -24,6 +25,8 @@ export default function App() {
const [isFullscreen, setIsFullscreen] = useState(false); const [isFullscreen, setIsFullscreen] = useState(false);
const [now, setNow] = useState(new Date()); const [now, setNow] = useState(new Date());
const [showMinion, setShowMinion] = useState(false);
const [targetTime, setTargetTime] = useState(null); const [targetTime, setTargetTime] = useState(null);
const [tuHour, setTuHour] = useState(''); const [tuHour, setTuHour] = useState('');
const [tuMinute, setTuMinute] = useState(''); const [tuMinute, setTuMinute] = useState('');
@@ -50,6 +53,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(() => { useEffect(() => {
const interval = setInterval(() => setNow(new Date()), 1000); const interval = setInterval(() => setNow(new Date()), 1000);
return () => clearInterval(interval); return () => clearInterval(interval);
@@ -251,6 +268,18 @@ export default function App() {
return ( 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} /> <StatusBar barStyle={barStyle} backgroundColor={theme.bg} />
<TimerScreen <TimerScreen
styles={styles} styles={styles}

View File

@@ -20,6 +20,18 @@ https://gitea.reversed.dev/space/time-until/releases
- Shared UI components are in `src/components`. - Shared UI components are in `src/components`.
- Theme + styling are managed via `src/theme.js` and `src/styles.js`. - Theme + styling are managed via `src/theme.js` and `src/styles.js`.
## Development
1. Install dependencies:
```bash
npm install
```
2. Start the development server:
```bash
npx expo start
```
### Time Until Mode ### Time Until Mode
- Enter hour/minute in 24-hour format. - Enter hour/minute in 24-hour format.

16
package-lock.json generated
View File

@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"expo": "~54.0.33", "expo": "~54.0.33",
"expo-screen-orientation": "~9.0.8", "expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10", "expo-splash-screen": "^55.0.10",
"expo-status-bar": "~3.0.9", "expo-status-bar": "~3.0.9",
"react": "19.1.0", "react": "19.1.0",
@@ -1410,6 +1411,7 @@
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
@@ -4587,6 +4589,19 @@
"react-native": "*" "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": { "node_modules/expo-server": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/expo-server/-/expo-server-1.0.5.tgz", "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-1.0.5.tgz",
@@ -7492,7 +7507,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz",
"integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }

View File

@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"expo": "~54.0.33", "expo": "~54.0.33",
"expo-screen-orientation": "~9.0.8", "expo-screen-orientation": "~9.0.8",
"expo-sensors": "^55.0.8",
"expo-splash-screen": "^55.0.10", "expo-splash-screen": "^55.0.10",
"expo-status-bar": "~3.0.9", "expo-status-bar": "~3.0.9",
"react": "19.1.0", "react": "19.1.0",