diff --git a/index.php b/index.php index 27dc946..7ba03be 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ $api_cg = json_decode(file_get_contents('coingecko.json'), true); // Configuration file $config = []; if (file_exists('config.php')) { - $config = require 'config.php'; + $config = require_once 'config.php'; } $display_servers_guru = isset($config['servers_guru']) && $config['servers_guru'] === true; @@ -106,5 +106,5 @@ foreach (array_reverse($preferred_currencies) as $currency) { } // Output the HTML -require 'templates/index.php'; +require_once 'templates/index.php'; ?> diff --git a/src/css/custom.css b/src/css/custom.css index 702ad95..6fda3a8 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -122,6 +122,18 @@ p { .btn { min-width: 38px; } + + #donation-qr { + width: auto; + height: 80vh; + max-width: 600px; + max-height: 600px; + } + + #donation-qr-container { + height: auto; + padding: 20px; + } } .bs-tooltip-auto { @@ -136,4 +148,20 @@ p { top: -1px; border-width: 0.4rem 0.4rem 0; border-top-color: #000; +} + +#donation-qr-container { + display: none; + justify-content: center; + align-items: center; + height: 100vh; +} + +#donation-qr { + width: 100%; + height: auto; +} + +#donation-qr-toggle:checked ~ #donation-qr-container { + display: flex; } \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index 9f99bd2..67758ad 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -3,6 +3,14 @@ import '../css/custom.css'; import Tooltip from 'bootstrap/js/dist/tooltip'; +///// +let inactivityTimeout = 30; // in seconds +let fetchInterval = 30; // in seconds +///// + +inactivityTimeout = inactivityTimeout * 1000; +fetchInterval = fetchInterval * 1000; + const tooltipTriggerList = Array.from(document.querySelectorAll('[data-toggle="tooltip"]')); const tooltipList = tooltipTriggerList.map(tooltipTriggerEl => new Tooltip(tooltipTriggerEl, { placement: 'top' })); console.log(tooltipList); @@ -14,13 +22,12 @@ const runConvert = () => lastModifiedField === 'xmr' ? xmrConvert() : fiatConvert(); let updateInterval -const startFetching = () => updateInterval = setInterval(fetchUpdatedExchangeRates, 5000); +const startFetching = () => updateInterval = setInterval(fetchUpdatedExchangeRates, fetchInterval); const stopFetching = () => { clearInterval(updateInterval) updateInterval = null; }; -const inactivityTimeout = 30 * 1000; // 30 seconds let lastActivity = Date.now() const resetActivity = () => lastActivity = Date.now() diff --git a/templates/index.php b/templates/index.php index c7c8575..1e4cd0b 100644 --- a/templates/index.php +++ b/templates/index.php @@ -121,7 +121,7 @@