diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bg/images/agl_logo_1080.png | bin | 0 -> 28957 bytes | |||
-rw-r--r-- | src/bg/images/agl_logo_720.png | bin | 0 -> 18340 bytes | |||
-rw-r--r-- | src/bg/images/horizontal_background.png | bin | 0 -> 1027813 bytes | |||
-rw-r--r-- | src/bg/images/horizontal_background_720.png | bin | 0 -> 557151 bytes | |||
-rw-r--r-- | src/bg/images/vertical_background.png | bin | 0 -> 948820 bytes | |||
-rw-r--r-- | src/bg/images/vertical_background_720.png | bin | 0 -> 516530 bytes | |||
-rw-r--r-- | src/bg/index.html | 9 | ||||
-rw-r--r-- | src/bg/index.js | 19 | ||||
-rw-r--r-- | src/bg/styles/app.scss | 22 | ||||
-rw-r--r-- | src/bg/styles/landscape.scss | 5 | ||||
-rw-r--r-- | src/bg/styles/main.scss | 11 | ||||
-rw-r--r-- | src/bg/styles/portrait.scss | 5 | ||||
-rw-r--r-- | src/config.json | 3 | ||||
-rw-r--r-- | src/config.xml | 8 | ||||
-rw-r--r-- | src/index.js | 1 | ||||
-rw-r--r-- | src/js/background.js | 9 |
16 files changed, 83 insertions, 9 deletions
diff --git a/src/bg/images/agl_logo_1080.png b/src/bg/images/agl_logo_1080.png Binary files differnew file mode 100644 index 0000000..d559e69 --- /dev/null +++ b/src/bg/images/agl_logo_1080.png diff --git a/src/bg/images/agl_logo_720.png b/src/bg/images/agl_logo_720.png Binary files differnew file mode 100644 index 0000000..7aa5d07 --- /dev/null +++ b/src/bg/images/agl_logo_720.png diff --git a/src/bg/images/horizontal_background.png b/src/bg/images/horizontal_background.png Binary files differnew file mode 100644 index 0000000..27a811e --- /dev/null +++ b/src/bg/images/horizontal_background.png diff --git a/src/bg/images/horizontal_background_720.png b/src/bg/images/horizontal_background_720.png Binary files differnew file mode 100644 index 0000000..3bef6ce --- /dev/null +++ b/src/bg/images/horizontal_background_720.png diff --git a/src/bg/images/vertical_background.png b/src/bg/images/vertical_background.png Binary files differnew file mode 100644 index 0000000..76c7679 --- /dev/null +++ b/src/bg/images/vertical_background.png diff --git a/src/bg/images/vertical_background_720.png b/src/bg/images/vertical_background_720.png Binary files differnew file mode 100644 index 0000000..f25adbf --- /dev/null +++ b/src/bg/images/vertical_background_720.png diff --git a/src/bg/index.html b/src/bg/index.html new file mode 100644 index 0000000..ea1f5c2 --- /dev/null +++ b/src/bg/index.html @@ -0,0 +1,9 @@ +<html lang="en"> + <head> + <!-- Required meta tags --> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + </head> + <body> + </body> +</html> diff --git a/src/bg/index.js b/src/bg/index.js new file mode 100644 index 0000000..4637197 --- /dev/null +++ b/src/bg/index.js @@ -0,0 +1,19 @@ +/* + * Copyright 2019 Igalia, S.L. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* CSS */ +import './styles/app.scss'; +console.log("Loaded app"); diff --git a/src/bg/styles/app.scss b/src/bg/styles/app.scss new file mode 100644 index 0000000..f5751d7 --- /dev/null +++ b/src/bg/styles/app.scss @@ -0,0 +1,22 @@ +//@import "~bootstrap/scss/bootstrap"; + +@media (max-device-width: 720px) and (orientation: portrait) { + @import "main.scss"; + @import "portrait.scss"; +} + +@media (max-device-width: 1280px) and (orientation: landscape) { + @import "main.scss"; + @import "landscape.scss"; +} + +@media (min-device-width: 1080px) and (orientation: portrait) { + @import "main.scss"; + @import "portrait.scss"; +} + +@media (min-device-width: 1920px) and (orientation: landscape) { + @import "main.scss"; + @import "landscape.scss"; +} + diff --git a/src/bg/styles/landscape.scss b/src/bg/styles/landscape.scss new file mode 100644 index 0000000..bdfddc5 --- /dev/null +++ b/src/bg/styles/landscape.scss @@ -0,0 +1,5 @@ +@media (orientation: landscape) { + html { + background-image: url('../images/horizontal_background.png'); + } +} diff --git a/src/bg/styles/main.scss b/src/bg/styles/main.scss new file mode 100644 index 0000000..64b89a2 --- /dev/null +++ b/src/bg/styles/main.scss @@ -0,0 +1,11 @@ +::-webkit-scrollbar { + display: none; +} + +html { + height: 100%; + width: 100%; + background-size: cover; + -webkit-overflow-scrolling: touch; + margin: 0; +} diff --git a/src/bg/styles/portrait.scss b/src/bg/styles/portrait.scss new file mode 100644 index 0000000..a7d3522 --- /dev/null +++ b/src/bg/styles/portrait.scss @@ -0,0 +1,5 @@ +@media (orientation: portrait) { + html { + background-image: url('../images/vertical_background.png'); + } +} diff --git a/src/config.json b/src/config.json index 89eb0c8..ccba148 100644 --- a/src/config.json +++ b/src/config.json @@ -17,8 +17,7 @@ "icon": "fas fa-music" } ], - "background": "webapps-html5-background", - "launch": "webapps-html5-launcher", + "background": "bg/index.html", "network": { "bluetooth": "fab fa-bluetooth-b", "ethernet": "fas fa-network-wired", diff --git a/src/config.xml b/src/config.xml index fd74ca5..1e65b1b 100644 --- a/src/config.xml +++ b/src/config.xml @@ -6,8 +6,12 @@ <description>HTML5 Homescreen demo</description> <author>Igalia, S.L.</author> <license>APL 2.0</license> - <surface role="panel" panel="left"/> - <window width="218"/> + + <client-shell> + <surface role="background" src="bg/" /> <!-- at least a bg is required --> + <surface role="panel" edge="left" width="218" src="/" /> + </client-shell> + <feature name="urn:AGL:widget:required-permission"> <param name="urn:AGL:permission::system:run-by-default" value="required" /> <param name="urn:AGL:permission::public:no-htdocs" value="required" /> diff --git a/src/index.js b/src/index.js index 8198355..d55346b 100644 --- a/src/index.js +++ b/src/index.js @@ -26,6 +26,7 @@ import * as background from './js/background'; window.apps = apps; window.time = time; + api.init(); background.load(); app.init(); diff --git a/src/js/background.js b/src/js/background.js index 38408ed..7cdaf0b 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -3,9 +3,8 @@ import { homescreen, afmMain } from 'agl-js-api'; var configjson = require('../config.json'); export function load() { - afmMain.start(configjson.background).then(function(result) { - console.log("loading background: " + result); - }); + //afmMain.start(configjson.background).then(function(result) { + // console.log("loading background: " + result); + //}); + console.log("Empty for background"); } - - |