Skip to content

Commit

Permalink
WIP: Added all ids for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kcw-grunt committed Apr 14, 2023
1 parent 9cfb8ac commit cda3a62
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 33 deletions.
20 changes: 11 additions & 9 deletions litecoin-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
const ms = 3000;
var ltcusd = 90.01;
var marketcap = 6.6;
var circulating = 720619370.0;
var result;
var circulating = 720619370.0;

var result;
function refreshLTCStats() {

setTimeout(refreshLTCStats, ms);
Expand All @@ -20,6 +20,7 @@ function refreshLTCStats() {
}

function updateValues(market) {

ltcusd = JSON.stringify(market.body.market_data.current_price.usd);
marketcap = Number((circulating * ltcusd / 1000000000).toFixed(2));
circulating = Number(JSON.stringify(market.body.market_data.circulating_supply));
Expand All @@ -34,27 +35,27 @@ setTimeout(refreshLTCStats, ms);
let isMinute = false;
let isDay = false;
let isHour = false;
let halvingdayEl = document.getElementById("text-halving-days");
let halvingdayEl = document.getElementById("textHalvingValue");
let times = 0;
const countDownDate = new Date("2023-08-03");
let counts = setInterval(() =>{
let now = new Date();
let difference = countDownDate.getTime() - now.getTime();
if(difference <= ((604800000 * 4) + (86400000 * 3))){
let minutes = Math.floor(difference / (60 * 1000));
document.getElementById("text-halving-days").innerText = "Halving in " + minutes + " minutes.";
document.getElementById("textHalvingValue").innerText = minutes;
isMinute = true;
isDay = false;
isHour = false;
}else if(difference <= ((604800000 * 8) + (86400000 * 5))){
let hour = Math.floor(difference / (3600 * 1000));
document.getElementById("text-halving-days").innerText = "Halving in " + hours + " hours.";
document.getElementById("textHalvingValue").innerText = hours;
isMinute = false;
isDay = false;
isHour = true;
}else if(difference >= 0){
let days = Math.floor(difference / (24 * 3600 * 1000));
document.getElementById("text-halving-days").innerText = "Halving in " + days + " days.";;
document.getElementById("textHalvingValue").innerText = days;
isMinute = false;
isDay = true;
isHour = false;
Expand All @@ -67,8 +68,9 @@ let isMinute = false;
let twoDaysEarlier = new Date("2023-08-01")
if(now.getTime() >= twoDaysEarlier.getTime()){
clearInterval(counts)
document.getElementById("text-halving-days").innerText = "";
}
document.getElementById("textHalvingValue").innerText = "";
}


let currentYear = document.getElementById('year');
currentYear.textContent = new Date().getFullYear();
currentYear.textContent = new Date().getFullYear();
Loading

0 comments on commit cda3a62

Please sign in to comment.