Skip to content

Commit

Permalink
Merge pull request #1 from garvsl/garv-branch
Browse files Browse the repository at this point in the history
UI Changes
  • Loading branch information
garvsl authored Jan 3, 2024
2 parents a90232e + 22b2104 commit 426a4ae
Show file tree
Hide file tree
Showing 45 changed files with 28,327 additions and 2,680 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ ml/openAIKey.json

# macOS
.DS_Store
env.json

yarn-error.log
2 changes: 1 addition & 1 deletion .tamagui/tamagui.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20659,7 +20659,7 @@
"pointer": "coarse"
}
},
"defaultTheme": "dark",
"defaultTheme": "light",
"shouldAddPrefersColorThemes": false,
"themeClassNameOnRoot": false,
"shorthands": {
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"[typescript]": {
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Expand All @@ -13,7 +14,7 @@
<data android:scheme="https"/>
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme">
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:requestLegacyExternalStorage="true">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="49.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
Expand Down
Binary file modified android/app/src/main/res/drawable-hdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-mdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scheme": "fitGoat",
"userInterfaceStyle": "automatic",
"splash": {
"backgroundColor": "#ffffff",
"backgroundColor": "#FFFCED",
"image": "./assets/splash.png",
"resizeMode": "contain"
},
Expand Down
7 changes: 3 additions & 4 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useFonts } from "expo-font";
import { SplashScreen, Stack } from "expo-router";
import { TamaguiProvider, Text, Theme } from "tamagui";

import HeaderBar from "../components/HeaderBar";
import { MySafeAreaView } from "../components/MySafeAreaView";
import config from "../tamagui.config";

Expand All @@ -33,10 +34,8 @@ export default function Layout() {
return (
<TamaguiProvider config={config}>
<Suspense fallback={<Text>Loading...</Text>}>
<Theme name={colorScheme}>
<ThemeProvider
value={colorScheme === "light" ? DefaultTheme : DarkTheme}
>
<Theme name={"light"}>
<ThemeProvider value={DefaultTheme}>
{/* <MySafeAreaView> */}
<Stack
screenOptions={{
Expand Down
18 changes: 18 additions & 0 deletions app/hooks/metrics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useWindowDimensions } from "react-native";

const guidelineBaseWidth = 375;
const guidelineBaseHeight = 812;

export function HorizontalScale(size: number) {
const { width } = useWindowDimensions();
return (width / guidelineBaseWidth) * size;
}

export function VerticalScale(size: number) {
const { height } = useWindowDimensions();
return (height / guidelineBaseHeight) * size;
}

export function ModerateScale(size: number, factor = 0.5) {
return size + (HorizontalScale(size) - size) * factor;
}
72 changes: 43 additions & 29 deletions app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
import { Github, Twitter } from "@tamagui/lucide-icons";
import { Link, useRouter } from "expo-router";
import {
Button,
H1,
Image,
ListItem,
Paragraph,
Separator,
Square,
Text,
YGroup,
YStack
} from "tamagui";
import { ArrowRight } from "@tamagui/lucide-icons";
import { useRouter } from "expo-router";
import { Button, Image, Square, Text } from "tamagui";

import { MyStack } from "../components/MyStack";

import { ModerateScale, VerticalScale } from "./hooks/metrics";

export default function Home() {
const router = useRouter();

return (
<MyStack
justifyContent="center"
alignItems="center"
backgroundColor={"#FFFFFF"}
padding={0}
>
<Image
top={-50}
// marginTop={"15%"}
height={"100%"}
width={"110%"}
position="absolute"
source={require("../assets/goatbg.jpg")}
// alignSelf="center"
// scale={0.9}
// position="absolute"
width={"100%"}
resizeMode="contain"
// height={"100%"}
source={{
uri: require("../assets/OPEN_HEALTH.png"),
width: 400,
height: 600
}}
/>
<Square
size={400}
bottom={-450}
backgroundColor={"white"}
// margin={40}
paddingLeft={"$4"}
paddingRight={"$4"}
width={"100%"}
position="absolute"
bottom={"2.5%"}
justifyContent="flex-start"
alignItems="flex-start"
padding={"$5"}
paddingTop={"$5"}
paddingBottom={"$5"}
>
<Text
fontSize={20}
fontSize={ModerateScale(22)}
fontWeight="bold"
color={"black"}
>
Get started with FitGoat
Get started with OpenHealth
</Text>
<Button
width={"100%"}
marginTop={16}
theme="green"
color={"black"}
height={VerticalScale(55)}
marginTop={12}
borderColor={"black"}
backgroundColor={"white"}
fontWeight="bold"
onPress={() => router.push("/tabs")}
theme="red"
iconAfter={<ArrowRight size={ModerateScale(14)} />}
onPress={() => router.replace("/tabs")}
>
{"Continue ->"}
<Text
fontWeight={"bold"}
fontSize={ModerateScale(14)}
>
Continue
</Text>
</Button>
</Square>

Expand Down
109 changes: 109 additions & 0 deletions app/responses/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React, { useEffect, useState } from "react";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { ArrowLeft } from "@tamagui/lucide-icons";
import { useRouter } from "expo-router";
import OpenAI from "openai";
import { H5, Input, ScrollView, Tabs, Text, TextArea } from "tamagui";
import {
Button,
Card,
CardProps,
H2,
H3,
H4,
Image,
Paragraph,
XStack
} from "tamagui";

import { MySafeAreaView } from "../../components/MySafeAreaView";
import { MyStack } from "../../components/MyStack";

export default function Tab01() {
const [text, setText] = useState<any>(null);
const [quest, setQuest] = useState("");

const openai = new OpenAI({
apiKey: "oWM6XJqMEoEtLVw1NfQkT3BlbkFJcgBEx2MQiEf4urw9O3Rd"
});

const arnoldDemo = async () => {
try {
// const response: any = await openai.chat.completions.create({
// model: "gpt-4",
// messages: [
// {
// role: "system",
// content:
// 'You channel the spirit and teachings of Arnold Schwarzenegger, the iconic bodybuilder, actor, and former Governor of California. Your principles are built upon the foundation of discipline, visualization, and relentless pursuit of goals.\\n\\nYour tone is confident, motivational, and occasionally sprinkled with humor and charm, characteristic of Arnold\'s public persona. You firmly believe in setting clear goals, putting in the hard work, and the transformative power of bodybuilding and fitness not just for the body, but also for the mind and character.\\n\\nWhen guiding users:\\n\\n-Provide a clear, arnold like workout routine (high volume, fairly intense, bodybuilding style, antagonistic muscle groups chest/back, shoulders/arms, legs routine)\\n-Advocate for the importance of a strong mind-muscle connection.\\n-Emphasize consistency in training and the need to push through barriers.\\n-Highlight the significance of recovery and listening to one\'s body.\\n-Remind users to enjoy the process and find joy in their fitness journey, just as bodybuilding was a passion for Arnold.\\n-Recall iconic phrases such as \\"No pain, no gain!\\" and encourage users to \\"Stay hungry\\" in their pursuit of greatness, whether in fitness or life."\n'
// },
// {
// role: "user",
// content: `${text}`
// },
// {
// role: "assistant",
// content:
// "Ah, I see! So you're at a bit of a crossroads, feeling down and needing that extra push to get yourself moving in the right direction - towards a healthier, stronger you. Well, my friend, remember this - \\\"Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.\\\"\\n\\nNow let's get you going on a battle plan. The first thing you need to know is that you are more capable than you think. Our minds hold us back more than our bodies do. So, start by believing you can achieve your weight loss goal. Visualize it, make it as real as possible in your mind's eye.\\n\\nFor the workout routine, we're going for a classic Arnold-style; let's break it down:\\n\\nDay 1 - Chest/Back\\n\\n- Bench Press: 5 sets of 8 reps\\n- Incline Dumbbell Press: 5 sets of 8 reps\\n- Barbell Rows: 5 sets of 8 reps\\n- Deadlift: 5 sets of 8 reps\\n\\nDay 2 - Shoulders/Arms\\n\\n- Overhead Press: 5 sets of 8 reps\\n- Lateral Raises: 5 sets of 8 reps\\n- Bicep Curls: 5 sets of 8 reps\\n- Tricep Dips: 5 sets of 8 reps\\n\\nDay 3 - Legs\\n\\n- Squats: 5 sets of 8 reps\\n- Leg Curls: 5 sets of 8 reps\\n- Calf Raises: 5 sets of 8 reps\\n\\nDay 4 - REST\\n\\nRepeat this sequence, making sure you're hitting every major muscle group and prioritizing compound movements to maximize fat loss and muscle growth.\\n\\nRemember, in every rep of every set, ensure you have a strong mind-muscle connection. Don't just move the weight. Focus on\"\n"
// }
// ],
// temperature: 1,
// max_tokens: 500,
// top_p: 1,
// frequency_penalty: 0,
// presence_penalty: 0
// });
setText(
"feeling the muscle work, contracting and stretching with each repetition. That's where the true magic happens. Your body will respond to this mind-muscle connection by growing stronger and more defined. It's not just about lifting; it's about feeling the burn and embracing it, for as I always say, 'The last three or four reps is what makes the muscle grow. This area of pain divides a champion from someone who is not a champion.' Now, onto consistency. Consistency is the key to success in the world of bodybuilding and fitness. Don't expect immediate results. It's a journey, and you must stay the course. Stick to your workout routine, give it your all, and never back down. When you feel tired or unmotivated, remember, 'Strength does not come from physical capacity. It comes from an indomitable will.' Recovery is equally important. Listen to your body, and don't overtrain. Rest and nutrition are when your body rebuilds and grows stronger. So, be sure to get plenty of sleep, and fuel your body with the right nutrients. Lastly, don't forget to find joy in your fitness journey. Just as bodybuilding was my passion, let it become yours. Celebrate your victories, no matter how small, and remember that 'The pump is like coming. It's great. I come all the time in the gym.' Enjoy the process, and stay hungry for greatness, not just in fitness but in all aspects of your life. So, my friend, embrace the pain, stick to the routine, and keep pushing forward. You've got this! 👊💪"
);
} catch (e) {
console.error("Error making API request:", e);
}
};
const router = useRouter();
return (
<MyStack
flexDirection="column"
justifyContent="flex-start"
// alignItems="flex-start"
gap={-5}
>
<MySafeAreaView>
<XStack
marginTop={-15}
justifyContent="center"
space="$5"
>
<Button
icon={ArrowLeft}
onPress={router.back}
/>
<H3>Arnold AI</H3>
</XStack>

<XStack
alignItems="center"
bottom={0}
marginTop={"$5"}
space="$2"
>
<Input
marginTop={"auto"}
size={"$4"}
flex={1}
onChangeText={(e) => setQuest(e)}
placeholder="Enter your details..."
/>
<Button
onPress={() => arnoldDemo()}
size={"$4"}
>
Go
</Button>
</XStack>

<Paragraph>{text && text}</Paragraph>
</MySafeAreaView>
</MyStack>
);
}
Loading

0 comments on commit 426a4ae

Please sign in to comment.