Skip to content

Commit 41011c8

Browse files
committed
udate the project
1 parent f851030 commit 41011c8

File tree

7 files changed

+246
-0
lines changed

7 files changed

+246
-0
lines changed

Cordovaproject/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
3+
# Generated by package manager
4+
node_modules/
5+
6+
# Generated by Cordova
7+
/plugins/
8+
/platforms/

Cordovaproject/config.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="com.unityforlife.liveapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>MyApp</name>
4+
<description>
5+
A sample Apache Cordova application that responds to the deviceready event.
6+
</description>
7+
<author email="[email protected]" href="http://cordova.io">
8+
Apache Cordova Team
9+
</author>
10+
<content src="index.html" />
11+
<access origin="*" />
12+
<allow-intent href="http://*/*" />
13+
<allow-intent href="https://*/*" />
14+
<allow-intent href="tel:*" />
15+
<allow-intent href="sms:*" />
16+
<allow-intent href="mailto:*" />
17+
<allow-intent href="geo:*" />
18+
<platform name="android">
19+
<allow-intent href="market:*" />
20+
</platform>
21+
<platform name="ios">
22+
<allow-intent href="itms:*" />
23+
<allow-intent href="itms-apps:*" />
24+
</platform>
25+
</widget>

Cordovaproject/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "com.unityforlife.liveapp",
3+
"displayName": "MyApp",
4+
"version": "1.0.0",
5+
"description": "A sample Apache Cordova application that responds to the deviceready event.",
6+
"main": "index.js",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"keywords": [
11+
"ecosystem:cordova"
12+
],
13+
"author": "Apache Cordova Team",
14+
"license": "Apache-2.0",
15+
"devDependencies": {
16+
"cordova-plugin-whitelist": "^1.3.4"
17+
},
18+
"cordova": {
19+
"plugins": {
20+
"cordova-plugin-whitelist": {}
21+
}
22+
}
23+
}

Cordovaproject/www/css/index.css

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
* {
20+
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
21+
}
22+
23+
body {
24+
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
25+
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
26+
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
27+
background-color:#E4E4E4;
28+
background-image:linear-gradient(to bottom, #A7A7A7 0%, #E4E4E4 51%);
29+
font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
30+
font-size:12px;
31+
height:100vh;
32+
margin:0px;
33+
padding:0px;
34+
/* Padding to avoid the "unsafe" areas behind notches in the screen */
35+
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
36+
text-transform:uppercase;
37+
width:100%;
38+
}
39+
40+
/* Portrait layout (default) */
41+
.app {
42+
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
43+
position:absolute; /* position in the center of the screen */
44+
left:50%;
45+
top:50%;
46+
height:50px; /* text area height */
47+
width:225px; /* text area width */
48+
text-align:center;
49+
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
50+
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
51+
/* offset horizontal: half of text area width */
52+
}
53+
54+
/* Landscape layout (with min-width) */
55+
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
56+
.app {
57+
background-position:left center;
58+
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
59+
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
60+
/* offset horizontal: half of image width and text area width */
61+
}
62+
}
63+
64+
h1 {
65+
font-size:24px;
66+
font-weight:normal;
67+
margin:0px;
68+
overflow:visible;
69+
padding:0px;
70+
text-align:center;
71+
}
72+
73+
.event {
74+
border-radius:4px;
75+
color:#FFFFFF;
76+
font-size:12px;
77+
margin:0px 30px;
78+
padding:2px 0px;
79+
}
80+
81+
.event.listening {
82+
background-color:#333333;
83+
display:block;
84+
}
85+
86+
.event.received {
87+
background-color:#4B946A;
88+
display:none;
89+
}
90+
91+
#deviceready.ready .event.listening { display: none; }
92+
#deviceready.ready .event.received { display: block; }
93+
94+
@keyframes fade {
95+
from { opacity: 1.0; }
96+
50% { opacity: 0.4; }
97+
to { opacity: 1.0; }
98+
}
99+
100+
.blink {
101+
animation:fade 3000ms infinite;
102+
-webkit-animation:fade 3000ms infinite;
103+
}
104+
105+
106+
@media screen and (prefers-color-scheme: dark) {
107+
body {
108+
background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
109+
}
110+
}

Cordovaproject/www/img/logo.png

21.3 KB
Loading

Cordovaproject/www/index.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<html>
21+
<head>
22+
<meta charset="utf-8">
23+
<!--
24+
Customize this policy to fit your own app's needs. For more guidance, see:
25+
https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
26+
Some notes:
27+
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
28+
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
29+
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
30+
* Enable inline JS: add 'unsafe-inline' to default-src
31+
-->
32+
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
33+
<meta name="format-detection" content="telephone=no">
34+
<meta name="msapplication-tap-highlight" content="no">
35+
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
36+
<meta name="color-scheme" content="light dark">
37+
<link rel="stylesheet" href="css/index.css">
38+
<title>Hello World</title>
39+
</head>
40+
<body>
41+
<div class="app">
42+
<h1>Apache Cordova</h1>
43+
<div id="deviceready" class="blink">
44+
<p class="event listening">Connecting to Device</p>
45+
<p class="event received">Device is Ready</p>
46+
</div>
47+
</div>
48+
<script src="cordova.js"></script>
49+
<script src="js/index.js"></script>
50+
</body>
51+
</html>

Cordovaproject/www/js/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// Wait for the deviceready event before using any of Cordova's device APIs.
21+
// See https://cordova.apache.org/docs/en/latest/cordova/events/events.html#deviceready
22+
document.addEventListener('deviceready', onDeviceReady, false);
23+
24+
function onDeviceReady() {
25+
// Cordova is now initialized. Have fun!
26+
27+
console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
28+
document.getElementById('deviceready').classList.add('ready');
29+
}

0 commit comments

Comments
 (0)