From f72b913ec6c99cf8c8a375c4a8d8c77041f298e1 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 3 Jun 2020 16:31:25 +0200 Subject: [PATCH] Updated welcome page --- pages/updates/updates.html | 1 + pages/welcome/welcome.css | 83 +++++++++++++++++++++++++++++--------- pages/welcome/welcome.html | 29 ++++++------- pages/welcome/welcome.js | 50 +++++++++++++++++++++++ 4 files changed, 130 insertions(+), 33 deletions(-) create mode 100644 pages/welcome/welcome.js diff --git a/pages/updates/updates.html b/pages/updates/updates.html index a19c7e95..95e19b88 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -26,6 +26,7 @@
  • Optimised version selection
  • Updated i18n (German)
  • Improved font color for dark mode
  • +
  • Updated welcome page
  • Please update your uBlock/uMatrix rules diff --git a/pages/welcome/welcome.css b/pages/welcome/welcome.css index 334e49bf..32fc8efe 100644 --- a/pages/welcome/welcome.css +++ b/pages/welcome/welcome.css @@ -43,9 +43,10 @@ hr { .btn-panel { cursor: default; font-family: 'Noto Sans', Arial, sans-serif; - margin: 35px auto; + margin: auto; max-width: 750px; display: flex; + justify-content: center; } .topic-badge { @@ -101,44 +102,80 @@ hr { */ .btn { - color: #fff; + color: #fff !important; font-weight: 600; - margin-right: 15px; + margin: 15px; padding: 11px 17px; text-decoration: none; text-align: center; + width: 100px; + border-radius: 4px; + border-style: solid; + border-width: 1px; +} + +.btn-text { + display: inline-flex; + align-items: center; + min-height: 40px; + justify-content: center; } .btn-gitlab { - background-color: #24292e; + background-color: #007bbd; + border-color: #00679e !important; } .btn-gitlab:hover { - background-color: #42474c; -} - -.btn-website { - background-color: #007bbd; -} - -.btn-website:hover { background-color: #00679e; } -.btn-donate { - background-color: #f7931a; +.btn-testing-utility { + background-color: #058300; + border-color: #034800 !important; } -.btn-donate:hover { +.btn-testing-utility:hover { + background-color: #034800; +} + +.btn-contact { + background-color: #f49b2f; + border-color: #f58700 !important; +} + +.btn-contact:hover { background-color: #f58700; } -.btn-author { - background-color: #00bd7f; +.btn-donate { + background-color: #007bbd; + border-color: #00679e !important; } -.btn-author:hover { - background-color: #009e69; +.btn-donate:hover { + background-color: #00679e; + } + +.btn-grid { + background: #fff; + -webkit-box-sizing: border-box; + box-sizing: border-box; + display: grid; + grid-gap: 16px; + grid-template-columns: repeat(2,1fr); + max-width: 752px; + padding: 16px; +} + +.btn-decentraleyes { + background-color: #777; + border-color: #444 !important; +} + +.btn-decentraleyes:hover { + background-color: #444; + } /** @@ -204,6 +241,14 @@ hr { text-align: center; } +#p-donate { + text-decoration: underline; +} + +#p-donate:hover { + cursor: pointer; +} + /** * Media Queries */ diff --git a/pages/welcome/welcome.html b/pages/welcome/welcome.html index 155837e7..fe309c58 100644 --- a/pages/welcome/welcome.html +++ b/pages/welcome/welcome.html @@ -10,19 +10,22 @@ +

    What's new in LocalCDN?

    -
    Differences between LocalCDN and Decentraleyes
    LocalCDN based on Decentraleyes. It includes more frameworks and more CDNs: -
      -
    • jQuery up to 3.4.1
    • -
    • Bootstrap CSS (Delivered by StackPath, NetDNA and MaxCDN)
    • -
    • Bootstrap JavaScript (Delivered by StackPath, NetDNA and MaxCDN)
    • -
    • AngularJS, AngularJS-Animate, AngularJS-Sanitize, AngularJS-Cookies and AngularJS-Touch
    • -
    • Generator to create uBlock/uMatrix rules
    • -
    - You can find a detailed overview on the add-on version history and on GitLab. +
    +
    Differences between LocalCDN and Decentraleyes
    LocalCDN based on Decentraleyes. It includes more frameworks and more CDNs: +
      +
    • jQuery up to 3.4.1
    • +
    • Bootstrap CSS (Delivered by StackPath, NetDNA and MaxCDN)
    • +
    • Bootstrap JavaScript (Delivered by StackPath, NetDNA and MaxCDN)
    • +
    • AngularJS, AngularJS-Animate, AngularJS-Sanitize, AngularJS-Cookies and AngularJS-Touch
    • +
    • Generator to create uBlock/uMatrix rules
    • +
    +

    You can find a detailed overview on the add-on version history and on Codeberg.

    +

    If you like LocalCDN, I would be happy about a small donation.

    @@ -48,11 +51,9 @@

    Learn more, or contribute

    diff --git a/pages/welcome/welcome.js b/pages/welcome/welcome.js new file mode 100644 index 00000000..57119e95 --- /dev/null +++ b/pages/welcome/welcome.js @@ -0,0 +1,50 @@ +/** + * Welcome Page + * Belongs to LocalCDN. + * + * @author nobody42 + * @since 2020-02-27 + * @license MPL 2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +'use strict'; + +/** + * Welcome + */ + +var welcome = {}; + + +/** + * Event Handlers + */ + +welcome._onDonationElementClicked = function () { + + if (event.button === 0 || event.button === 1) { + + chrome.tabs.create({ + 'url': chrome.extension.getURL('pages/donate/donate.html'), + 'active': (event.button === 0) + }); + } + + if (event.button === 0) { + window.close(); + } +}; + + +welcome._onDocumentLoaded = function () { + + let donationElement = document.getElementById('p-donate'); + donationElement.addEventListener('mouseup', welcome._onDonationElementClicked); + +}; + +document.addEventListener('DOMContentLoaded', welcome._onDocumentLoaded);