Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homescreen Added #8

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4040482
package updated
iKumarAbhinav Sep 11, 2024
18f0f6f
progress card component
iKumarAbhinav Sep 11, 2024
3a696b4
Typography Added
iKumarAbhinav Sep 18, 2024
9ff74a0
Added font Loading functions
iKumarAbhinav Sep 18, 2024
1eedb3a
added font in application
iKumarAbhinav Sep 18, 2024
6243612
Added Progress Card and its Packages
iKumarAbhinav Sep 18, 2024
22d7a53
changed color and responsivness for component
iKumarAbhinav Sep 24, 2024
49eb9ff
Added font files
iKumarAbhinav Sep 24, 2024
f177248
fix : Changed width and height
iKumarAbhinav Oct 4, 2024
f9f0893
typo added and background removed
iKumarAbhinav Oct 4, 2024
d24ef36
Non used import and css removed
iKumarAbhinav Oct 4, 2024
3eb3a79
removed container
iKumarAbhinav Oct 4, 2024
a9797da
Prop name changes to sheajPathNumber
iKumarAbhinav Oct 8, 2024
e1ba409
Remove extra code from app.js
iKumarAbhinav Oct 8, 2024
36156b5
Orientation of progress cicle is changes as per figma
iKumarAbhinav Oct 8, 2024
e87ab26
Added BalooPaji2 Fonts and recoleta
iKumarAbhinav Oct 8, 2024
9936139
fix:progress circle color bug
iKumarAbhinav Oct 8, 2024
34f61ae
Added svg for start icon
iKumarAbhinav Oct 8, 2024
13ffc84
Added two more typography
iKumarAbhinav Oct 8, 2024
39d4c0a
Added Home screen Code
iKumarAbhinav Oct 8, 2024
e4f58fe
Added HomeScreen Code
iKumarAbhinav Oct 15, 2024
84f61c6
conflict : app.json fixed
iKumarAbhinav Oct 15, 2024
74ed44d
fix: merge conflict
iKumarAbhinav Oct 15, 2024
b72500b
added Completed Progress Card Component
iKumarAbhinav Oct 15, 2024
263b2ce
fix: foldername
iKumarAbhinav Oct 15, 2024
bd6c044
conflicts resolve
simarjot0032 Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
import { useFonts } from 'expo-font';
import Welcomescreen from "./App/screens/Welcomescreen"
export default function App() {
let [fontsLoaded] = useFonts({
'BrandonGrotesque-Regular': require('./App/assets/fonts/brandon-grotesque-regular.otf'),
'BrandonGrotesque-Bold': require('./App/assets/fonts/brandon-grotesque-bold.otf'),
'BrandonGrotesque-Light': require('./App/assets/fonts/brandon-grotesque-light.otf'),
'BrandonGrotesque-Medium': require('./App/assets/fonts/brandon-grotesque-medium.otf'),
'BrandonGrotesque-Black': require('./App/assets/fonts/brandon-grotesque-black.otf'),
});

if (!fontsLoaded) {
return null;
}

return (
<View style={styles.container}>
<Welcomescreen/>
<View >


</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});

Binary file added App/assets/background.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 added App/assets/fonts/brandon-grotesque-black.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions App/assets/fonts/brandon-grotesque-black.otf:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/brandon-grotesque-bold.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions App/assets/fonts/brandon-grotesque-bold.otf:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/brandon-grotesque-light.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions App/assets/fonts/brandon-grotesque-light.otf:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/brandon-grotesque-medium.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions App/assets/fonts/brandon-grotesque-medium.otf:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/brandon-grotesque-regular.otf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/brandon-grotesque-thin.otf
Binary file not shown.
3 changes: 3 additions & 0 deletions App/assets/fonts/brandon-grotesque-thin.otf:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\sidda\Downloads\Brandon-Grotesque-Font.zip
Binary file added App/assets/fonts/recoleta-regular.otf
Binary file not shown.
Binary file added App/assets/fullBackground.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 added App/assets/plus-waves.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions App/components/CompletedPathCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';
import { View, Text, StyleSheet, useWindowDimensions } from 'react-native';

