Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AvyaRathod committed Feb 28, 2025
1 parent 5687b89 commit 1294834
Show file tree
Hide file tree
Showing 10 changed files with 442 additions and 124 deletions.
Binary file added App/src/assets/pants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions App/src/navigation/AiToolsTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useTheme } from 'react-native-paper';
import GenerateOutfitsScreen from '../screens/generateOutfits/GenerateOutfitsScreen';
import OutfitCheckScreen from '../screens/outfitCheck/OutfitCheckScreen';
import MixAndMatchScreen from '../screens/mixAndMatch/MixAndMatchScreen';
import ColorTheoryScreen from '../screens/colourTheory/ColorTherapy';

import useNavigationStore from '../store/useNavigationStore';
import SelfieAnalysisScreen from '../screens/colourTheory/selfieScreen';

const AiTab = createBottomTabNavigator();

Expand Down Expand Up @@ -83,10 +83,10 @@ const AiToolsTabNavigator: React.FC = () => {
} as BottomTabNavigationOptions}
/>
<AiTab.Screen
name="ColorTheory"
component={ColorTheoryScreen}
name="Color Analysis"
component={SelfieAnalysisScreen}
options={{
title: 'Color Theory',
title: 'Color Analysis',
tabBarIcon: ({ color, size }) => <Icon name="palette" size={size} color={color} />,
} as BottomTabNavigationOptions}
/>
Expand Down
3 changes: 2 additions & 1 deletion App/src/navigation/TabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import useNavigationStore from '../store/useNavigationStore';
import HomeScreen from '../screens/HomeScreen';
import InstructionsScreen from '../screens/colourTheory/InstructionScreen';
import WardrobeScreen from '../screens/WardrobeScreen';
import SelfieAnalysisScreen from '../screens/colourTheory/selfieScreen';

const MainTab = createBottomTabNavigator();

Expand Down Expand Up @@ -67,7 +68,7 @@ const MainTabNavigator: React.FC = () => {
/>
<MainTab.Screen
name="ColorAnalysis"
component={InstructionsScreen}
component={SelfieAnalysisScreen}
options={{
title: 'Color Analysis',
tabBarIcon: ({ color, size }) => <Icon name="palette" size={size} color={color} />,
Expand Down
70 changes: 36 additions & 34 deletions App/src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ const styles = StyleSheet.create({
borderRadius: 8,
justifyContent: 'center',
alignItems: 'center',
shadowRadius: 5,
shadowOpacity: 0.3,
shadowOffset: { width: 0, height: 2 },
elevation: 5,
shadowColor: "#000",
shadowRadius: 6,
shadowOpacity: 0.4, // Increased opacity
shadowOffset: { width: 0, height: 3 }, // More shadow at the bottom
elevation: 8, // Higher elevation for Android
},
bannerText: {
fontSize: 18,
Expand Down Expand Up @@ -175,11 +176,11 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
overflow: 'hidden', // Allow cropping
shadowRadius: 5,
shadowOpacity: 0.3,
shadowOffset: { width: 0, height: 2 },
elevation: 5,
shadowColor: "#000",
shadowRadius: 6,
shadowOpacity: 0.4, // Increased for better visibility
shadowOffset: { width: 0, height: 3 },
elevation: 8,
},

// RIGHT COLUMN
Expand All @@ -196,11 +197,11 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
overflow: 'hidden',
shadowRadius: 5,
shadowOpacity: 0.3,
shadowOffset: { width: 0, height: 2 },
elevation: 5,
shadowColor: "#000",
shadowRadius: 6,
shadowOpacity: 0.4, // More opacity for better visibility
shadowOffset: { width: 0, height: 3 },
elevation: 8,
},
mixMatchBox: {
backgroundColor: '#FFFFFF',
Expand All @@ -209,11 +210,11 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
overflow: 'hidden',
shadowRadius: 5,
shadowOpacity: 0.3,
shadowOffset: { width: 0, height: 2 },
elevation: 5,
shadowColor: "#000",
shadowRadius: 6,
shadowOpacity: 0.4,
shadowOffset: { width: 0, height: 3 },
elevation: 8,
},

// FULL-WIDTH: COLOUR ANALYSIS
Expand All @@ -224,12 +225,12 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
overflow: 'hidden',
shadowRadius: 5,
shadowOpacity: 0.3,
shadowOffset: { width: 0, height: 2 },
elevation: 5,

shadowColor: "#000",
shadowRadius: 6,
shadowOpacity: 0.4,
shadowOffset: { width: 0, height: 3 },
elevation: 8,
},

// TEXT INSIDE BOXES
Expand All @@ -248,32 +249,33 @@ const styles = StyleSheet.create({
position: 'absolute',
bottom: 5,
right: 3,
width: 125, // Adjust based on need
height: 100, // Adjust based on need
width: 125,
height: 100,
resizeMode: 'contain',
},
CheckOutfitImage: {
position: 'absolute',
bottom: -1,
right: -3,
width: 90, // Adjust based on need
height:85, // Adjust based on need
width: 90,
height: 85,
resizeMode: 'contain',
},
MixandMatchImage: {
position: 'absolute',
bottom: -1,
right: -3,
width: 90, // Adjust based on need
height:85, // Adjust based on need
width: 90,
height: 85,
resizeMode: 'contain',
},
ColourAnalysisImage: {
position: 'absolute',
bottom: -3,
right: -5,
width: 100, // Adjust based on need
height:100, // Adjust based on need
resizeMode: 'contain',
width: 100,
height: 100,
resizeMode: 'cover',

},
});
132 changes: 132 additions & 0 deletions App/src/screens/colourTheory/ColorAnalysisResults.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import React from "react";
import { View, Text, StyleSheet, Pressable } from "react-native";
import { useRoute, useNavigation } from "@react-navigation/native";

const ColorAnalysisResultScreen: React.FC = () => {
const route = useRoute();
const navigation = useNavigation();
const { data } = route.params || {};

if (!data) {
return (
<View style={styles.container}>
<Text style={styles.errorText}>No Data Available</Text>
</View>
);
}

return (
<View style={styles.container}>
{/* Title */}
<Text style={styles.title}>Your Color Analysis Result</Text>

{/* Seasonal Color Type */}
<View style={[styles.card, { backgroundColor: getSeasonalColor(data.seasonal_color_type) }]}>
<Text style={styles.seasonText}>{data.seasonal_color_type}</Text>
<Text style={styles.seasonDesc}>{getSeasonDescription(data.seasonal_color_type)}</Text>
</View>

{/* User's Detected Features */}
<View style={styles.detailsContainer}>
<Text style={styles.detailText}>🌟 **Skin Tone:** {data.skin_tone}</Text>
<Text style={styles.detailText}>✨ **Undertone:** {data.undertone}</Text>
<Text style={styles.detailText}>💇 **Hair Color:** {data.hair_color}</Text>
<Text style={styles.detailText}>👀 **Eye Color:** {data.eye_color}</Text>
</View>

{/* Button to Color Palette Screen */}
<Pressable
style={styles.button}
onPress={() => navigation.navigate("ColorPaletteScreen", { colors: data.clothing_color_palette })}
>
<Text style={styles.buttonText}>View Your Color Palette</Text>
</Pressable>
</View>
);
};

export default ColorAnalysisResultScreen;

// Function to return background color based on the season
const getSeasonalColor = (season: string) => {
switch (season) {
case "Spring": return "#FFDAB9";
case "Summer": return "#87CEEB";
case "Autumn": return "#FF8C00";
case "Winter": return "#4682B4";
default: return "#DDD";
}
};

// Function to return season description
const getSeasonDescription = (season: string) => {
const descriptions: Record<string, string> = {
Spring: "Bright and warm colors suit you best.",
Summer: "Cool, soft, and muted tones enhance your features.",
Autumn: "Rich, earthy, and warm colors are ideal for you.",
Winter: "Deep, bold, and contrasting shades complement your complexion."
};
return descriptions[season] || "No description available.";
};

// Styles
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FAFAFA",
padding: 20,
justifyContent: "center",
},
title: {
fontSize: 22,
fontWeight: "bold",
textAlign: "center",
marginBottom: 16,
color: "#333",
},
card: {
padding: 16,
borderRadius: 12,
alignItems: "center",
marginBottom: 20,
},
seasonText: {
fontSize: 20,
fontWeight: "bold",
color: "#FFF",
},
seasonDesc: {
fontSize: 14,
textAlign: "center",
color: "#FFF",
marginTop: 8,
},
detailsContainer: {
backgroundColor: "#FFF",
padding: 16,
borderRadius: 12,
elevation: 2,
marginBottom: 20,
},
detailText: {
fontSize: 16,
color: "#333",
marginBottom: 6,
},
button: {
backgroundColor: "#843CA7",
paddingVertical: 16,
borderRadius: 32,
alignItems: "center",
},
buttonText: {
color: "#FFF",
fontSize: 16,
fontWeight: "bold",
},
errorText: {
fontSize: 18,
color: "#FF0000",
textAlign: "center",
},
});
90 changes: 90 additions & 0 deletions App/src/screens/colourTheory/ColorPaletteScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React from "react";
import { View, Text, FlatList, StyleSheet, Pressable } from "react-native";
import { useRoute, useNavigation } from "@react-navigation/native";

