Commit 059e94b6 authored by Udbhasa M M S's avatar Udbhasa M M S

container modifications

parent 5d2eb43f
...@@ -8,6 +8,7 @@ import WordGenerationScreen from './screens/WordGenerationScreen'; ...@@ -8,6 +8,7 @@ import WordGenerationScreen from './screens/WordGenerationScreen';
import SpeechTherapyScreen from './screens/SpeechTherapyScreen'; import SpeechTherapyScreen from './screens/SpeechTherapyScreen';
import ProgressMapScreen from './screens/ProgressMapScreen'; import ProgressMapScreen from './screens/ProgressMapScreen';
import WordGameScreen from './screens/WordGameScreen'; import WordGameScreen from './screens/WordGameScreen';
import PhoneticWordScreen from './screens/PhoneticWordsScreen';
const MainStack = createStackNavigator( const MainStack = createStackNavigator(
{ {
...@@ -32,6 +33,9 @@ const MainStack = createStackNavigator( ...@@ -32,6 +33,9 @@ const MainStack = createStackNavigator(
WordGame: { WordGame: {
screen: WordGameScreen, screen: WordGameScreen,
}, },
PhoneticWord: {
screen: PhoneticWordScreen,
},
}, },
{ {
initialRouteName: 'Login', initialRouteName: 'Login',
......
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default function ScreenName() {
return (
<View style={styles.container}>
<Text style={styles.text}>Sample screen</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#61A6AB',
alignItems: 'center',
justifyContent: 'center',
},
text: {
fontSize: 24,
color: 'white',
},
});
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { View, Text, StyleSheet } from 'react-native'; import { View, Text, StyleSheet, ImageBackground, TouchableOpacity, Image } from 'react-native';
import { Audio } from 'expo-av'; import { Audio } from 'expo-av';
import * as ScreenOrientation from 'expo-screen-orientation'; import * as ScreenOrientation from 'expo-screen-orientation';
const SpeechTherapyScreen = () => { const SpeechTherapyScreen = ({ navigation }) => {
const [sound, setSound] = useState(null); const [sound, setSound] = useState(null);
const [progress, setProgress] = useState(0); const [progress, setProgress] = useState(0);
const text = "i go to school"; const text = "I go to school";
const audioPath = './assets/CG/content/school_sentence.m4a'; const audioPath = './assets/ST/content/school_sentence.m4a';
const backgroundPath = './assets/ST/blackboard.png';
const buttonPath = './assets/ST/next.png';
const owlPath = './assets/ST/owl.png';
useEffect(() => { useEffect(() => {
async function changeScreenOrientation() { async function changeScreenOrientation() {
...@@ -50,11 +53,22 @@ const SpeechTherapyScreen = () => { ...@@ -50,11 +53,22 @@ const SpeechTherapyScreen = () => {
const getCharColor = (charIndex) => { const getCharColor = (charIndex) => {
const charProgress = charIndex / text.length; const charProgress = charIndex / text.length;
return charProgress <= progress ? 'black' : 'white'; return charProgress <= progress ? '#FFCE6D' : 'white';
};
const navigateToPhoneticWords = () => {
navigation.navigate('PhoneticWord');
}; };
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.backgroundWrapper}>
<ImageBackground
source={require(backgroundPath)}
style={styles.backgroundImage}
resizeMode="contain"
>
<Text style={styles.text}> <Text style={styles.text}>
{text.split('').map((char, index) => ( {text.split('').map((char, index) => (
<Text key={index} style={{ color: getCharColor(index) }}> <Text key={index} style={{ color: getCharColor(index) }}>
...@@ -62,8 +76,15 @@ const SpeechTherapyScreen = () => { ...@@ -62,8 +76,15 @@ const SpeechTherapyScreen = () => {
</Text> </Text>
))} ))}
</Text> </Text>
</ImageBackground>
</View>
<TouchableOpacity onPress={navigateToPhoneticWords} style={styles.button}>
<Image source={require(buttonPath)} style={styles.buttonImage} />
</TouchableOpacity>
<Image source={require(owlPath)} style={styles.owlImage} />
</View> </View>
); );
}; };
const styles = StyleSheet.create({ const styles = StyleSheet.create({
...@@ -73,8 +94,37 @@ const styles = StyleSheet.create({ ...@@ -73,8 +94,37 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
backgroundWrapper: {
width: '90%',
height: '80%',
alignItems: 'center',
justifyContent: 'center',
},
backgroundImage: {
width: '100%',
height: '100%',
alignItems: 'center',
justifyContent: 'center',
},
text: { text: {
fontSize: 24, fontSize: 65,
fontWeight: 'bold',
},
button: {
position: 'absolute',
bottom: 10,
right: 10,
},
buttonImage: {
width: 50,
height: 50,
},
owlImage: {
position: 'absolute',
bottom: 10,
left: 30,
width: 190,
height: 140,
}, },
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment