From 99976ecc11fcae37ffa1f75ae2bdefc13f3cc3af Mon Sep 17 00:00:00 2001 From: suroh Date: Mon, 9 Oct 2023 10:17:25 +0200 Subject: [PATCH] cleaned up code and added volume controller --- src/App.js | 20 +++++++- src/components/Footer.js | 10 +++- src/components/Header.js | 6 ++- src/components/ModularPlayer.js | 57 +++++++++++----------- src/components/VideoPlayer.js | 85 +++++++++++++++++++++++++++++---- src/controllers/volume.js | 22 +++++++++ src/views/audio.js | 57 ++++++++-------------- src/views/fourohfour.js | 19 +------- src/views/home.js | 5 +- src/views/images.js | 18 ++----- src/views/videos.js | 11 ++--- 11 files changed, 187 insertions(+), 123 deletions(-) create mode 100644 src/controllers/volume.js diff --git a/src/App.js b/src/App.js index c4e409b..6aa0c94 100644 --- a/src/App.js +++ b/src/App.js @@ -1,6 +1,11 @@ -import { LitElement } from 'lit' +import { LitElement, css, html, unsafeCSS } from 'lit' import Router from './api/Router.js' +import MainCSS from './assets/styles/main.scss?inline' + +import './components/Header.js' +import './components/Footer.js' + // global reset import './assets/styles/main.scss' @@ -26,9 +31,20 @@ export class App extends LitElement { } render() { - return Router.render() + return html` + ${Router.route.path == '/' ? '' : html``} + ${Router.render()} + ${Router.route.path == '/' ? '' : html``} + ` } + static styles = [ css`${unsafeCSS(MainCSS)}`, css` + :host { + display: flex; + flex-direction: column; + height: 100vh; + } +` ] } customElements.define('mm-app', App) diff --git a/src/components/Footer.js b/src/components/Footer.js index a770bfa..ebfbaa4 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -5,10 +5,16 @@ import MainCSS from '../assets/styles/main.scss?inline' import './SvgIcon.js' class Footer extends LitElement { - static properties = {} + static properties = { + path: { type: String } + } constructor() { super() + this.path = '' + } + + firstUpdated() { } render() { @@ -16,7 +22,7 @@ class Footer extends LitElement {