const ColorPaletteScreen: React.FC = () => {
const route = useRoute();
const navigation = useNavigation();
const { colors } = route.params || {};

if (!colors || colors.length === 0) {
return (
<View style={styles.container}>
<Text style={styles.errorText}>No Colors Available</Text>
</View>
);
}

return (
<View style={styles.container}>
<Text style={styles.title}>Your Personalized Color Palette</Text>

{/* Color Palette List */}
<FlatList
data={colors}
keyExtractor={(item) => item.hex}
renderItem={({ item }) => (
<View style={[styles.colorBox, { backgroundColor: item.hex }]}>
<Text style={styles.colorName}>{item.name}</Text>
<Text style={styles.colorHex}>{item.hex}</Text>
</View>
)}
/>

{/* Back Button */}
<Pressable style={styles.button} onPress={() => navigation.goBack()}>
<Text style={styles.buttonText}>Back</Text>
</Pressable>
</View>
);
};

export default ColorPaletteScreen;

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FAFAFA",
padding: 20,
justifyContent: "center",
},
title: {
fontSize: 22,
fontWeight: "bold",
textAlign: "center",
marginBottom: 16,
color: "#333",
},
colorBox: {
padding: 16,
borderRadius: 12,
marginBottom: 12,
alignItems: "center",
},
colorName: {
fontSize: 16,
fontWeight: "bold",
color: "#FFF",
},
colorHex: {
fontSize: 14,
color: "#FFF",
},
button: {
backgroundColor: "#843CA7",
paddingVertical: 16,
borderRadius: 32,
alignItems: "center",
marginTop: 20,
},
buttonText: {
color: "#FFF",
fontSize: 16,
fontWeight: "bold",
},
errorText: {
fontSize: 18,
color: "#FF0000",
textAlign: "center",
},
});
Loading

0 comments on commit 1294834

Please sign in to comment.