This commit is contained in:
Ren Juan 2021-08-21 07:45:27 +00:00
parent e56a630b3d
commit 40f0b58bc3
6 changed files with 44 additions and 69 deletions

View File

@ -8,7 +8,7 @@ import useCachedResources from './hooks/useCachedResources';
import useColorScheme from './hooks/useColorScheme';
import Navigation from './navigation';
import { GT2 } from './GT2';
export var debug:boolean = true;
export var debug:boolean = false;
export var expoGeoState:any;
export default function App() {

View File

@ -2,6 +2,7 @@ import * as React from 'react';
import { Coordinate } from "./Coordinate";
import { Text, View } from './components/Themed';
import { StyleSheet } from 'react-native';
import { useState, useEffect } from 'react';
const styles = StyleSheet.create({
tripText: {
@ -36,14 +37,15 @@ class Chronometer {
export class GT2 {
displayInterval:any = null;
loc:Coordinate = new Coordinate(0,0);
clock:Chronometer = new Chronometer();
startPoint:Coordinate = new Coordinate(0,0);
displayInterval:any = null;
public distance:number = 0.0;
co2Rate:number = 0.0;
currTime:number = 0;
lastTime:number = 0;
loc:Coordinate = new Coordinate(0,0);
public v:number = 0;
public inProgress:boolean = false;
public paused:boolean = false;
@ -94,6 +96,8 @@ export class GT2 {
public TripDisplay() {
var tripPanel:string = "";
if (!thisTrip.inProgress)
return (
<View>

View File

@ -33,9 +33,9 @@ export function ScreenInfo2() {
export function ScreenInfo3() {
return (
<View style={styles.settingsContainer}>
<View style={styles.splashContainer}>
<Text
style={styles.settingsText}
style={styles.titleText}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
Green Travel Carbon Calculator v. 2
@ -51,17 +51,29 @@ export function ScreenInfo3() {
}
const styles = StyleSheet.create({
splashContainer: {
marginHorizontal: 50,
marginVertical: 20,
backgroundColor: 'rgba(0, 0, 0, 0)',
},
settingsContainer: {
marginHorizontal: 50,
marginVertical: 20,
},
titleText: {
color: 'white',
fontSize: 17,
lineHeight: 24,
textAlign: 'center',
},
settingsText: {
fontSize: 17,
lineHeight: 24,
textAlign: 'center',
},
versionText: {
fontSize: 8,
color: 'yellow',
fontSize: 10,
textAlign: 'center',
},
});

View File

@ -1366,64 +1366,14 @@
}
},
"@expo/metro-config": {
"version": "0.1.83",
"resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.1.83.tgz",
"integrity": "sha512-nbmHRzAjnUmUoQjbVdTh8Xq1AXABmwqDi77otD+MxxfVmppMYLKYfMteZnrl75tmWkQY4JfVLD4DfKA3K+bKGA==",
"version": "0.1.82",
"resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.1.82.tgz",
"integrity": "sha512-rgx0ykWFvu+7jXDSe/cJB0fpIKqJX4X2k+azBIS9KmVLl5/ceKuCr6Abjy70HZTAXX/SQ7fS0C+FhzIX2Upgrg==",
"requires": {
"@expo/config": "5.0.8",
"@expo/config": "5.0.7",
"chalk": "^4.1.0",
"getenv": "^1.0.0",
"metro-react-native-babel-transformer": "^0.59.0"
},
"dependencies": {
"@expo/config": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/@expo/config/-/config-5.0.8.tgz",
"integrity": "sha512-chxcjQh4H/suzvYi+p30VnGXSHbsiVsGFwEYIZbOw4ByjrCnzeD644KolbpeQ2/oWK3atci01Qcxc1TADSixHQ==",
"requires": {
"@babel/code-frame": "~7.10.4",
"@expo/config-plugins": "3.0.8",
"@expo/config-types": "^42.0.0",
"@expo/json-file": "8.2.33",
"getenv": "^1.0.0",
"glob": "7.1.6",
"require-from-string": "^2.0.2",
"resolve-from": "^5.0.0",
"semver": "7.3.2",
"slugify": "^1.3.4",
"sucrase": "^3.20.0"
}
},
"@expo/config-plugins": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-3.0.8.tgz",
"integrity": "sha512-reNYaYklOIq8QUY5ua1ubSRhVgY7hllvjingo22HHSaGhX4UvFFKDGYrjBdjcutHD6jw/eYLa8yJS74o1/rqkg==",
"requires": {
"@expo/config-types": "^42.0.0",
"@expo/json-file": "8.2.33",
"@expo/plist": "0.0.13",
"debug": "^4.3.1",
"find-up": "~5.0.0",
"fs-extra": "9.0.0",
"getenv": "^1.0.0",
"glob": "7.1.6",
"resolve-from": "^5.0.0",
"semver": "^7.3.5",
"slash": "^3.0.0",
"xcode": "^3.0.1",
"xml2js": "^0.4.23"
},
"dependencies": {
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
}
}
}
}
},
"@expo/plist": {
@ -6341,9 +6291,9 @@
"dev": true
},
"fastq": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz",
"integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==",
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz",
"integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==",
"requires": {
"reusify": "^1.0.4"
}

View File

@ -1,25 +1,34 @@
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { StyleSheet, ImageBackground } from 'react-native';
import { Text, View } from '../components/Themed';
import { ScreenInfo3 } from '../components/ScreenInfo';
export default function TripScreen() {
const image = { uri: "https://meansofproduction.biz/images/GREENT.jpg" };
export default function SplashScreen() {
return (
<View style={styles.container}>
<ImageBackground source={image} resizeMode="cover" style={styles.image}>
<Text style={styles.title}>GT2</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<View style={styles.separator} />
<ScreenInfo3 />
</ImageBackground>
</View>
);
}
const styles = StyleSheet.create({
image: {
flex: 1,
justifyContent: "center"
},
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
title: {
color: 'white',
fontSize: 40,
fontWeight: 'bold',
},