From c1afd8404aca7a86a254a9ee8f80a87a5d8863c9 Mon Sep 17 00:00:00 2001 From: Humberto Alfonso Díaz Date: Mon, 9 Dec 2019 12:34:13 +0100 Subject: STRUCT Create project structure --- src/config.xml | 22 +++ src/icon.svg | 279 +++++++++++++++++++++++++++++++++++ src/images/horizontal_background.png | Bin 0 -> 753195 bytes src/images/vertical_background.png | Bin 0 -> 719555 bytes src/index.html | 26 ++++ src/index.js | 25 ++++ src/js/app.js | 23 +++ src/js/templates.js | 19 +++ src/styles/app.scss | 13 ++ src/styles/landscape.scss | 6 + src/styles/main.scss | 21 +++ src/styles/portrait.scss | 10 ++ src/templates/main.template.html | 1 + 13 files changed, 445 insertions(+) create mode 100644 src/config.xml create mode 100644 src/icon.svg create mode 100644 src/images/horizontal_background.png create mode 100644 src/images/vertical_background.png create mode 100644 src/index.html create mode 100644 src/index.js create mode 100644 src/js/app.js create mode 100644 src/js/templates.js create mode 100644 src/styles/app.scss create mode 100644 src/styles/landscape.scss create mode 100644 src/styles/main.scss create mode 100644 src/styles/portrait.scss create mode 100644 src/templates/main.template.html (limited to 'src') diff --git a/src/config.xml b/src/config.xml new file mode 100644 index 0000000..f7bf7cc --- /dev/null +++ b/src/config.xml @@ -0,0 +1,22 @@ + + + MEDIAPLAYER + + + HTML5 Mediaplayer demo + Igalia, S.L. + APL 2.0 + + + + + + + + + + + + + + diff --git a/src/icon.svg b/src/icon.svg new file mode 100644 index 0000000..91661a7 --- /dev/null +++ b/src/icon.svg @@ -0,0 +1,279 @@ + + + +image/svg+xmlMULTIMEDIA + \ No newline at end of file diff --git a/src/images/horizontal_background.png b/src/images/horizontal_background.png new file mode 100644 index 0000000..b5a36e4 Binary files /dev/null and b/src/images/horizontal_background.png differ diff --git a/src/images/vertical_background.png b/src/images/vertical_background.png new file mode 100644 index 0000000..3f553fe Binary files /dev/null and b/src/images/vertical_background.png differ diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..7bd906b --- /dev/null +++ b/src/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..484dffa --- /dev/null +++ b/src/index.js @@ -0,0 +1,25 @@ +/* + * 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. + */ +/* JS */ +import * as app from './js/app'; + +import { api } from 'agl-js-api'; + +/* CSS */ +import './styles/app.scss'; + +api.init(); +app.init(); diff --git a/src/js/app.js b/src/js/app.js new file mode 100644 index 0000000..a0ec650 --- /dev/null +++ b/src/js/app.js @@ -0,0 +1,23 @@ +import { load as load_template } from './templates'; +import Mustache from 'mustache'; + +import { lowcan } from 'agl-js-api'; + +var template; +var page = { + +}; + +export function show() { + document.body.innerHTML = Mustache.render(template, page); +} + +export function init() { + load_template('main.template.html').then(function(result) { + template = result; + Mustache.parse(template); + show(); + }, function(error) { + console.error('ERRROR loading main template', error); + }); +} \ No newline at end of file diff --git a/src/js/templates.js b/src/js/templates.js new file mode 100644 index 0000000..2513722 --- /dev/null +++ b/src/js/templates.js @@ -0,0 +1,19 @@ +export function load(template) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', '/templates/'+template); + + xhr.send(); + + xhr.onload = function() { + if (xhr.status != 200) { + console.error('Error loading template', xhr.status, xhr.statusText); + reject(xhr.status); + } else { + console.log(xhr.responseType); + resolve(xhr.responseText); + } + }; + }); +} \ No newline at end of file diff --git a/src/styles/app.scss b/src/styles/app.scss new file mode 100644 index 0000000..014e722 --- /dev/null +++ b/src/styles/app.scss @@ -0,0 +1,13 @@ +$body-bg: transparent; +$body-color: #FFFFFF; +$list-group-bg: transparent; +$font-size-base: 1.5rem; +$input-bg: transparent; +$input-color: #FFFFFF; + +@import "~bootstrap/scss/bootstrap"; +@import "main.scss"; +@import "portrait.scss"; +@import "landscape.scss"; +@import "~@fortawesome/fontawesome-free/css/all.min.css"; + diff --git a/src/styles/landscape.scss b/src/styles/landscape.scss new file mode 100644 index 0000000..b7e1bf7 --- /dev/null +++ b/src/styles/landscape.scss @@ -0,0 +1,6 @@ +@media (orientation: landscape) { + + html { + background-image: url('../images/horizontal_background.png'); + } +} \ No newline at end of file diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000..e1d6ceb --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,21 @@ +::-webkit-scrollbar { + display: none; +} + +html { + height: 100%; + background-size: cover; + -webkit-overflow-scrolling: touch; +} + +body { + .log { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 1080px; + background: white; + font-size: 1.5rem; + } +} \ No newline at end of file diff --git a/src/styles/portrait.scss b/src/styles/portrait.scss new file mode 100644 index 0000000..f8db5e4 --- /dev/null +++ b/src/styles/portrait.scss @@ -0,0 +1,10 @@ +@media (orientation: portrait) { + + html { + background-image: url('../images/vertical_background.png'); + background-position: top center; + background-repeat: no-repeat; + background-color: transparent; + height: 992px; + } +} \ No newline at end of file diff --git a/src/templates/main.template.html b/src/templates/main.template.html new file mode 100644 index 0000000..0f3081c --- /dev/null +++ b/src/templates/main.template.html @@ -0,0 +1 @@ +This is the mediaplayer \ No newline at end of file -- cgit 1.2.3-korg