Skip to content

Commit e28d654

Browse files
committed
finished proj
1 parent 1be18ce commit e28d654

File tree

6 files changed

+155
-47
lines changed

6 files changed

+155
-47
lines changed

Diff for: README.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
## Features
2-
**random notifications**
3-
random Calls
4-
random alarms
5-
**feature to set random alarms between certain times**
6-
chatbot that gives one word responses
7-
random sounds
1+
# DISTRACT
2+
Complicate your life, procrastinate and get distracted as much as you can. You won't be able to stay away from your phone with this app installed.
3+
Download Here
4+
![Award for the best anti-productivity app](https://hc-cdn.hel1.your-objectstorage.com/s/v3/53e83138c5afd742a5cf7d9458593f5273f2aeb3_a__5_.png)
5+
## ~~Dis~~functionalities
6+
- Sends notifications every minute
7+
- Has entertaining Entertainment interface
8+
- Impressively performant translation interface
9+
- The best Chatbot since ChatGPT
10+
- Random Alarm Setter
11+
## ~~Dis~~advantages
12+
- Dumb
13+
- Irrelevant
14+
- Stupid
15+
- Time-wasting
16+
- Ridiculous
17+
- Absurd
18+
- Chaotic
19+
- Trashy
20+
21+
## Distract - Your annoyance is our joy.
22+
made at![Scrapyard Logo](https://scrapyard.hackclub.com/elements/wordmark.svg) by
23+
[@N1k0s1](https://github.com/N1k0s1), [mattsoh](https://github.com/mattsoh) and [me:)](https://github.com/Cosmin-Mare)

Diff for: app/(tabs)/index.tsx

+14-9
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
99
import Chatbot from './chatbot';
1010
import RandomAlarm from './randomalarm';
1111
import Entertainment from './entertainment';
12+
import Translate from './translate';
1213
import { Video } from 'react-native-video';
1314

1415
export default function HomeScreen() {
1516
const [notificationToken, setNotificationToken] = useState<string | null>(null);
1617
const [username, setUsername] = useState<string>('');
1718
const [showChatbot, setShowChatbot] = useState<boolean>(true);
1819
const [showRandomAlarm, setShowRandomAlarm] = useState<boolean>(false);
19-
const [showentertainment, setShowentertainment] = useState<boolean>(false);
20+
const [showEntertainment, setShowEntertainment] = useState<boolean>(false);
21+
const [showTranslate, setShowTranslate] = useState<boolean>(false);
2022

2123
useEffect(() => {
2224
(async () => {
@@ -60,21 +62,25 @@ export default function HomeScreen() {
6062
return (
6163
<SafeAreaView style={{ flex: 1 }}>
6264
<Button
63-
title={`Switch to Chatbot`}
64-
onPress={() => {setShowChatbot(true)}}
65+
title={`Chatbot`}
66+
onPress={() => {setShowChatbot(true), setShowRandomAlarm(false), setShowEntertainment(false)}}
6567
/>
6668
<Button
67-
title={`Toggle Random Alarm`}
68-
onPress={() => {setShowRandomAlarm(true); setShowChatbot(false)}}
69+
title={`Random Alarm`}
70+
onPress={() => {setShowRandomAlarm(true); setShowChatbot(false), setShowEntertainment(false), setShowTranslate(false)}}
6971
/>
7072
<Button
71-
title={`Toggle Enterntainment`}
72-
onPress={() => {setShowentertainment(true); setShowChatbot(false); setShowRandomAlarm(false)}}
73+
title={`Enterntainment`}
74+
onPress={() => {setShowEntertainment(true); setShowChatbot(false); setShowRandomAlarm(false), setShowTranslate(false)}}
75+
/>
76+
<Button
77+
title={`Translate`}
78+
onPress={() => {setShowEntertainment(false); setShowChatbot(false); setShowRandomAlarm(false), setShowTranslate(true)}}
7379
/>
7480
{showChatbot ? (
7581
<Chatbot />
7682
) : showRandomAlarm ? <RandomAlarm/> :
77-
showentertainment ? <Entertainment /> :
83+
showEntertainment ? <Entertainment /> : showTranslate ? <Translate /> :
7884
(
7985
<ThemedView>
8086
<View>
@@ -85,7 +91,6 @@ export default function HomeScreen() {
8591
onChangeText={setUsername}
8692
/>
8793
<Button title="Save Username" onPress={saveUsername} />
88-
<Text style={{ color: "white" }}>{notificationToken}</Text>
8994
</View>
9095
</ThemedView>
9196
)}

Diff for: app/(tabs)/randomalarm.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,28 @@ const RandomAlarmSetter = () => {
5959

6060
await Calendar.createEventAsync(defaultCalendar.id, eventDetails);
6161

62-
Alert.alert('Success', `Alarm set for ${randomTime.toLocaleTimeString()}`);
62+
Alert.alert('Success', `ICBM Inbound`);
6363
};
6464

6565
return (
6666
<View style={styles.container}>
67-
<Text style={styles.label}>Enter Start Time (HH:mm):</Text>
67+
<Text style={[styles.label, { color: 'grey' }]}>input 2 different times, and a random alarm will sound sometime in the timeframe.</Text>
68+
<Text style={styles.label}>enter start time (hh:mm)</Text>
6869
<TextInput
6970
style={styles.input}
7071
placeholder="18:00"
7172
value={startTime}
7273
onChangeText={setStartTime}
74+
placeholderTextColor="grey"
7375
/>
7476

75-
<Text style={styles.label}>Enter End Time (HH:mm):</Text>
77+
<Text style={styles.label}>enter end time (hh:mm)</Text>
7678
<TextInput
7779
style={styles.input}
7880
placeholder="20:00"
7981
value={endTime}
8082
onChangeText={setEndTime}
83+
placeholderTextColor="grey"
8184
/>
8285

8386
<Button title="Set Random Alarm" onPress={setRandomAlarm} />

Diff for: app/(tabs)/translate.tsx

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import React, { useState } from "react";
2+
import { View, TextInput, Text, StyleSheet } from "react-native";
3+
const styles = StyleSheet.create({
4+
container: { flex: 1, padding: 20, justifyContent: "center" },
5+
text: {
6+
borderWidth: 1,
7+
padding: 10,
8+
marginBottom: 10,
9+
borderRadius: 5,
10+
backgroundColor: "#f0f0f0",
11+
},
12+
13+
picker: { height: 50, marginBottom: 10 },
14+
});
15+
16+
export default function Translate(){
17+
const [inputText,setInputText] = useState("");
18+
const [translatedText, setTranslatedText] = useState("");
19+
const [fromLang, setFromLang] = useState("English");
20+
const [toLang, setToLang] = useState("Chinese");
21+
22+
23+
const languages = [
24+
"English", "Spanish", "Chinese"
25+
];
26+
27+
28+
return (
29+
<View style={styles.container}>
30+
{/* <Picker
31+
selectedValue={fromLang}
32+
onValueChange={(itemValue) => setFromLang(itemValue)}
33+
style={styles.picker}
34+
>
35+
{languages.map(lang => (
36+
<Picker.Item key={lang} label={lang} value={lang} />
37+
))}
38+
</Picker> */}
39+
40+
<TextInput
41+
style={styles.text}
42+
placeholder="Enter text"
43+
keyboardType="numeric"
44+
value={inputText}
45+
onChangeText={(text) => {
46+
setInputText(text);
47+
setTranslatedText(text);
48+
}}
49+
/>
50+
51+
{/* <Picker
52+
selectedValue={toLang}
53+
onValueChange={(itemValue) => setToLang(itemValue)}
54+
style={styles.picker}
55+
>
56+
{languages.map(lang => (
57+
<Picker.Item key={lang} label={lang} value={lang} />
58+
))}
59+
</Picker> */}
60+
61+
<TextInput
62+
style={styles.text}
63+
keyboardType="numeric"
64+
placeholder="Translation"
65+
value={translatedText}
66+
editable={false}
67+
/>
68+
</View>
69+
);
70+
};

Diff for: package-lock.json

+41-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@notifee/react-native": "^9.1.8",
2020
"@react-native-async-storage/async-storage": "1.23.1",
2121
"@react-native-community/datetimepicker": "^8.3.0",
22+
"@react-native-picker/picker": "^2.11.0",
2223
"@react-navigation/bottom-tabs": "^7.2.0",
2324
"@react-navigation/native": "^7.0.14",
2425
"expo": "~52.0.33",

0 commit comments

Comments
 (0)