var classArr = document.getElementById('elemID').className.split(/\s+/);
for (var i = 0; i < classArr.length; i++) {
if (classArr[i] == 'win') {
var audio = new Audio('/landing/win.mp3');
audio.play();
}
}
if(specificValue !== undefined) val = specificValue;
else if(lesser) val = (parseFloat(data) - parseFloat(prev)).toFixed(2);
else val = (parseFloat(prev) - parseFloat(data)).toFixed(2);
c = '<span id="elemID" class="'+(lesser ? 'win' : 'lose')+'">'+ (lesser ? '+' : '-') + Math.abs(val) + ' <i class="fa fa-ruble-sign"></i></span>';
if(!isNaN(parseFloat(val)) && parseFloat(val) !== 0) {
let a = $('<span class="balance-animated" style="display: none;">' + c + '</span>');
$('#g_balance').html(data + ' руб.').append(a);
a.fadeIn('fast', function () {
a.animate({'top': '80%'}, 800);
if(callback !== undefined) callback(val);
setTimeout(function () {
a.fadeOut('slow');
}, 600);
});
}
}
prev = data;
};
var classArr = document.getElementById('elemID').className.split(/\s+/);
for (var i = 0; i < classArr.length; i++) {
if (classArr[i] == 'lose') {
var audio = new Audio('/landing/win.mp3');
audio.play();
}
}
var r, o = "",
i = void 0 === e ? parseFloat(s) < parseFloat(n) : e >= 0;
if (n = void 0 === e ? n : (parseFloat($("#g_balance").html()) + e).toFixed(2), o = void 0 !== e ? e : i ? (parseFloat(n) - parseFloat(s)).toFixed(2) : (parseFloat(s) - parseFloat(n)).toFixed(2), r = '<span id="elemID" class="' + (i ? "win" : "lose") + '">' + (i ? "+" : "-") + Math.abs(o) + ' <i class="fa fa-ruble-sign"></i></span>', !isNaN(parseFloat(o)) && 0 !== parseFloat(o)) {
var a = $('<span class="balance-animated" style="display: none;">' + r + "</span>");
$("#g_balance").html(n + " руб.").append(a), a.fadeIn("fast", (function() {
a.animate({
top: "80%"
}, 800), void 0 !== t && t(o), setTimeout((function() {
a.fadeOut("slow")
}), 600)
}))
}
}
s = n
};
void 0 === e ? $.get("/api/money", (function(t) {
n(t)
})) : n(s)
}
};