Compare commits
8 Commits
5393910b4c
...
5f2c63ac05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2c63ac05 | ||
|
|
2d5677cd0f | ||
|
|
53d7e0dcb7 | ||
|
|
898bb59149 | ||
|
|
7308635cee | ||
|
|
f8ecc30a69 | ||
|
|
1d99c729dd | ||
|
|
bb543182b7 |
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 { 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 FocusScreen from './src/screens/FocusScreen';
|
||||
import HomeScreen from './src/screens/HomeScreen';
|
||||
import TimeUntilScreen from './src/screens/TimeUntilScreen';
|
||||
@@ -24,6 +25,8 @@ export default function App() {
|
||||
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('');
|
||||
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(() => {
|
||||
const interval = setInterval(() => setNow(new Date()), 1000);
|
||||
return () => clearInterval(interval);
|
||||
@@ -251,6 +268,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}
|
||||
|
||||
16
package-lock.json
generated
16
package-lock.json
generated
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"expo": "~54.0.33",
|
||||
"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",
|
||||
@@ -1410,6 +1411,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
|
||||
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
@@ -4587,6 +4589,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",
|
||||
@@ -7492,7 +7507,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"
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"expo": "~54.0.33",
|
||||
"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",
|
||||
|
||||
Reference in New Issue
Block a user