From b40915578ddf0076a6bd40436179157692661d3e Mon Sep 17 00:00:00 2001 From: Christian Pierre MOMON Date: Fri, 20 Dec 2019 04:35:15 +0100 Subject: [PATCH] Customized header, footer and promo boxes (#4042). --- app/ui/footer.js | 73 ++++++-------------------------------------- app/ui/header.js | 73 +++++++++++++++++++++++++++++--------------- public/chapril.css | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 88 deletions(-) create mode 100644 public/chapril.css diff --git a/app/ui/footer.js b/app/ui/footer.js index bd332896..c26cefd8 100644 --- a/app/ui/footer.js +++ b/app/ui/footer.js @@ -1,5 +1,7 @@ const html = require('choo/html'); const Component = require('choo/component'); +const version = require('../../package.json').version; +/*const { browserName } = require('../utils');*/ class Footer extends Component { constructor(name, state) { @@ -12,73 +14,18 @@ class Footer extends Component { } createElement() { - const translate = this.state.translate; - - // Add additional links from configuration if available - var links = []; - if (this.state != undefined && this.state.WEB_UI != undefined) { - const WEB_UI = this.state.WEB_UI; - - if (WEB_UI.FOOTER_DONATE_URL != '') { - links.push(html` -
  • - - ${translate('footerLinkDonate')} - -
  • - `); - } - if (WEB_UI.FOOTER_CLI_URL != '') { - links.push(html` -
  • - - ${translate('footerLinkCli')} - -
  • - `); - } - if (WEB_UI.FOOTER_DMCA_URL != '') { - links.push(html` -
  • - - ${translate('footerLinkDmca')} - -
  • - `); - } - if (WEB_UI.FOOTER_SOURCE_URL != '') { - links.push(html` -
  • - - ${translate('footerLinkSource')} - -
  • - `); - } - } else { - links.push(html` -
  • - - ${translate('footerLinkSource')} - -
  • - `); - } - return html` `; } diff --git a/app/ui/header.js b/app/ui/header.js index c6edc5e1..93c8717d 100644 --- a/app/ui/header.js +++ b/app/ui/header.js @@ -1,8 +1,8 @@ const html = require('choo/html'); const Component = require('choo/component'); const Account = require('./account'); -const assets = require('../../common/assets'); -const { platform } = require('../utils'); +/*const assets = require('../../common/assets');*/ +/*const { platform } = require('../utils');*/ class Header extends Component { constructor(name, state, emit) { @@ -18,32 +18,55 @@ class Header extends Component { } createElement() { - const title = - platform() === 'android' - ? html` - - - - - - - ` - : html` - - ${this.state.translate('title')} - - - - - `; return html`
    - ${title} ${this.account.render()} + +
    +
    + + + +
    +
    +
    `; } diff --git a/public/chapril.css b/public/chapril.css new file mode 100644 index 00000000..4ea914bb --- /dev/null +++ b/public/chapril.css @@ -0,0 +1,76 @@ +#chapril-banner { + /* position: fixed; */ + + /* top: 0; */ + height: 42px !important; + width: 100%; + margin: 0; + padding: 0; + background-color: #fafafa; + text-align: center; + border-bottom: 1px solid #bdbdbd; +} + +#chapril-banner-zone { + width: 100%; + + /* max-width: 950px; */ + margin: 0 auto; + padding: 0; + text-align: left; + + /* border: solid 1px red; */ +} + +#chapril-banner-zone > div { + float: left; + margin: 0 15px; +} + +#chapril-banner-menu > ul { + margin: 0; + padding: 0; + list-style: none; + text-align: justify; + box-sizing: border-box; +} + +#chapril-banner-menu > ul > li { + float: left; + margin: 0 10px 0 0; + padding: 0; + display: block; + box-sizing: border-box; + font-family: 'DejaVu Sans', Verdana, Geneva, sans-serif !important; + height: 42px; +} + +#chapril-banner-menu > ul > li:hover { + background-color: #dadada; +} + +#chapril-banner-menu > ul > li > a { + height: 42px; + color: #555000; + font-size: 12px; + text-decoration: none !important; + line-height: 42px; + border: none !important; + padding: 10px 15px; +} + +#chapril-banner-aprillogo { + float: right !important; +} + +#chapril-banner-aprillogo > a > img { + padding-top: 2px; +} + +#chapril-banner-zone > div > a > img { + height: auto !important; +} + +.send-promo { + display: none; +}