diff --git a/2023/js/main.js b/2023/js/main.js index ed776747..3d70062c 100644 --- a/2023/js/main.js +++ b/2023/js/main.js @@ -381,7 +381,7 @@ let miner_template1 = `

{{HASH}} - • + • {{EFF}} ({{EFF_COUNT}} shares) {{DIFF}} @@ -418,7 +418,7 @@ const miner_template2 = `

{{HASH}} - +
@@ -662,7 +662,7 @@ function adblock_check() { $(".ducoadspace").hide(); $('.adsbygoogle').fadeIn(); } - }, 1000); + }, 1000); } @@ -2044,7 +2044,7 @@ function miner_details(miner_id) {
- ${miners[miner_id]["accepted"]} + ${miners[miner_id]["accepted"]} / ${miners[miner_id]["accepted"]+miners[miner_id]["rejected"]} (${round_to(1, (miners[miner_id]["accepted"]/ @@ -2070,8 +2070,8 @@ function miner_details(miner_id) { Efficiency
- ${miner_efficiency} @@ -3327,8 +3327,8 @@ function register_end_2() { $("#register_button").removeClass("is-loading"); alert_bulma(`Your web browser couldn't connect to the Duino-Coin servers.

- We'd like to help, but there are many possible causes - - before asking the support, try disabling your browser extensions + We'd like to help, but there are many possible causes - + before asking the support, try disabling your browser extensions or similar programs and try again.

Make sure nothing blocks server2.duinocoin.com`); @@ -3474,8 +3474,8 @@ function generatePassword() { $("#reset_button").removeClass("is-loading"); alert_bulma(`Your web browser couldn't connect to the Duino-Coin servers.

- We'd like to help, but there are many possible causes - - before asking the support, try disabling your browser extensions + We'd like to help, but there are many possible causes - + before asking the support, try disabling your browser extensions or similar programs and try again.

Make sure nothing blocks server2.duinocoin.com`); @@ -3506,8 +3506,8 @@ if (recovery_username && recovery_hash) { .catch(err => { alert_bulma(`Your web browser couldn't connect to the Duino-Coin servers.

- We'd like to help, but there are many possible causes - - before asking the support, try disabling your browser extensions + We'd like to help, but there are many possible causes - + before asking the support, try disabling your browser extensions or similar programs and try again.

Make sure nothing blocks server2.duinocoin.com`); @@ -3745,3 +3745,46 @@ function updateValueDevices(e) { if (localStorage.getItem("shop-open-duco-cube")) { $(".info-dot").fadeOut(); } + +if ('serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker.register('/sw.js') + .then((registration) => { + console.log('Service Worker registered successfully with scope: ', registration.scope); + }) + .catch((error) => { + console.log('Service Worker registration failed: ', error); + }); + }); +} + +let deferredPrompt; + +document.addEventListener('DOMContentLoaded', () => { + const installButton = document.getElementById('pwa-install-btn'); + + if (!installButton) return; + + window.addEventListener('beforeinstallprompt', (e) => { + e.preventDefault(); + deferredPrompt = e; + + // Set to empty string to remove 'display: none' and let your CSS take over + installButton.style.display = ''; + }); + + installButton.addEventListener('click', async () => { + if (!deferredPrompt) return; + + deferredPrompt.prompt(); + + const { outcome } = await deferredPrompt.userChoice; + console.log(`User installation response: ${outcome}`); + + if (outcome === 'accepted') { + installButton.style.display = 'none'; + } + + deferredPrompt = null; + }); +}); diff --git a/assets/desktop-screenshot.png b/assets/desktop-screenshot.png new file mode 100644 index 00000000..55d61811 Binary files /dev/null and b/assets/desktop-screenshot.png differ diff --git a/assets/duco-192.png b/assets/duco-192.png new file mode 100644 index 00000000..ce415050 Binary files /dev/null and b/assets/duco-192.png differ diff --git a/assets/duco-512.png b/assets/duco-512.png new file mode 100644 index 00000000..120f2fb2 Binary files /dev/null and b/assets/duco-512.png differ diff --git a/assets/mobile-screenshot.png b/assets/mobile-screenshot.png new file mode 100644 index 00000000..c693616a Binary files /dev/null and b/assets/mobile-screenshot.png differ diff --git a/css/style.css b/css/style.css index db785848..2084d3c0 100644 --- a/css/style.css +++ b/css/style.css @@ -569,7 +569,7 @@ summary { .is-checkbox[type=checkbox] + label::before { border: 0.1rem solid black; } -} +} .is-checkbox[type=checkbox] + label::after { position: absolute; @@ -832,13 +832,13 @@ summary { height: 2em; } -.switch input { +.switch input { opacity: 0; width: 0; height: 0; } -.switch:before input { +.switch:before input { content: ""; opacity: 0; width: 0; @@ -874,11 +874,11 @@ input:before { } input:checked + .slider { - background-color: #2196F3; + background-color: #2196F3; } input:focus + .slider { - box-shadow: 0 0 1px #2196F3; + box-shadow: 0 0 1px #2196F3; } input:checked + .slider:before { @@ -915,12 +915,12 @@ input:checked + .slider:before { } #addFavorite { - border-top-left-radius: 0 !important; + border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; } #favoriteInput { - border-top-right-radius: 0 !important; + border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; } @@ -1213,8 +1213,8 @@ progress::-webkit-progress-value { } @keyframes blinker { - to { - visibility: hidden; + to { + visibility: hidden; } } diff --git a/index.html b/index.html index f2052ad3..71cf80aa 100644 --- a/index.html +++ b/index.html @@ -58,6 +58,8 @@ src="https://cdn.jsdelivr.net/npm/bulma-toast@2.3.1/dist/bulma-toast.min.js"> + + @@ -132,7 +134,7 @@

  • Folding@home
  • Mysterium MYST

  • - This message will be updated when a conclusive decision will be made. Sorry for any inconvenience. + This message will be updated when a conclusive decision will be made. Sorry for any inconvenience.