const CompletedPathCard = ({ sehajNumber, completionDate }) => {
const { width: screenWidth } = useWindowDimensions();

const styles = StyleSheet.create({
container: {
width: screenWidth < 768 ? 130 : 156,
height: screenWidth < 768 ? 107 : 128,
backgroundColor: 'white',
borderRadius: 15,
padding: 15,
justifyContent: 'center',
alignItems: 'center',
shadowColor: '#11336A',
shadowOffset: { width: 15, height: 15 },
shadowOpacity: 0.1,
shadowRadius: 45,
elevation: 15,
},
sehajText: {
fontFamily: 'BrandonGrotesque-Bold',
fontSize: screenWidth < 768 ? 16 : 18,
lineHeight: screenWidth < 768 ? 24 : 26,
textAlign: 'center',
color: '#11336A',
},
dateText: {
fontFamily: 'BrandonGrotesque-Regular',
fontSize: screenWidth < 768 ? 14 : 16,
lineHeight: screenWidth < 768 ? 20 : 22,
textAlign: 'center',
color: '#666666',
marginTop: 4,
},
});

return (
<View style={styles.container}>
<Text style={styles.sehajText}>Sehaj #{sehajNumber}</Text>
<Text style={styles.dateText}>{completionDate}</Text>
</View>
);
};

export default CompletedPathCard;
123 changes: 123 additions & 0 deletions App/components/ProgressCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import React from 'react';
import { View, Text, StyleSheet, useWindowDimensions } from 'react-native';
import Svg, { Circle, Path, LinearGradient, Stop, Defs } from 'react-native-svg';

const ProgressCard = ({ sheajPathNumber, angNumber, progress }) => {
const { width: screenWidth, height: screenHeight } = useWindowDimensions();

const styles = StyleSheet.create({
container: {
width: screenWidth < 768 ? 199 : 239,
height: screenWidth < 768 ? 220 : 264,
backgroundColor: 'white',
borderRadius: 15,
padding: screenWidth < 768 ? 20 : 24,
justifyContent: 'space-between',
alignItems: 'center',
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 3,
},
textContainer: {
alignItems: 'center',
marginBottom: screenWidth < 768 ? 2 : 4,
},
sehajText: {
fontFamily: 'BrandonGrotesque-Bold',
fontSize: screenWidth < 768 ? 18 : 22,
lineHeight: screenWidth < 768 ? 26 : 31,
textAlign: 'center',
color: '#11336A',
},
angText: {
fontFamily: 'BrandonGrotesque-Regular',
fontSize: screenWidth < 768 ? 14 : 17,
lineHeight: screenWidth < 768 ? 20 : 24,
textAlign: 'center',
color: '#666666',
},
angNumber: {
fontFamily: 'BrandonGrotesque-Bold',
color: '#11336A',
},
progressContainer: {
width: screenWidth < 768 ? 53 : 72,
height: screenWidth < 768 ? 53 : 72,
justifyContent: 'center',
alignItems: 'center',
marginTop: 'auto',
marginBottom: 'auto',
},
});

const size = screenWidth < 768 ? 53 : 72;
const strokeWidth = screenWidth < 768 ? 12 : 14;
const center = size / 2;
const radius = (size - strokeWidth) / 2;

const calculateArcPath = (x, y, radius, startAngle, endAngle) => {
const start = polarToCartesian(x, y, radius, endAngle);
const end = polarToCartesian(x, y, radius, startAngle);
const largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
return [
"M", start.x, start.y,
"A", radius, radius, 0, largeArcFlag, 0, end.x, end.y
].join(" ");
};

const polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
const angleInRadians = ((angleInDegrees - 90) % 360) * Math.PI / 180.0;
return {
x: centerX + (radius * Math.cos(angleInRadians)),
y: centerY + (radius * Math.sin(angleInRadians))
};
};

const progressAngle = 360 * (progress / 100);
const startAngle = 0;
const endAngle = progressAngle;

return (
<View style={styles.container}>
<View style={styles.textContainer}>
<Text style={styles.sehajText}>Sehaj #{sheajPathNumber}</Text>
<Text style={styles.angText}>
Ang <Text style={styles.angNumber}>{angNumber}</Text>
</Text>
</View>
<View style={styles.progressContainer}>
<Svg width={size} height={size}>
<Defs>
<LinearGradient id="filledGrad" x1="16.15%" y1="85.35%" x2="85.35%" y2="16.15%">
<Stop offset="0%" stopColor="#2459AD" />
<Stop offset="100%" stopColor="#0D2346" />
</LinearGradient>
<LinearGradient id="unfilledGrad" x1="16.15%" y1="85.35%" x2="85.35%" y2="16.15%">
<Stop offset="0%" stopColor="rgba(36, 89, 173, 0.1)" />
<Stop offset="100%" stopColor="rgba(13, 35, 70, 0.1)" />
</LinearGradient>
</Defs>
<Circle
cx={center}
cy={center}
r={radius}
fill="none"
stroke="url(#unfilledGrad)"
strokeWidth={strokeWidth}
/>
<Path
d={calculateArcPath(center, center, radius, startAngle, endAngle)}
fill="none"
stroke="url(#filledGrad)"
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
</Svg>
</View>
</View>
);
};

export default ProgressCard;
Loading