Compare commits
10 Commits
build-51c5
...
5f2c63ac05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2c63ac05 | ||
|
|
2d5677cd0f | ||
|
|
53d7e0dcb7 | ||
|
|
898bb59149 | ||
|
|
7308635cee | ||
|
|
f8ecc30a69 | ||
|
|
1d99c729dd | ||
|
|
bb543182b7 | ||
| 5393910b4c | |||
|
|
f67bcdaddf |
28
.gitea/workflows/pr.yml
Normal file
28
.gitea/workflows/pr.yml
Normal 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
31
App.js
@@ -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';
|
||||||
@@ -23,6 +24,8 @@ export default function App() {
|
|||||||
const [pinkMode, setPinkMode] = useState(false);
|
const [pinkMode, setPinkMode] = useState(false);
|
||||||
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('');
|
||||||
@@ -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}
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -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
16
package-lock.json
generated
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user