Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 55 additions & 12 deletions 2023/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ let miner_template1 = `
</p>
<p class="subtitle is-size-6 shorttext">
{{HASH}}
&bull;
&bull;
<span class="{{EFF_COLOR}}">{{EFF}}</span>
<span class="is-hidden-mobile">({{EFF_COUNT}} shares)</span>
<span class="is-hidden-mobile">{{DIFF}}</span>
Expand Down Expand Up @@ -418,7 +418,7 @@ const miner_template2 = `
<div class="column ml-1 is-3 has-text-right">
<span>
{{HASH}}
</span>
</span>
</div>
<div class="column is-narrow mr-3 ml-3" onclick="miner_details('{{MINER_NUM}}')">
<i class="fa fa-chevron-right"></i>
Expand Down Expand Up @@ -662,7 +662,7 @@ function adblock_check() {
$(".ducoadspace").hide();
$('.adsbygoogle').fadeIn();
}
}, 1000);
}, 1000);
}


Expand Down Expand Up @@ -2044,7 +2044,7 @@ function miner_details(miner_id) {
</div>
<div class="column">
<b>
${miners[miner_id]["accepted"]}
${miners[miner_id]["accepted"]}
/
${miners[miner_id]["accepted"]+miners[miner_id]["rejected"]}
</b> (${round_to(1, (miners[miner_id]["accepted"]/
Expand All @@ -2070,8 +2070,8 @@ function miner_details(miner_id) {
Efficiency
</div>
<div class="column">
<progress class="progress ${efficiency_color} show-value"
min="0" max="100"
<progress class="progress ${efficiency_color} show-value"
min="0" max="100"
value="${miner_efficiency}">
${miner_efficiency}
</progress>
Expand Down Expand Up @@ -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.<br><br>

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.<br><br>

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

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.<br><br>

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

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.<br><br>

Make sure nothing blocks server2.duinocoin.com`);
Expand Down Expand Up @@ -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;
});
});
Binary file added assets/desktop-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/duco-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/duco-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mobile-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ summary {
.is-checkbox[type=checkbox] + label::before {
border: 0.1rem solid black;
}
}
}

.is-checkbox[type=checkbox] + label::after {
position: absolute;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -1213,8 +1213,8 @@ progress::-webkit-progress-value {
}

@keyframes blinker {
to {
visibility: hidden;
to {
visibility: hidden;
}
}

Expand Down
36 changes: 25 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
src="https://cdn.jsdelivr.net/npm/bulma-toast@2.3.1/dist/bulma-toast.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="theme-color" content="#ff4112">
<link rel="apple-touch-icon" href="/assets/duco-192.png">
</head>

<body>
Expand Down Expand Up @@ -132,7 +134,7 @@ <h1 class="subtitle">
<li><a href="https://foldingathome.org" target="_blank">Folding@home</a></li>
<li><a href="https://www.mysterium.network" target="_blank">Mysterium MYST</a></li>
</ul><br>
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.
</div>
<button class="button is-fullwidth" onclick="location.reload()">
Back to login
Expand Down Expand Up @@ -656,6 +658,11 @@ <h1 class="subtitle">
<i class="beta fa fa-flask"></i>
</center>
</div>
<div id="pwa-install-btn" class="navbar-item navbar-button" title="Install App" style="display: none;">
<center>
<i class="fa fa-lg fa-download"></i>
</center>
</div>
<div class="navbar-item navbar-button">
<center>
<a href="https://duinocoin.com/donate.html" target="_blank">
Expand Down Expand Up @@ -961,11 +968,11 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/outlined-logo-collection?product=1303&variation=104485" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>

<div class="column" style="min-width:280px">
<div class="box">
<div class="columns">
Expand Down Expand Up @@ -993,7 +1000,7 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/drip-collection-december-2021?product=1566&variation=104936" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>
Expand All @@ -1011,7 +1018,7 @@ <h1 class="subtitle">
Stonks tee
</p>
<p class="subtitle is-size-6">
Stonks or not stonks?
Stonks or not stonks?
</p>
</div>
</div>
Expand All @@ -1025,7 +1032,7 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/june-2022-duino-stonks?product=389&variation=100019" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>
Expand All @@ -1043,7 +1050,7 @@ <h1 class="subtitle">
Pullover hoodie
</p>
<p class="subtitle is-size-6">
Classic, warm hoodie with the Duino logo
Classic, warm hoodie with the Duino logo
</p>
</div>
</div>
Expand All @@ -1057,7 +1064,7 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/drip-collection-december-2021?product=377&variation=100057&size=3029" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -1089,7 +1096,7 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/basic-duino-tee?product=389&variation=100019" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -1121,7 +1128,7 @@ <h1 class="subtitle">
<a target="_blank" href="https://store.duinocoin.com/listing/duino-coin-accessories?product=1566&variation=104936" class="button is-fullwidth">
View in store
</a>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -3027,7 +3034,14 @@ <h1 class="heading">Account details</h1>
<span id="alert_content">CONTENT</span>
</div>
</div>
<script src="2023/js/main.js?v=4"></script>

<script src="2023/js/main.js?v=4"></script>
<script>
let deferredPrompt;
const installBanner = document.getElementById('pwa-install-banner');
const installButton = document.getElementById('pwa-install-btn');

</script>
</body>


Expand Down
13 changes: 13 additions & 0 deletions sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// A minimal, network-only Service Worker
self.addEventListener('install', (event) => {
self.skipWaiting(); // Forces the waiting service worker to become the active service worker
});

self.addEventListener('activate', (event) => {
event.waitUntil(clients.claim()); // Ensure the service worker takes control immediately
});

self.addEventListener('fetch', (event) => {
// Pass all requests straight to the network without touching any cache
event.respondWith(fetch(event.request));
});
49 changes: 35 additions & 14 deletions wallet.webmanifest
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
{
"name": "Duino-Coin Web Wallet",
"short_name": "wallet",
"description": "Duino-Coin Web Wallet",
"icons": [
{
"src": "/assets/duco.svg",
"sizes": "400x400",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "fullscreen",
"theme_color": "#f79f1f"
}
"name": "Duino-Coin Web Wallet",
"short_name": "wallet",
"description": "Duino-Coin Web Wallet",
"start_url": "/index.html",
"display": "fullscreen",
"theme_color": "#ff4112",
"background_color": "#ffffff",
"icons": [
{
"src": "/assets/duco-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/assets/duco-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}
],
"screenshots": [
{
"src": "/assets/desktop-screenshot.png",
"sizes": "1280x720",
"type": "image/png",
"form_factor": "wide"
},
{
"src": "/assets/mobile-screenshot.png",
"sizes": "720x1280",
"type": "image/png"
}
]
}