diff --git a/app/ChallengeWeek.js b/app/ChallengeWeek.js index 006c8b5..d1047e2 100644 --- a/app/ChallengeWeek.js +++ b/app/ChallengeWeek.js @@ -7,6 +7,9 @@ import { Text, StatusBar, Linking, + Animated, + TouchableOpacity, + Image } from 'react-native'; import { @@ -23,7 +26,8 @@ class ChallengeWeek extends React.Component { constructor(props) { super(props) this.state = { - isLoading: true + isLoading: true, + flip: true } } @@ -37,17 +41,84 @@ class ChallengeWeek extends React.Component { }).then((json) => { this.setState({data: JSON.parse(json),isLoading:false}); }).catch((error) => console.error(error)) + + this.animatedValue=new Animated.Value(0); + this.value=0; + this.animatedValue.addListener(({value}) => { + this.value=value; + }) + this.frontInterpolate = this.animatedValue.interpolate({ + inputRange:[0,180], + outputRange:['0deg', '180deg'], + }) + this.backInterpolate = this.animatedValue.interpolate({ + inputRange:[0,180], + outputRange: ['180deg','360deg'] + }) + } + + flipCard() { + if (this.value >= 90) { + Animated.spring(this.animatedValue, { + toValue:0, + friction:8, + tension: 10 + }).start(); + } + else { + Animated.spring(this.animatedValue, { + toValue:180, + friction: 8, + tension: 10 + }).start(); + } + this.setState({flip:!this.state.flip}) } render() { + const frontAnimatedStyle = { + transform: [ + {rotateY:this.frontInterpolate} + ] + } + const backAnimatedStyle = { + transform: [ + {rotateY:this.backInterpolate} + ] + } + var styling={} + var styling2={} + if (this.state.flip) { + styling=({height: '100%', width: '100%', backgroundColor: 'white', borderRadius: 20, textAlign: 'center', display: 'flex', alignContent: 'center', padding: '5%', paddingTop: '15%', borderColor: 'red', borderWidth: 1}) + styling2=({display:'none'}) + } + else { + styling=({display:'none'}) + styling2=({height: '100%', width: '100%', backgroundColor: 'white', borderRadius: 20, textAlign: 'center', display: 'flex', alignContent: 'center', padding: '5%', paddingTop: '15%', borderColor: 'red', borderWidth: 1}) + } + if (this.state.isLoading) { return } else { return ( - - {this.state.data.title} - {this.state.data.text} - Linking.openURL(this.state.data.link)}>{this.state.data.link} + + this.flipCard()} style={{height: '70%', width: '80%', borderRadius: 20, shadowColor: 'red', shadowOffset: {width: 0, height: 2}, shadowOpacity: 0.5, shadowRadius: 7, alignSelf: 'center'}}> + + + {this.state.flip?{this.state.data.title}:<>} + + + + + + + {!this.state.flip?{this.state.data.text}:<>} + Linking.openURL(this.state.data.link)}>{'\n'}Link + + + + + ) } diff --git a/app/Resources.js b/app/Resources.js index 2a2f9ca..22bbafc 100644 --- a/app/Resources.js +++ b/app/Resources.js @@ -8,7 +8,8 @@ import { StatusBar, Linking, Image, - TouchableOpacity + TouchableOpacity, + Dimensions } from 'react-native'; import { @@ -20,27 +21,37 @@ import { } from 'react-native/Libraries/NewAppScreen'; import styles from './styles/morestyles'; +const windowWidth = Dimensions.get('window').width*.80/2; + function ResourceLink(props) { return ( - Linking.openURL(props.url)}> - - - {props.name} - - + Linking.openURL(props.url)}> + + + + + {props.name} + + ) } class Resources extends React.Component { render() { return ( - - - - - - - + + + + + + + + + + + + + ) } } diff --git a/app/assets/arrow_right.png b/app/assets/arrow_right.png new file mode 100644 index 0000000..bae3fd9 Binary files /dev/null and b/app/assets/arrow_right.png differ diff --git a/app/assets/athletics.jpg b/app/assets/athletics.jpg deleted file mode 100644 index 54f8eb4..0000000 Binary files a/app/assets/athletics.jpg and /dev/null differ diff --git a/app/assets/canvas.jpeg b/app/assets/canvas.jpeg new file mode 100644 index 0000000..92eb7b2 Binary files /dev/null and b/app/assets/canvas.jpeg differ diff --git a/app/assets/canvaslogo.png b/app/assets/canvaslogo.png deleted file mode 100644 index 57f1b05..0000000 Binary files a/app/assets/canvaslogo.png and /dev/null differ diff --git a/app/assets/counselor.jpeg b/app/assets/counselor.jpeg new file mode 100644 index 0000000..ffb896e Binary files /dev/null and b/app/assets/counselor.jpeg differ diff --git a/app/assets/gc.png b/app/assets/gc.png new file mode 100644 index 0000000..bec1e82 Binary files /dev/null and b/app/assets/gc.png differ diff --git a/app/assets/googleclassroom.jpg b/app/assets/googleclassroom.jpg deleted file mode 100644 index ab755d0..0000000 Binary files a/app/assets/googleclassroom.jpg and /dev/null differ diff --git a/app/assets/infoflow.jpeg b/app/assets/infoflow.jpeg new file mode 100644 index 0000000..343a80e Binary files /dev/null and b/app/assets/infoflow.jpeg differ diff --git a/app/assets/naviance.png b/app/assets/naviance.png index dc09320..4f5c602 100644 Binary files a/app/assets/naviance.png and b/app/assets/naviance.png differ diff --git a/app/assets/schedule.jpg b/app/assets/schedule.jpg deleted file mode 100644 index 82b633d..0000000 Binary files a/app/assets/schedule.jpg and /dev/null differ diff --git a/app/assets/sco.jpeg b/app/assets/sco.jpeg new file mode 100644 index 0000000..2b782b2 Binary files /dev/null and b/app/assets/sco.jpeg differ diff --git a/app/assets/studentvue.jpg b/app/assets/studentvue.jpg deleted file mode 100644 index da044eb..0000000 Binary files a/app/assets/studentvue.jpg and /dev/null differ diff --git a/app/assets/studentvue.png b/app/assets/studentvue.png new file mode 100644 index 0000000..57db1f4 Binary files /dev/null and b/app/assets/studentvue.png differ