Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import {
  3. Text,
  4. View,
  5. Button,
  6. StyleSheet,
  7. TouchableOpacity,
  8. ImageBackground,
  9. fontFamily,
  10. Animated,
  11. Image,
  12. Easing } from 'react-native'
  13.  
  14.  
  15. export class StartScreen extends Component {
  16.  
  17. constructor () {
  18. super()
  19. this.animatedValue = new Animated.Value(0)
  20. }
  21.  
  22. componentDidMount () {
  23. this.animate()
  24. }
  25. animate () {
  26. this.animatedValue.setValue(0)
  27. Animated.timing(
  28. this.animatedValue,
  29. {
  30. toValue: 2,
  31. duration: 2000,
  32. easing: Easing.linear
  33. }
  34. ).start(() => this.animate())
  35. }
  36.  
  37. render() {
  38. const marginTop = this.animatedValue.interpolate({
  39. inputRange: [0, 1],
  40. outputRange: [-100, 350]
  41. })
  42. return (
  43. <ImageBackground source={require('./assets/start.png')} style={{width: '100%', height: '100%'}}>
  44. <View style={styles.container}>
  45. <Animated.Image style={{marginTop, width:88, height:148}} source={require('./assets/drop.png')}/>
  46. <Text style={styles.paragraph}> Sluk tørste gratis og miljøvenligt i København </Text>
  47. <TouchableOpacity
  48. style={styles.startButton}
  49. onPress={() => this.props.navigation.navigate('MyLoading')}>
  50. <Text style={styles.startButtonText}>Find Vandposter</Text>
  51. </TouchableOpacity>
  52. </View>
  53. </ImageBackground>
  54. )
  55. }
  56. }
  57.  
  58.  
  59. const styles = StyleSheet.create({
  60. container: {
  61. flex: 1,
  62. alignItems: 'center',
  63. justifyContent: 'center',
  64. paddingTop: 150,
  65. //backgroundColor: '#ffffff',
  66. },
  67. paragraph: {
  68. margin:10,
  69. fontSize: 18,
  70. textAlign: 'center',
  71. },
  72. startButton: {
  73. borderWidth: 1,
  74. borderColor: '#007BFF',
  75. backgroundColor: '#007BFF',
  76. padding: 15,
  77. margin: 5
  78. },
  79. startButtonText: {
  80. color: '#FFFFFF',
  81. fontSize: 20,
  82. textAlign: 'center'
  83. },
  84. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement