Merge pull request #3 from recanman/main

todo2
This commit is contained in:
rottenwheel 2024-10-05 07:41:42 +00:00 committed by GitHub
commit 3bfbe0b1c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 40 additions and 5 deletions

View file

@ -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';
?>

View file

@ -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;
}

View file

@ -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()

View file

@ -121,7 +121,7 @@
<?php echo $info;
if ($display_servers_guru) {
echo $servers_guru;
};
}
echo $attribution; ?>
</small>
<hr />